Closed TTLucian closed 1 month ago
Same here. I couldn't actually complete the upgrade until I disabled this integration. I'm happy to post logs or test.
If I update my proxy wirelessly I loose mine every time. If I update plugged in it’s good to go.
Same situation here. I'm installed via container and HASS goes into an infinite loop on startup with:
2024-10-04 06:00:47.066 INFO (MainThread) [homeassistant.components.sensor] Setting up pitboss.sensor
2024-10-04 06:00:47.066 INFO (MainThread) [homeassistant.components.switch] Setting up pitboss.switch
2024-10-04 06:00:47.117 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up pitboss.binary_sensor
2024-10-04 06:00:47.119 INFO (MainThread) [homeassistant.components.climate] Setting up pitboss.climate
Because it never completes, HASS itself never comes up (I guess it must complete setup of all entities before it continues to start the UI/broker/etc)
FYI: This continues to happen with the 2024.10.1 update
I grabbed some more information. After startup, the integration seemed to load up fine. About 7.5 seconds later, the same grill with a different address is found. It attempts to set up the sensors/etc, but then goes into the infinite loop.
I was looking through the code. I don't know enough about BLE and connections w/ BLE, but it seems strange that the same grill would appear again with a different address. I have a spare ESP32 sitting around so I set it up to log BLE advertisements. So far it seems to be pretty stable in detecting the same "PBL-64B70811A7F0"... but at different addresses. So I guess it's normal that the BLE address will change, but in the log output below it seemed to be some kind of a trigger for the infinite loop
2024-10-05 16:39:40.105 INFO (MainThread) [custom_components.pitboss] Found PitBoss smoker: PBL-64B70811A7F0 @ 76:51:8D:0C:32:D2
2024-10-05 16:39:40.112 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to read_text with args (PosixPath('/usr/local/lib/python3.12/site-packages/pytboss/grills.json'),) inside the event loop by custom integration 'pitboss' at custom_components/pitboss/config_flow.py, line 58: models = [g.name for g in grills.get_grills(control_board=control_board)] (offender: /usr/local/lib/python3.12/site-packages/pytboss/grills.py, line 295: grills_json = resources.files(__package__).joinpath("grills.json").read_text()), please create a bug report at https://github.com/dknowles2/ha-pitboss/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#read_text
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/util/async_.py", line 112, in sem_task
return await task
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1287, in async_init
flow, result = await self._async_init(flow_id, handler, context, data)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1322, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 520, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
File "/config/custom_components/pitboss/config_flow.py", line 36, in async_step_bluetooth
return await self.async_step_user()
File "/config/custom_components/pitboss/config_flow.py", line 58, in async_step_user
models = [g.name for g in grills.get_grills(control_board=control_board)]
2024-10-05 16:39:40.117 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args (PosixPath('/usr/local/lib/python3.12/site-packages/pytboss/grills.json'),) inside the event loop by custom integration 'pitboss' at custom_components/pitboss/config_flow.py, line 58: models = [g.name for g in grills.get_grills(control_board=control_board)] (offender: /usr/local/lib/python3.12/pathlib.py, line 1027: with self.open(mode='r', encoding=encoding, errors=errors) as f:), please create a bug report at https://github.com/dknowles2/ha-pitboss/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/util/async_.py", line 112, in sem_task
return await task
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1287, in async_init
flow, result = await self._async_init(flow_id, handler, context, data)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1322, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 520, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
File "/config/custom_components/pitboss/config_flow.py", line 36, in async_step_bluetooth
return await self.async_step_user()
File "/config/custom_components/pitboss/config_flow.py", line 58, in async_step_user
models = [g.name for g in grills.get_grills(control_board=control_board)]
2024-10-05 16:41:28.456 INFO (MainThread) [homeassistant.setup] Setting up pitboss
2024-10-05 16:41:28.498 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up pitboss.binary_sensor
2024-10-05 16:41:28.500 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_probe_1_error
2024-10-05 16:41:28.517 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_probe_2_error
2024-10-05 16:41:28.528 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_probe_3_error
2024-10-05 16:41:28.543 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_startup_error
2024-10-05 16:41:28.549 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_high_temperature_error
2024-10-05 16:41:28.554 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_fan_error
2024-10-05 16:41:28.560 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_igniter_error
2024-10-05 16:41:28.564 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_auger_error
2024-10-05 16:41:28.576 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_no_pellets
2024-10-05 16:41:28.580 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.pitboss entity: binary_sensor.pbl_64b70811a7f0_auger
2024-10-05 16:41:28.584 INFO (MainThread) [homeassistant.components.climate] Setting up pitboss.climate
2024-10-05 16:41:28.587 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new climate.pitboss entity: climate.pbl_64b70811a7f0_grill_temperature
2024-10-05 16:41:28.596 INFO (MainThread) [homeassistant.components.light] Setting up pitboss.light
2024-10-05 16:41:28.597 INFO (MainThread) [homeassistant.components.sensor] Setting up pitboss.sensor
2024-10-05 16:41:28.598 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.pitboss entity: sensor.pbl_64b70811a7f0_probe_1
2024-10-05 16:41:28.630 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.pitboss entity: sensor.pbl_64b70811a7f0_probe_2
2024-10-05 16:41:28.644 INFO (MainThread) [homeassistant.components.switch] Setting up pitboss.switch
2024-10-05 16:41:28.645 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.pitboss entity: switch.pbl_64b70811a7f0_module_power
2024-10-05 16:41:28.652 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.pitboss entity: switch.pbl_64b70811a7f0_prime
2024-10-05 16:42:35.221 INFO (MainThread) [custom_components.pitboss] Found PitBoss smoker: PBL-64B70811A7F0 @ 43:1A:7B:4A:8B:D6
2024-10-05 16:42:35.433 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up pitboss.binary_sensor
2024-10-05 16:42:35.496 INFO (MainThread) [homeassistant.components.climate] Setting up pitboss.climate
2024-10-05 16:42:35.497 INFO (MainThread) [homeassistant.components.light] Setting up pitboss.light
2024-10-05 16:42:35.497 INFO (MainThread) [homeassistant.components.sensor] Setting up pitboss.sensor
2024-10-05 16:42:35.498 INFO (MainThread) [homeassistant.components.switch] Setting up pitboss.switch
<repeats the last four lines forever>
FWIW: The only bluetooth related change advertised in the 2024.10.0 chagelog was this one: https://github.com/home-assistant/core/pull/126555
Maybe related if the pitboss is changing its advertising address?
024-10-06 19:44:31.591 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args (PosixPath('/usr/local/lib/python3.12/site-packages/pytboss/grills.json'),) inside the event loop by custom integration 'pitboss' at custom_components/pitboss/coordinator.py, line 41: self.grill_spec = get_grill(model) (offender: /usr/local/lib/python3.12/pathlib.py, line 1027: with self.open(mode='r', encoding=encoding, errors=errors) as f:), please create a bug report at https://github.com/dknowles2/ha-pitboss/issues
Same issue here. Caused my HA to crash after a few minutes due to memory leak. Disabled integration and fixed the issue.
I guess I'll disable it for the time being until he updates the integration so it doesn't crash. Maybe my 2024.10.1 update will take without crashing.
update, after disabling it, update took etc. stable so please fix @dknowles2 please fix the integration thank. Ill buy you a coffee of 10 of them! you have my word.
Sorry, I've been busy with other stuff. I'll try and take a closer look tonight. Of note: the warning about the blocking call almost certainly unrelated.
Thanks
Also setup by me a coffee account/link so we can buy ypu a coffee
Thanks, @dknowles2 - I think we have the same grill (according to docs), but if you're unable to reproduce or need a tester, just shout.
I pushed a new 2024.10.0 version which I think will fix the problem (as well as the warning about the blocking call on the event loop).
Please re-open if it doesn't fix things: when working on a fix, a typo in my repro code inadvertently cleared whatever was triggering the infinite loop and let it complete the upgrade to HA 2024.10. I'm fairly confident that #65 fixes the bug, but my local development instance can't reproduce the bug anymore. 😵💫
Thanks you
Heey! It's alive again! Thanks so much! 😅
System Health details
?
Checklist
Describe the issue
As soon as I power up the grill HA 2024.10.0 errors and crashes. Yesterday it was working fine. Today, after upgrading HA to 2024.10.0, it errors and crashes home assistant in a loop. Had to hard reset the vm and unplug all the ble proxies in order to get HA to start. And then disable the PitBoss integration altogether!
Reproduction steps
1. 2. 3. ...
Debug logs
Diagnostics dump
No response