dknowles2 / ha-pitboss

Home Assistant Custom Integration for PitBoss smokers and grills
MIT License
33 stars 4 forks source link

All entities grayed out after adding integration #39

Closed savdagod closed 10 months ago

savdagod commented 10 months ago

System Health details

System Information

version core-2024.1.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.71-haos
arch x86_64
timezone America/New_York
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4840 Installed Version | 1.33.0 Stage | running Available Repositories | 1376 Downloaded Repositories | 24
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | December 18, 2024 at 7:00 PM relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | false remote_server | us-east-1-2.ui.nabu.casa certificate_status | ready instance_id | 599a136f6ea74e00b69aacb75e70d4c1 can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 11.4 -- | -- update_channel | stable supervisor_version | supervisor-2023.12.0 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 58.3 GB disk_used | 20.2 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | MariaDB (2.6.1), Studio Code Server (5.15.0), Samba share (12.2.0), Home Assistant Google Drive Backup (0.112.1), ESPHome (2023.12.5), Mosquitto broker (6.4.0), PS5 MQTT (1.3.1), Frigate Proxy (1.4), Zigbee2MQTT Proxy (0.2.0), Matter Server (5.0.2), chrony (3.0.1), Scrypted (18-jammy-full.s6-v0.80.0)
Dashboards dashboards | 5 -- | -- resources | 14 views | 28 mode | storage
Recorder oldest_recorder_run | January 1, 2024 at 4:24 PM -- | -- current_recorder_run | January 11, 2024 at 9:11 PM estimated_db_size | 1781.08 MiB database_engine | mysql database_version | 10.6.12
Spotify api_endpoint_reachable | ok -- | --

Checklist

Describe the issue

PitBoss grill is recognized briefly however after adding the integration, entities are grayed out and say unavailable. I have 3 ESP32 Bluetooth proxies, one of which I had hanging over the grill so it's not a range issue. Logs seem to indicate that it cannot make a connection. Active scanning is enabled on all proxies.

Reproduction steps

  1. Wait for grill to be auto discovered (takes a LONG time and is not instant. Adding manually doesn't work)
  2. Select model (my model is the PB700FBW2)
  3. All entities grayed out and unavailable ...

Debug logs

2024-01-11 20:40:34.945 DEBUG (MainThread) [custom_components.pitboss] Bluetooth device detected: <habluetooth.models.BluetoothServiceInfoBleak object at 0x7fad7e187ec0> (BluetoothChange.ADVERTISEMENT)
2024-01-11 20:40:34.946 DEBUG (MainThread) [custom_components.pitboss] Resetting device: 4F:91:BA:B0:62:94: PBC-0FA79A8
2024-01-11 20:40:34.946 DEBUG (MainThread) [custom_components.pitboss] Resetting device: 4F:91:BA:B0:62:94: PBC-0FA79A8
2024-01-11 20:40:34.946 DEBUG (MainThread) [pytboss] Resetting device to: 4F:91:BA:B0:62:94: PBC-0FA79A8
2024-01-11 20:40:34.946 DEBUG (MainThread) [pytboss] Disconnecting from device.
2024-01-11 20:40:34.947 INFO (MainThread) [custom_components.pitboss] Found PitBoss smoker: PBC-0FA79A8 @ 4F:91:BA:B0:62:94
2024-01-11 20:44:24.909 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aioesphomeapi/client.py", line 568, in bluetooth_device_connect
    await connect_future
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/bleak_esphome/backend/client.py", line 77, in _async_wrap_bluetooth_operation
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak_esphome/backend/client.py", line 297, in connect
    await self._client.bluetooth_device_connect(
  File "/usr/local/lib/python3.11/site-packages/aioesphomeapi/client.py", line 588, in bluetooth_device_connect
    raise TimeoutAPIError(
aioesphomeapi.core.TimeoutAPIError: Timeout waiting for connect response while connecting to 4F:91:BA:B0:62:94 after 20.0s, disconnect timed out: True,  after 20.0s

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 363, in establish_connection
    await client.connect(
  File "/usr/local/lib/python3.11/site-packages/habluetooth/wrappers.py", line 295, in connect
    connected = await super().connect(**kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 605, in connect
    return await self._backend.connect(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak_esphome/backend/client.py", line 79, in _async_wrap_bluetooth_operation
    raise asyncio.TimeoutError(str(err)) from err
TimeoutError: Timeout waiting for connect response while connecting to 4F:91:BA:B0:62:94 after 20.0s, disconnect timed out: True,  after 20.0s

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/pitboss/coordinator.py", line 62, in reset_device
    await self.conn.reset_device(device)
  File "/usr/local/lib/python3.11/site-packages/pytboss/ble.py", line 125, in reset_device
    await self.connect()
  File "/usr/local/lib/python3.11/site-packages/pytboss/ble.py", line 87, in connect
    self._ble_client = await bleak_retry_connector.establish_connection(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 387, in establish_connection
    _raise_if_needed(name, device.address, exc)
  File "/usr/local/lib/python3.11/site-packages/bleak_retry_connector/__init__.py", line 327, in _raise_if_needed
    raise BleakNotFoundError(msg) from exc
bleak_retry_connector.BleakNotFoundError: PBC-0FA79A8 - 4F:91:BA:B0:62:94: Failed to connect after 11 attempt(s): Timeout waiting for connect response while connecting to 4F:91:BA:B0:62:94 after 20.0s, disconnect timed out: True,  after 20.0s

Diagnostics dump

No response

savdagod commented 10 months ago

Upon some further tests with the PitBoss app itself, it seems like the radio on my unit is defective. Standing 6ft line of sight with the grill and I cannot connect to Bluetooth using the official app. Trying to get it to connect to WiFi from inside my garage (which has many WiFi devices all connected) and it doesn’t see a single network nor will it connect manually. I am going to try to get a replacement and test that out then report back if I still have the same issues. It’s crazy that a $20 Govee meat thermometer can connect to a Bluetooth proxy located 50+ft on the other side of my house with the garage door closed and multiple walls but this thing can barely connect to a device in the same room.

dknowles2 commented 10 months ago

Yeah the radio components (both WiFi and Bluetooth) in the grills are generally pretty flaky. The boards are based on the ESP32 chipset but I get the impression that there's not a good antenna connected to them. There's not a whole lot I can do on my end to improve this.

savdagod commented 10 months ago

I know this is closed but I took the front off the controller and installed it just hanging while wiggling the antenna (which to me. the cable seems a bit loose) and it seems to have both connected to my Wifi as well as register with HA. I've ordered an IPEX antenna extender along with an antenna that I will mount to the side of my grill to give it better range. Sucks you have to do this but it's a cheap upgrade that will hopefully solve people's connection issues if they come across this.

rsabol77 commented 10 months ago

This is closed but now having same issue. I added a proxy and everything worked great, ESPHome updated and I lost it. I deleted it and it re added and seemed to be working. Then ESPhome updated again and now everything says unavailable. I have an esp32 presence and it is seeing the pitboss so I know the bluetooth is working. When i delete the integration it recognizes its there and re adds it but all the entities are unavailable. Sucks I had it working for one cook and absolutely loved it. I would like to use it over the actual pb app. Has anyone seen this with the updates?

savdagod commented 10 months ago

What works for me is refreshing the integration until it connects. I built a script that I can run from my grill dashboard that refreshes it every 10 sec until it sees the grill and times out after 30 tries. I can post the script here but that’s what works for me if it’s not connecting automatically. Just replace your entity IDs. The override variable is so I can force it to reconnect from my dashboard by holding the icon instead of tapping. You also need to create a counter helper. I also found that it usually connects at some point during the burnoff/preheat when I'm starting a cook, so I'd try just running it for 10 minutes and see if it just connects on it's own. You also don't have to have it running for it to connect, you can just plug it in and run the script and it should connect while the grill is off.

alias: Refresh PitBoss Integration
sequence:
  - if:
      - condition: or
        conditions:
          - condition: state
            entity_id: sensor.grill_probe_1
            state: unavailable
          - condition: template
            value_template: "{{ override == true }}"
    then:
      - service: counter.reset
        target:
          entity_id: counter.pit_boss_refresh_amount
        data: {}
      - repeat:
          sequence:
            - service: homeassistant.reload_config_entry
              target:
                entity_id: climate.grill
              data: {}
            - service: counter.increment
              target:
                entity_id: counter.pit_boss_refresh_amount
              data: {}
            - delay:
                hours: 0
                minutes: 0
                seconds: 10
                milliseconds: 0
          until:
            - condition: or
              conditions:
                - condition: not
                  conditions:
                    - condition: state
                      entity_id: sensor.grill_probe_1
                      state: unavailable
                - condition: numeric_state
                  entity_id: counter.pit_boss_refresh_amount
                  above: 29
      - if:
          - condition: state
            entity_id: sensor.grill_probe_1
            state: unavailable
        then:
          - service: notify.persistent_notification
            metadata: {}
            data:
              title: PitBoss Grill
              message: Connecting to the grill timed out. Please try again.
mode: single
icon: mdi:refresh-auto
rsabol77 commented 10 months ago

Awesome the refresh worked. I haven’t got a chance to work with the script but I am deficient going to. Thanks for sharing!