core: Shelly devices become unavailable for few seconds (core v0.118.1)
The problem
After upgrading to version 0.118 I still have shelly devices unavailable for few seconds. Important note: I have 2 routers with same SSID connected LAN-to-LAN and I think that I found a strange scenario (Not sure 100% about the following):
- router 1 connected to home assistant server
- devices that connected to router 1 are always available
- devices that connected to router 2 are not always available
I’ve tried to move the home assistant server to be connected to router 2 and I got the opposite cases
Environment
- Home Assistant Core release with the issue: 0.118.1
- Last working Home Assistant Core release (if known): -
- Operating environment (OS/Container/Supervised/Core): OS: 5.2 / Supervised: 2020.11.0
- Integration causing this issue: Shelly
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/shelly/
Problem-relevant configuration.yaml
Traceback/Error logs
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Polling Shelly Device - shellyswitch25-40F520009225
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Polling Shelly Device - shelly1-A4CF12F48152
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Polling Shelly Device - shelly1-10521C46081B
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Polling Shelly Device - shelly1-40F520045319
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Polling Shelly Device - shellyswitch25-40F520160310
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Polling Shelly Device - shellyswitch25-40F520013A74
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Polling Shelly Device - shelly1-40F520046237
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Polling Shelly Device - shellyswitch25-40F52017588B
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly1-A4CF12F48152 data
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly1-A4CF12F48152 data in 0.011 seconds
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shellyswitch25-40F520009225 data
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shellyswitch25-40F520009225 data in 0.019 seconds
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly1-40F520045319 data
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly1-40F520045319 data in 0.015 seconds
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly1-40F520046237 data
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly1-40F520046237 data in 0.012 seconds
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shellyswitch25-40F520160310 data
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shellyswitch25-40F520160310 data in 0.029 seconds
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shellyswitch25-40F520013A74 data
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shellyswitch25-40F520013A74 data in 0.040 seconds
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shellyswitch25-40F52017588B data
2020-11-19 16:22:10 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shellyswitch25-40F52017588B data in 0.058 seconds
2020-11-19 16:22:13 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly1-40F520053C86 data
2020-11-19 16:22:14 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shellyswitch25-40F520008C90 data
2020-11-19 16:22:14 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shellyswitch25-40F520178753 data
2020-11-19 16:22:16 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly1-40F52004DC34 data
2020-11-19 16:22:19 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly1-40F520045C92 data
2020-11-19 16:22:28 ERROR (MainThread) [homeassistant.components.shelly] Timeout fetching shelly1-10521C46081B data
2020-11-19 16:22:28 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly1-10521C46081B data in 18.002 seconds
Additional information
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 44 (21 by maintainers)
Sorry that was not obvious. Yes, for me this resolves the issue.
@t0bse I’m still trying to figure out why some proxies needs periodic renew of the IGMP join and in what rate. This is why I asked you to restart HA, the idea behind is to make periodic multicast join commands to work around the issue you are experiencing
Came here as unifi user with vlans also. Solution for me was checking all of the steps mentioned here: https://help.ui.com/hc/en-us/articles/360001004034-UniFi-Best-Practices-for-Managing-Chromecast-Google-Home-on-UniFi-Network So check all IGMP settings are enabled in all networks and WIFI settings (I had one checkmark missing).
Additionally my VLANs got firewall rules, because that’s the point of separating IoT imho. So I had to add a firewall rule to let multicast pass from IoT network into the network where HomeAssistant is running. (Port 5683)
that fixed the polling issues for me.
This is a limitation of the device. alternatives as mentioned above - most advanced routers has options to route multicast between VLANS or run a script in the router. Another option is to use MQTT, this script does a good job for MQTT: https://community.home-assistant.io/t/shellies-discovery-script/94048
IMO users that use VLANS are advances users and they can find a way to route multicast 😃 Specifically about your setup, if needed feel free to contact me and we’ll figure a way to solve it.
if you want instant update, you can use a proxy script to forward multicast from one vlan to another. Some routers allow to install custom scripts.
Otherwise you need to rely on polling. Switch from one mode to the other is automatically performed by this integration.
Simone
Multicast is not routed between VLANs, I don’t know how to do it on ubiquiti devices, but there some details here you should try: https://community.ui.com/questions/Multicast-Routing-across-VLANS-subnets-not-working/fb2a335e-4c9e-4c86-b5d5-bc0adcf88071
https://community.ui.com/questions/USG-Multicast-VLAN-routing-in-both-direction/b373ef25-3fc9-4e3f-9772-2c156540cd3a
https://community.ui.com/questions/VLAN-inter-accessibility-for-MultiCast-devices-SONOS-Chromecast-Airtame-etc/f4d7a07c-d4ea-4238-8265-38ccd6e904c7
https://help.ui.com/hc/en-us/articles/360001004034-UniFi-Best-Practices-for-Managing-Chromecast-Google-Home-on-UniFi-Network
after playing with router config, i found this config
LAN to LAN (Intra LAN) Multicast Enable
I enabled it, and i think it solved the problem, i will keep updateThanks for helping!