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
73.6k stars 30.76k forks source link

Shelly Integration, all Generation 1 devices unavailable and cannot get them to re-connect #75118

Closed xrsprint closed 2 years ago

xrsprint commented 2 years ago

The problem

Hi there

This morning i had to reboot my PC for updated which is running hypervisor and HA on a VM, once restarted i noticed all of my Generation 1 shelly devices unavailable (i have about 30 of them), all Generation 2 devices were still online, after rebooting a number of times, i then rebooted all shelly devices with no luck, then rebooted everything from Switches, Wifi, Gateway, VM Host, and still no luck

i first verified all of my gen 1 devices are running the current firmware of 20220209-094317/v1.11.8-g8c7bb8d and all also have the Colo it enabled pointing back to my HA server which is 192.168.X.X:5683

i then deleted onc shelly device and tried to re-add and got the following message

2

note that if i delete a shelly device and then reboot, HA does auto discover it

i then factory reset the shelly unit, and still did the same issue as above . i then tried adding to configration.yaml a line to change the ColoIT port and then set it to the new port on a shelly, and no luck there either

i then decided to install a new install of HA on my VM (using the same hyper-v instance but with a new virtual disk,) meaning it kept the same IP, and then restored from a backup which was done two days ago when these were working with no luck, i then done another fresh install and starting a new HA system, which also done the same, and then reverted back to a older HA image i had with 8.1 and this also failed. i also tried changing IP addresses of the HA but keeping the same MAC of the VM and also no help there

after the tests above i believe i have ruled out the shellys and HA but the issue is still there, i can log into the units via web and control them with no issues and also i can confirm there is no firewall or blocking on the network as all these devices are on the same subnet

any help here would be greatly appreciated

Thanks

What version of Home Assistant Core has the issue?

core-2022.7.3

What was the last working version of Home Assistant Core?

core-2022.7.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Shelly

Link to integration documentation on our website

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

Diagnostics information

logs turned off

Example YAML snippet

N/A as its an integrated setup

Anything in the logs that might be useful for us?

2022-07-13 20:26:40 WARNING (MainThread) [homeassistant.config] Key whitelist_external_dirs has been replaced with allowlist_external_dirs. Please update your config
2022-07-13 20:26:41 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=630 from 2022-07-13 10:23:05)
2022-07-13 20:26:49 ERROR (MainThread) [snitun.client.client_peer] Challenge/Response error with SniTun server (0 bytes read on a total of 32 expected bytes)
2022-07-13 20:26:49 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server
2022-07-13 20:26:52 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-PL1PM-DISHWASHER' for shelly integration not ready yet: Cannot connect to host 192.168.199.174:80 ssl:default [Connect call failed ('192.168.199.174', 80)]; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-EM' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-SOLAR2' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-SOLAR1' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-KITCHEN' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-DIM2-LOUNGE' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-LAUNDRY' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-MASTER' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-BEDSIDE' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-HALLWAY' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-BEDROOM2' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-SPRINT' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-BEDROOM1' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-ROBE' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-FRONTDOOR' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-BATHROOM' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-BATHROOM' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-ENSUITE2' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-ENSUITE1' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-WASHING' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-ROLLER TRIGGER' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-BATHROOM-ALEXA' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-1PM-GARAGE-ALEXA' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-TOILET' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-2.5-GARAGE-TV' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-AUTOMATION-4' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-AUTOMATION-3' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-AUTOMATION-2' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-AUTOMATION-1' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-COMMS FAN' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:26:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'SHELLY-UNI-LIZARD' for shelly integration not ready yet: Timeout during device setup; Retrying in background
2022-07-13 20:27:04 ERROR (MainThread) [snitun.client.client_peer] Challenge/Response error with SniTun server (0 bytes read on a total of 32 expected bytes)
2022-07-13 20:27:04 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server
2022-07-13 20:27:06 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.210 initialize error - TimeoutError()
2022-07-13 20:27:20 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.157 initialize error - TimeoutError()
2022-07-13 20:27:20 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.167 initialize error - TimeoutError()
2022-07-13 20:27:20 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.231 initialize error - TimeoutError()
2022-07-13 20:27:21 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.164 initialize error - TimeoutError()
2022-07-13 20:27:21 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.210 initialize error - TimeoutError()
2022-07-13 20:27:21 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.170 initialize error - TimeoutError()
2022-07-13 20:27:21 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.175 initialize error - TimeoutError()
2022-07-13 20:27:22 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.234 initialize error - TimeoutError()
2022-07-13 20:27:23 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.203 initialize error - TimeoutError()
2022-07-13 20:27:25 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.204 initialize error - TimeoutError()
2022-07-13 20:27:25 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.160 initialize error - TimeoutError()
2022-07-13 20:27:25 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.171 initialize error - TimeoutError()
2022-07-13 20:27:25 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.233 initialize error - TimeoutError()
2022-07-13 20:27:25 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.172 initialize error - TimeoutError()
2022-07-13 20:27:26 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.165 initialize error - TimeoutError()
2022-07-13 20:27:27 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.228 initialize error - TimeoutError()
2022-07-13 20:27:28 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.226 initialize error - TimeoutError()
2022-07-13 20:27:28 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.168 initialize error - TimeoutError()
2022-07-13 20:27:36 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.210 initialize error - TimeoutError()
2022-07-13 20:27:39 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.226 initialize error - TimeoutError()
2022-07-13 20:27:39 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.217 initialize error - TimeoutError()
2022-07-13 20:27:39 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.234 initialize error - TimeoutError()
2022-07-13 20:27:39 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.233 initialize error - TimeoutError()
2022-07-13 20:27:39 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.232 initialize error - TimeoutError()
2022-07-13 20:27:39 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.207 initialize error - TimeoutError()
2022-07-13 20:27:40 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.204 initialize error - TimeoutError()
2022-07-13 20:27:40 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.160 initialize error - TimeoutError()
2022-07-13 20:27:40 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.171 initialize error - TimeoutError()
2022-07-13 20:27:40 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.172 initialize error - TimeoutError()
2022-07-13 20:27:41 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.165 initialize error - TimeoutError()
2022-07-13 20:27:42 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.228 initialize error - TimeoutError()
2022-07-13 20:27:43 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.168 initialize error - TimeoutError()
2022-07-13 20:27:44 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.203 initialize error - TimeoutError()
2022-07-13 20:27:44 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.173 initialize error - TimeoutError()
2022-07-13 20:27:44 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.211 initialize error - TimeoutError()
2022-07-13 20:27:44 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.197 initialize error - TimeoutError()
2022-07-13 20:27:46 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.206 initialize error - TimeoutError()
2022-07-13 20:27:46 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.166 initialize error - TimeoutError()
2022-07-13 20:27:47 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.159 initialize error - TimeoutError()
2022-07-13 20:27:47 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.213 initialize error - TimeoutError()
2022-07-13 20:27:47 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.169 initialize error - TimeoutError()
2022-07-13 20:27:48 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.161 initialize error - TimeoutError()
2022-07-13 20:27:48 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.231 initialize error - TimeoutError()
2022-07-13 20:27:49 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.232 initialize error - TimeoutError()
2022-07-13 20:27:50 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.157 initialize error - TimeoutError()
2022-07-13 20:27:50 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.167 initialize error - TimeoutError()
2022-07-13 20:27:50 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.204 initialize error - TimeoutError()
2022-07-13 20:27:50 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.226 initialize error - TimeoutError()
2022-07-13 20:27:50 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.217 initialize error - TimeoutError()
2022-07-13 20:27:50 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.234 initialize error - TimeoutError()
2022-07-13 20:27:50 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.233 initialize error - TimeoutError()
2022-07-13 20:27:51 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.164 initialize error - TimeoutError()
2022-07-13 20:27:51 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.210 initialize error - TimeoutError()
2022-07-13 20:27:51 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.170 initialize error - TimeoutError()
2022-07-13 20:27:51 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.175 initialize error - TimeoutError()
2022-07-13 20:27:52 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.207 initialize error - TimeoutError()
2022-07-13 20:27:55 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.160 initialize error - TimeoutError()
2022-07-13 20:27:55 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.171 initialize error - TimeoutError()
2022-07-13 20:27:55 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.172 initialize error - TimeoutError()
2022-07-13 20:27:56 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.165 initialize error - TimeoutError()
2022-07-13 20:27:57 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.228 initialize error - TimeoutError()
2022-07-13 20:27:58 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.168 initialize error - TimeoutError()
2022-07-13 20:27:59 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.203 initialize error - TimeoutError()
2022-07-13 20:28:06 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.210 initialize error - TimeoutError()
2022-07-13 20:28:09 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.217 initialize error - TimeoutError()
2022-07-13 20:28:09 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.234 initialize error - TimeoutError()
2022-07-13 20:28:09 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.233 initialize error - TimeoutError()
2022-07-13 20:28:09 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.231 initialize error - TimeoutError()
2022-07-13 20:28:09 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.232 initialize error - TimeoutError()
2022-07-13 20:28:09 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.207 initialize error - TimeoutError()
2022-07-13 20:28:10 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.160 initialize error - TimeoutError()
2022-07-13 20:28:10 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.171 initialize error - TimeoutError()
2022-07-13 20:28:10 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.226 initialize error - TimeoutError()
2022-07-13 20:28:10 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.172 initialize error - TimeoutError()
2022-07-13 20:28:11 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.165 initialize error - TimeoutError()
2022-07-13 20:28:12 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.204 initialize error - TimeoutError()
2022-07-13 20:28:12 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.228 initialize error - TimeoutError()
2022-07-13 20:28:13 WARNING (MainThread) [aioshelly.block_device] device 192.168.199.168 initialize error - TimeoutError()

Additional information

System Health

version core-2022.7.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.5
os_name Linux
os_version 5.15.45
arch x86_64
timezone Australia/Sydney
config_dir /config
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 15 July 2022 at 10:00 relayer_connected | true remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | false remote_server | ap-southeast-1-0.ui.nabu.casa can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 8.2 -- | -- update_channel | stable supervisor_version | supervisor-2022.07.0 agent_version | 1.2.1 docker_version | 20.10.14 disk_total | 30.8 GB disk_used | 3.8 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Samba share (10.0.0), File editor (5.3.3), MariaDB (2.4.0), Check Home Assistant configuration (3.11.0)
Dashboards dashboards | 1 -- | -- resources | 0 views | 5 mode | storage
Recorder oldest_recorder_run | 7 July 2022 at 09:10 -- | -- current_recorder_run | 13 July 2022 at 20:26 estimated_db_size | 207.78 MiB database_engine | mysql database_version | 10.4.19
zc711 commented 2 years ago

confirmed. with 2022.7.6 Shelly Gen1 work again. So Microsoft was not guilty?

elupus commented 2 years ago

They are. There is a workaround added here. Sadly other integrations are also affected.

opbokke commented 2 years ago

Had similar issue here as well, although initially not all Shelly devices were broken. Probably because I don't them all constantly. After restarting HA I got a lot of "Timeout during device setup" from all Gen1 devices as well including the Shelly Plug S and Shelly Button. I ended up in this thread and removed the KB which now fixed the issue.

I'll checkout the patch 2022.7.6 later when I have some more time, but I wanted to compliment the contributors and mostly @skoog84 @thecode for the find and fix!

cmilanf commented 2 years ago

I can confirm that the integration works again as expected. Thank you so much for fixing the problem so swiftly!

ripvega commented 2 years ago

It's not working for me on 2022.7.7.

No Shelly devices are available or discoverable.

eole210 commented 2 years ago

Very useful thread, thanks. Same issue here, after patching my Hyper-V server and rebooting it, my Shelly 1L stopped being recognized. As I didn't want to uninstall the security patch, I decided to fully uninstall the Shelly integration and switched over to using MQTT (which I was already using for other devices) instead of the integration. Not sure what I would be missing by doing so but so far, all good.