home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.58k stars 29.91k forks source link

ZHA failing to start with Conbee 2 after some hours working #108778

Closed hybrixxx closed 4 months ago

hybrixxx commented 7 months ago

The problem

I was running HA 2023.11.3 Supervised with ZHA (Conbee 2 hardware) and without issues in my VM with Debian 11 and Docker on a Windows PC . I've updated HA Core to 2024.1.5, ZHA starts working at the beginning, but after first HA restart, ZHA is not able to load unless I reboot the complete Windows PC.

I'm including logs generated after this first reboot which show ZHA unable to load.

It's important to mention that after I restore HA Core 2023.11.3, I need to restart again the PC to get ZHA loaded (just 1 restart after restoring and works smoothly again). It seems like the Conbee 2 stick gets "hanged" or "locked" somehow and the only way to recover it is with the Windows PC reboot.

What version of Home Assistant Core has the issue?

2024.1.5

What was the last working version of Home Assistant Core?

2023.11.3

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

ZHA

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zha

Diagnostics information

home-assistant.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-01-24 14:13:07.562 DEBUG (MainThread) [zigpy.serial] Opening a serial connection to '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2132331-if00' (115200 baudrate)
2024-01-24 14:13:07.575 DEBUG (MainThread) [zigpy_deconz.api] Sending CommandId.read_parameter{'parameter_id': <NetworkParameter.protocol_version: 34>, 'parameter': b''} (seq=1)
2024-01-24 14:13:09.377 DEBUG (MainThread) [zigpy_deconz.api] No response to 'CommandId.read_parameter' command with seq 1
2024-01-24 14:13:09.378 DEBUG (MainThread) [zigpy_deconz.api] Serial '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2132331-if00' connection lost unexpectedly: None
2024-01-24 14:13:09.482 DEBUG (MainThread) [homeassistant.components.zha] Failed to set up ZHA

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @dmulcahey, @adminiuga, @puddly, @thejulianjes, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zha` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zha` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

luisrochasp commented 7 months ago

I have the same problem. After the update, my devices connected to the electrical network (switches) are offline and unavailable. Help me please.

disruptivepatternmaterial commented 7 months ago

I have the same problem. After the update, my devices connected to the electrical network (switches) are offline and unavailable. Help me please.

You need to rollback to one of the versions in December. If you look at the issues there are a good chunk of people who have not been able to get this to work for about 3-4 weeks with the last 2 (I think) releases. I am on 2023.12.1 and things work fine. I check back here from time to time to see if the devs have fixed this or not. Since I am not one of them I am not sure what is going on...but thankful it is easy enough to roll back. Well easy enough if you use docker...

hybrixxx commented 7 months ago

I have the same problem. After the update, my devices connected to the electrical network (switches) are offline and unavailable. Help me please.

You need to rollback to one of the versions in December. If you look at the issues there are a good chunk of people who have not been able to get this to work for about 3-4 weeks with the last 2 (I think) releases. I am on 2023.12.1 and things work fine. I check back here from time to time to see if the devs have fixed this or not. Since I am not one of them I am not sure what is going on...but thankful it is easy enough to roll back. Well easy enough if you use docker...

Fortunately I have been able to rollback very easy. I'm updating HA to each new version to test if ZHA works again, and when not, I rollback to 2023.11.3 which works smooth for me. Thanks

stevegroom commented 7 months ago

...but thankful it is easy enough to roll back. Well easy enough if you use docker..

Hi, I have HA Yellow - which I think is using docker under the hood. I found instructions on restoring from backup, but not on how to identify the previous versions installed and how to downgrade.

hybrixxx commented 7 months ago

Ciao, not sure if you had time to check this @dmulcahey, @Adminiuga , @puddly , @TheJulianJES . Thanks guys

Starf0x commented 7 months ago

I have the same problem. After the update, my devices connected to the electrical network (switches) are offline and unavailable. Help me please.

You need to rollback to one of the versions in December. If you look at the issues there are a good chunk of people who have not been able to get this to work for about 3-4 weeks with the last 2 (I think) releases. I am on 2023.12.1 and things work fine. I check back here from time to time to see if the devs have fixed this or not. Since I am not one of them I am not sure what is going on...but thankful it is easy enough to roll back. Well easy enough if you use docker...

Rollback doesn't resolve it for me with Zigbee Yellow.

puddly commented 7 months ago

Please try the latest release of HA Core and the multiprotocol addon.

sabbatho commented 7 months ago

Also using skyconnect. I just got these after normal restart of Home Assistant, have all the latest versions, now ZHA is not starting up at all:

bild

bild

bild

Have not been stable since 2024.1.0 and around the same time the Silicon Labs Multiprotocol addon was updated.

puddly commented 7 months ago

Can you upload debug logs for the addon as well?

hybrixxx commented 7 months ago

Can you upload debug logs for the addon as well?

I'm not using multiprotocol add-on, I have conbee 2 which doesn't support thread.

sabbatho commented 7 months ago

I had to reboot HA OS to get it to start again. Sorry, had pushed the button before i read you wanted logs from addon.

Now ZHA started and seem to work. I will get the logs if/when Silicon labs multiprotocol crashes again.

hybrixxx commented 7 months ago

Guys please stop posting under this topic unless you're using conbee 2. Thanks

puddly commented 7 months ago

The Conbee II fully resets after about five minutes of inactivity. You should not need to ever reboot the host.

What happens if you unplug the Conbee and plug it back in? What happens if you just restart Core?

hybrixxx commented 7 months ago

The Conbee II fully resets after about five minutes of inactivity. You should not need to ever reboot the host.

What happens if you unplug the Conbee and plug it back in? What happens if you just restart Core?

If I just restart Core, it's not loading, I already tried that. It's like the USB stick gets hanged itself. I haven't tried unplugging, I'm going to re-upgrade again to test.

hybrixxx commented 7 months ago

Just tested and nop. I followed these steps: 1) Upgrade core to 2024.1.5 -- ZHA is working 2) Restart Core -- ZHA not loading 3) Unplug conbee 2 4) Reload zha -- ZHA Not loading 5) Restart Core -- ZHA Not loading 6) Restart VM -- ZHA not loading 7) Restart Windows PC-- ZHA loading 8) Restart again only Core -- ZHA NOT loading again. 9) Restore Core backup 2023.11.3 -- ZHA not loading 10) Restart Widnows PC -- ZHA Loading 11) Restart Core 2023.11.3 -- Zha loading

So it seems like something in Core 2024.1.5 makes the USB interface (not the stick) locked somehow.

puddly commented 7 months ago

ZHA is stateless. The Conbee is too, especially after you unplug it. I suspect the problem is somewhere within the Windows + VM part, as the Conbee effectively hotplugs itself when it resets.

Are you running HA OS? Or HA within a Docker container?

hybrixxx commented 7 months ago

ZHA is stateless. The Conbee is too, especially after you unplug it. I suspect the problem is somewhere within the Windows + VM part, as the Conbee effectively hotplugs itself when it resets.

Are you running HA OS? Or HA within a Docker container?

HA Supervised within docker. The problem shouldn't be Windows+VM as it works smooth in 2023.11.3. Consider I updated 18:51 comment to add steps 10 and 11 to mention that the effect of 2024.1.5 is like hanging the usb interface, not the conbee, as I need to restart windows PC the first time I downgrade to 2023.11.3, but later with 2023.11.3 it works smooth. image

puddly commented 7 months ago

ZHA communicates with the serial port with pyserial, which hasn't hasn't had a new release in years so the only differences between 2023.x and 2024.x are software changes. No matter what your Conbee is doing, I'm seeing no indication that your Conbee is actually responding to any serial traffic from the perspective of ZHA.

Can you include zigpy_deconz.uart: DEBUG within your logging config and post a log that encompasses ZHA connecting to the radio, it working, and then it failing to reload after the connection breaks?

hybrixxx commented 7 months ago

With latest upgrade + reboot, now it's not failing (It failed last 5 times I tried!), I'll give it sometime to fail (hope it doesn't :)). Thx

hybrixxx commented 7 months ago

@puddly I just rebooted Core and now it's NOT loading. I'm attaching 3 logs here:

home-assistant ZHA LOADING.log home-assistant- zha not loading_only uart debug.log home-assistant- zha not loading_zha and uart debug.log

Now I have upgraded to 2024.1.6 and rebooted Windows PC to make Zigbee work again... until next Core reboot probably.

Thanks

hybrixxx commented 7 months ago

Ciao, any news on this? It keeps happening, after I restart CORE, ZHA is not working. With 2023.11.3 it works smooth. Thanks

issue-triage-workflows[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.