core: Shelly Integration switch changing to unavailable constantly
The problem
Shelly integration showing switches unavailable. The HA logbook gets flooded with unavailable messages from Shelly switchs. This happens on all Shelly devices configured through the Shelly integration. In very short periods all the sensors show up unavailable and reconnect, which spam the log.
Environment
arch | x86_64 dev | false docker | true hassio | false installation_type | Home Assistant Container os_name | Linux os_version | 5.4.0-47-generic python_version | 3.8.5 timezone | America/Detroit version | 0.115.2 virtualenv | false
-
Home Assistant Core release with the issue: 0.115.2
-
Last working Home Assistant Core release (if known): unknown
-
Operating environment (OS/Container/Supervised/Core): Container
-
Integration causing this issue: Shelly
-
Link to integration documentation on our website: https://www.home-assistant.io/integrations/shelly
-
Shelly Devices and Firmware:
- Shelly 2 - firmware: 20200827-065420/v1.8.3@4a8bc427 - Shelly 2.5 - firmware: 20200827-065456/v1.8.3@4a8bc427 - Shelly 1 - firmware: 20200827-065344/v1.8.3@4a8bc427
Problem-relevant configuration.yaml
N/A
Traceback/Error logs
N/A
Additional information
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 9
- Comments: 203 (77 by maintainers)
We switched from aiocoap library to our own implementation. Code is merged on dev branch currently.
So you can wait 0.118.0 or install a development build.
Thank you for your patience,
Simone
Please open new issue and post there debug log for
shelly
component.This issue should be closed.
I installed 0.118 beta via Docker and I can confirm that the Shellys no longer flip to unavailable! Great job guys!
No, because DataUpdateCoordinator in HA had to be modified to to allow updating data from multicast listen. You must use HA 0.118dev for this new version of Shelly integration to work.
I’d just like to thank all of you that have worked on the resolution of this issue: Thank you!
Go to https://developers.home-assistant.io/ and on the right, there is the
Upcoming Events
section 🙂 BTW it is planned to be released at 18 NovemberAre you willing to test the new version of the Shelly integration? The integration is based on the new version of the
aioshelly
library (great work @chemelli74), which already has its own COAP support and doesn’t use external packages, which should eliminate most communication errors (entity unavailability). The library also supports listening to multicast, but so far it is not implemented in the integration.Repo: https://github.com/bieniu/ha-shelly-own-coap
The package is prepared as a custom component so the
shelly
directory should be copied to/config/custom_components
and restart HA is needed after that.Thanks for testing.
Please check with a continuous ping as latest hotfix is for WI-FI disconnect. Integration issue is expected to be something else.
Simone
The updated device just became unavailable for 5 seconds and then became available again 👎
I have just installed the FW on one of my shelly2.5 devices and it seems stable. I will let it run for a few hours and report back
@RobBie1221 I’m still testing this change. If there are no negative aspects of this, I will open PR tomorrow.
does the integration rescan every x minutes? for me when a shelly goes unavailable it stays unavailable. I have configured static ips for all my shellys (shelly 2.5). A few minutes ago I moved one of the shellys to another access point with a different ssid name. It never came back in homeassistant. Only restarting homeassistant let it be discovered again
Manually updated xxx data
in the log means integration get data via multicast listener. Multicast doesn’t work well in your network for some reason.@t0bse The log indicates that integration doesn’t always receive data from devices via multicast listening.Try to enable “IGMP snooping” for 2,4 GHz WiFi network in the router/AP configuration.
If you used test version I posted make sure you remove the Shelly directory from
/config/custom_components
If problem still exists please post debug log for Shelly component.@kenlasko wrote just four comments above that 0.118 helped in his case. If you have errors please post them here. Maybe they can be fixed as part of 0.118.
!!!
117.5 Timeout fetching shellyswitch25-68C63AF9E4C1 data 11:39:15 AM – Shelly (ERROR) - message first occurred at November 11, 2020, 8:54:33 PM and shows up 1072 times Constant timeouts
@Misiu I’m using the library from Gitub Repo: https://github.com/bieniu/ha-shelly-own-coap Are you referring to that one?
@maurizioandreotti60 You wrote that You are using 0.117.1. The new version will be released in 0.118 so wait for that version or run dev from Github
Using the new library has no effect on my environment. Shellis continue to become unavailable for 5s periodically. Anyway you say 11 errors in 3 hours that are errors 88 errors in 24 hours. That is not good. IMHO.
I have to say that the issue persists using the new library and shellis continues to become unavailable periodically for 5 seconds. Here the errors on the log:
2020-11-06 16:47:47 ERROR (MainThread) [custom_components.shelly] Timeout fetching shelly1-98Fxxxxxx data 2020-11-06 16:47:55 ERROR (MainThread) [custom_components.shelly] Timeout fetching shelly1-77xxxx data 2020-11-06 16:48:17 ERROR (MainThread) [custom_components.shelly] Timeout fetching shelly1-98yyyyyyy data
Actually I have HA 0.117.1
You should wait for 0.118.
@tobi-blue Battery powered devices are still not fully supported. Overall it is much better than it was before because by listening to multicast, integration gets data from the device when device wakes up for a second or two. Previously this was not possible.
I also have constant disconnects that lasts exactly five seconds:
2020-10-26 15:26:00 ERROR (MainThread) [homeassistant.components.shelly] Timeout fetching Belysning uppe data 2020-10-26 15:26:05 INFO (MainThread) [homeassistant.components.shelly] Fetching Belysning uppe data recovered 2020-10-26 15:26:15 ERROR (MainThread) [homeassistant.components.shelly] Timeout fetching Belysning uppe data 2020-10-26 15:26:20 INFO (MainThread) [homeassistant.components.shelly] Fetching Belysning uppe data recovered
I have two shellys, powered from mains. Connected over 2,4Ghz to Ubiquiti Wireless Access Point. DHCP. Running HA 0.116.2 from a docker container in Linux. Firmware of Shellys is the latest that was available when I installed a month ago. Using the Shelly integration in HA.
The Ubiquiti logs does not mention any problems. The clients are listed as connected for many days and no warnings/errors related to the relevant IP addresses.
@alundstroem I was wrong… when looking at the shelly app it shows me that there is a pending firmware update to the latest version.
Yes. You should use (/ota?update=true)
Ah, great - I’ll just wait for you to report back then ^^
(I cannot test it at the moment, regardless)
I found https://shelly-api-docs.shelly.cloud/, for future reference
@bieniu I’ve retrieved the directory, placed it into config/custom_components and restarted HA… all shellies are accounted for now (: I’ll keep an eye on it.
Sure, will test it this evening
@bieniu Many thanks indeed. This seems to work, I ran the debugger on the DataUpdateCoordinator and where it kept giving timeouts before with this version it picks up after devices come online.
@bieniu first test looks good. Powered off my Shelly 1 for 5 minutes and i comes back available 😃. I will add more Shelly devcies to the HA integration now.
Many thanks for looking into this issue.
@bieniu I’ve installed aioshelly 0.3.3 and will test it out on 1 of my switches. I will report back in 24 hours. Thank you!
Didn’t know that, thanks.
I mean this integration https://www.home-assistant.io/integrations/ping/#binary-sensor Use Shelly device hostname/IP address as host in the configuration.
I have similar issues and reloading the integration works. Will attach logs next time it happens.
Released just now 😉
Simone
Can you please share your home-assistant.log ? Thank you,
Simone
home-assistant-shelly-coap-aiocoap.log