Not sure if this is a recent known issue but for the last week or so ZHA in my HA instance appears to be ‘dropping’ then coming back online.
I wouldn’t necessarily have noticed this but about 30 minutes ago my living room TV just turned on randomly. It did this once last week and I didn’t investigate it.
But today, I noted the time it happened, then looked in the HA Logbook and it shows that every one of my ZHA device sensors turned it’s state to ‘off’ for a split second then changing the state to ‘on’. (This is what triggered my TV to turn on because a specific door sensor when turned on is automated to turn on the TV).
Is anyone else experiencing the same, or experienced it before and have any advice on how to fix?
EDIT ** Just found these 2 entries in the logs for the same time the issue occurred but not sure how relevant they are
Logger: bellows.uart
Source: runner.py:189
First occurred: October 28, 2024 at 3:15:02 PM (3 occurrences)
Last logged: 1:24:49 PM
Lost serial connection: ConnectionResetError(‘Remote server closed connection’)```
Logger: bellows.ezsp
Source: runner.py:189
First occurred: October 28, 2024 at 3:15:02 PM (3 occurrences)
Last logged: 1:24:49 PM
Yep. I have the same issue on 2024.10.3 but think it was happening prior to this release. But it only started recently. Same symptoms and messages as you. Nothing has changed with regards to WiFi or Zigbee.
I’ve had the NCP message a couple of times, but nothing switching on or off.
I believe both messages may be related to USB port/power supply problems (among other things…). What setup do you have? A powered USB hub, for example? Or a stick plugged directly into a RPi?
Mine is a SkyConnect directly into a NAS. I haven’t changed port and not installed any new add-ons. Set up is the same as it has been for months.
I have had both errors previously, I even raised an issue on Github in February but it didn’t get a response or resolution. I could bear that though because it wasn’t causing me any operational issues. But now, with the TV turning on because it thinks a door has opened, when it hasn’t, is a problem.
Yeah, sorry, sensors turned to ‘unavailable’ and ‘unknown’, windows and doors to ‘closed’ etc. lights and everything else (e.g. firmware update entities) to ‘off’.
Ok, first things first. Time to fix your TV automation.
Add this as a condition inside any automation which relies on a trigger sensor switching from any state to any other state:
- condition: template
value_template: "{{ trigger.from_state.state not in ['unknown', 'unavailable'] }}"
You can continue to troubleshoot why your ZHA dropped the connection later (power issues/ interference/ ZBT-1 recall/ solar flare).
The important thing is that your automations only trigger when your sensors go from off to on, and vice versa.
The alternative is to set up 2 triggers, one which goes from off to on, and vice versa.