Open kshala opened 5 days ago
Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration (shelly
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
shelly documentation shelly source (message by IssueLinks)
Your log clearly show that the device rejects the connection reporting the authentication data is invalid, it doesn't matter if you didn't change it, the one stored in HA probably doesn't match the one on the device. Entities will keep updating since the device push data to HA on changes, but some of them won't work.
07:32:46.586 host 10.2.4.1:80: error: InvalidAuthError(InvalidAuthError
You need to manually wake up the device using the button and reauthenticate it with HA, after this it should work, when you do it keep the debug log and if it still happens upload the new log.
I’ve done re authentication already. I never changed the password on the device but followed the repair instructions entering the password. Within a day or two new repairs appear and ask to enter the password again. The logs I posted are made after the issue happened again.
One time I gone through all repair messages and entered the passwords. Then reboot ha. Within a day about five new repairs appeared. I have ten smoke detectors. Since the devices boot every 24 hours I believe the issue isn’t 100% reproducible.
I created an automaton that sends a push notification when a persistent notification (like repair) is added. When I manually start the device (the taps on the button) there is a 50% chance to get a notification. Sometimes it takes two or three boot up to make the notification appear.
The problem
I added all my ShellyPlusSmoke devices with password protected. Every day I get a couple of repair messages that the ShellyPlusSmoke authentication expired. It still seems to work. The device entities are showing data but the logbook shows that the entities are unavailable for a short time.
I haven't changed the passwords. So the repair message doesn't make sense to me and they are bothering.
What version of Home Assistant Core has the issue?
core-2024.11.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Shelly
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
Debug logs show a bunch of 401 error codes with changing nonce. The error may be caused by a missing unixtime assuming that these shellys require time from an SNTP. I created a local network SNTP server (chrony) but this didn't help. Also I don't know if the error is more a race condition with two messages sent parallely with failing authentication. Assuming that a 401 response generates a new nonce. Two 401 that close to each other would generate two nonce. Combined with lacking synchronization in the Shelly firmware I believe the issue is the concurrent call to shelly and calling the device in sequentially should be more robust.