Closed mpartoglou closed 2 hours 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)
Same here, but only with Shelly H&T. No problems with Shelly 1, 2.5 and Gas. 🤷♂️
Same here, but only with a certain Gen3 PM Mini. With 2024.6.2 there were zero issues. The data is intermittent and often unavailable. The device shows up ok in the shelly app. All other Shelly devices, including a few other Gen3 PM minis seem to behave better. They are all running the same fw. The PM mini in question reports good wifi, and it's quite close to an access point.
Same problem here!!!
Confirming the issue persists in 2024.7.0.
2024-07-05 14:45:05.979 DEBUG (MainThread) [aioshelly.block_device.coap] Sending request 'cit/s' to device 192.168.1.244 2024-07-05 14:45:05.979 DEBUG (MainThread) [aioshelly.block_device.device] host 192.168.1.244: block device create, MAC: 34945469F8F4 2024-07-05 14:45:05.979 DEBUG (MainThread) [aioshelly.block_device.coap] Adding device 69F8F4 to CoAP message subscriptions 2024-07-05 14:45:05.980 DEBUG (MainThread) [aioshelly.block_device.device] host 192.168.1.244: block device initialize 2024-07-05 14:45:07.108 DEBUG (MainThread) [aioshelly.block_device.device] host 192.168.1.244: http request: /settings (params=None) 2024-07-05 14:45:08.294 DEBUG (MainThread) [aioshelly.block_device.device] aiohttp response: {'device': {'type': 'SHSW-25', 'mac': '34945469F8F4', 'hostname': 'shellyswitch25-34945469F8F4', 'num_outputs': 2, 'num_meters': 2, 'num_rollers': 1, 'mode': 'roller'}, 'wifi_ap': {'enabled': False, 'ssid': 'shellyswitch25-34945469F8F4', 'key': ''}, 'wifi_sta': {'enabled': True, 'ssid': 'TIM-44747932', 'ipv4_method': 'dhcp', 'ip': None, 'gw': None, 'mask': None, 'dns': None}, 'wifi_sta1': {'enabled': False, 'ssid': None, 'ipv4_method': 'dhcp', 'ip': None, 'gw': None, 'mask': None, 'dns': None}, 'ap_roaming': {'enabled': False, 'threshold': -70}, 'mqtt': {'enable': True, 'server': '192.168.1.10:1883', 'user': 'franieri', 'id': 'shelly_tapparella_cucina', 'reconnect_timeout_max': 60.0, 'reconnect_timeout_min': 2.0, 'clean_session': True, 'keep_alive': 60, 'max_qos': 0, 'retain': False, 'update_period': 30}, 'coiot': {'enabled': True, 'update_period': 15, 'peer': '192.168.1.10:5683'}, 'sntp': {'server': 'time.google.com', 'enabled': True}, 'login': {'enabled': False, 'unprotected': False, 'username': 'admin'}, 'pin_code': '', 'name': 'cucina', 'fw': '20230913-112234/v1.14.0-gcb84623', 'factory_reset_from_switch': True, 'pon_wifi_reset': False, 'discoverable': True, 'build_info': {'build_id': '20230913-112234/v1.14.0-gcb84623', 'build_timestamp': '2023-09-13T11:22:34Z', 'build_version': '1.0'}, 'cloud': {'enabled': False, 'connected': False}, 'timezone': 'Europe/Rome', 'lat': 41.112202, 'lng': 16.8547, 'tzautodetect': True, 'tz_utc_offset': 7200, 'tz_dst': False, 'tz_dst_auto': True, 'time': '14:45', 'unixtime': 1720183508, 'led_status_disable': False, 'debug_enable': False, 'allow_cross_origin': False, 'actions': {'active': False, 'names': ['btn_on_url', 'btn_off_url', 'longpush_url', 'shortpush_url', 'out_on_url', 'out_off_url', 'btn_on_url', 'btn_off_url', 'longpush_url', 'shortpush_url', 'out_on_url', 'out_off_url', 'roller_open_url', 'roller_close_url', 'roller_stop_url']}, 'hwinfo': {'hw_revision': 'prod-191217', 'batch_id': 1}, 'mode': 'roller', 'max_power': 1840, 'longpush_time': 800, 'relays': [{'name': None, 'appliance_type': 'General', 'ison': False, 'has_timer': False, 'default_state': 'switch', 'btn_type': 'toggle', 'btn_reverse': 0, 'auto_on': 0.0, 'auto_off': 0.0, 'max_power': 0, 'schedule': False, 'schedule_rules': []}, {'name': None, 'appliance_type': 'General', 'ison': False, 'has_timer': False, 'default_state': 'switch', 'btn_type': 'toggle', 'btn_reverse': 0, 'auto_on': 0.0, 'auto_off': 0.0, 'max_power': 0, 'schedule': False, 'schedule_rules': []}], 'rollers': [{'maxtime': 20.0, 'maxtime_open': 20.0, 'maxtime_close': 20.0, 'default_state': 'stop', 'swap': False, 'swap_inputs': False, 'input_mode': 'openclose', 'button_type': 'toggle', 'btn_reverse': 0, 'state': 'stop', 'power': 0.0, 'is_valid': True, 'safety_switch': False, 'schedule': False, 'schedule_rules': [], 'obstacle_mode': 'disabled', 'obstacle_action': 'stop', 'obstacle_power': 200, 'obstacle_delay': 1, 'ends_delay': 2500, 'safety_mode': 'while_opening', 'safety_action': 'stop', 'safety_allowed_on_trigger': 'none', 'off_power': 2, 'positioning': True}], 'favorites_enabled': False, 'favorites': [{'name': 'Position 1', 'pos': 0}, {'name': 'Position 2', 'pos': 0}, {'name': 'Position 3', 'pos': 0}, {'name': 'Position 4', 'pos': 0}], 'eco_mode_enabled': True} 2024-07-05 14:45:08.294 DEBUG (MainThread) [aioshelly.block_device.device] host 192.168.1.244: http request: /status (params=None) 2024-07-05 14:45:09.018 DEBUG (MainThread) [aioshelly.block_device.coap] CoapMessage: ip=192.168.1.244, type=CoapType.PERIODIC(30), options={11: b's', 3332: b'SHSW-25#34945469F8F4#2', 3412: b'\x96\x00', 3420: b'\x08\x00'}, payload={'G': [[0, 9103, 0], [0, 1102, 'stop'], [0, 1103, -1], [0, 2101, 0], [0, 2102, ''], [0, 2103, 0], [0, 2201, 0], [0, 2202, ''], [0, 2203, 0], [0, 4102, 0.0], [0, 4104, 198], [0, 6103, 'normal'], [0, 3104, 50.31], [0, 6101, 0], [0, 9101, 'roller'], [0, 4108, 233.95]]} 2024-07-05 14:45:09.018 DEBUG (MainThread) [aioshelly.block_device.coap] Calling CoAP message update for device id 69F8F4 2024-07-05 14:45:09.372 DEBUG (MainThread) [aioshelly.block_device.device] aiohttp response: {'wifi_sta': {'connected': True, 'ssid': 'TIM-44747932', 'ip': '192.168.1.244', 'rssi': -55}, 'cloud': {'enabled': False, 'connected': False}, 'mqtt': {'connected': False}, 'time': '14:45', 'unixtime': 1720183510, 'serial': 8, 'has_update': False, 'mac': '34945469F8F4', 'cfg_changed_cnt': 0, 'actions_stats': {'skipped': 0}, 'rollers': [{'state': 'stop', 'source': 'http', 'power': 0.0, 'is_valid': True, 'safety_switch': False, 'overtemperature': False, 'stop_reason': 'normal', 'last_direction': 'open', 'current_pos': 101, 'calibrating': False, 'positioning': True}], 'meters': [{'power': 0.0, 'overpower': 0.0, 'is_valid': True, 'timestamp': 1720190710, 'counters': [0.0, 0.0, 0.0], 'total': 15}, {'power': 0.0, 'overpower': 0.0, 'is_valid': True, 'timestamp': 1720190710, 'counters': [0.0, 0.0, 0.0], 'total': 183}], 'inputs': [{'input': 0, 'event': '', 'event_cnt': 0}, {'input': 0, 'event': '', 'event_cnt': 0}], 'temperature': 50.31, 'overtemperature': False, 'tmp': {'tC': 50.31, 'tF': 122.56, 'is_valid': True}, 'temperature_status': 'Normal', 'update': {'status': 'idle', 'has_update': False, 'new_version': '20230913-112234/v1.14.0-gcb84623', 'old_version': '20230913-112234/v1.14.0-gcb84623', 'beta_version': '20231107-163214/v1.14.1-rc1-g0617c15'}, 'ram_total': 50720, 'ram_free': 36632, 'fs_size': 233681, 'fs_free': 145831, 'voltage': 233.95, 'uptime': 10885} 2024-07-05 14:45:09.372 DEBUG (MainThread) [aioshelly.block_device.coap] Sending request 'cit/d' to device 192.168.1.244 2024-07-05 14:45:17.109 DEBUG (MainThread) [aioshelly.block_device.device] host 192.168.1.244: error: DeviceConnectionError(TimeoutError()) 2024-07-05 14:45:17.109 DEBUG (MainThread) [aioshelly.block_device.device] host 192.168.1.244: block device shutdown
Unsure if coincidence or otherwise but since updating to 2024.7.1 I haven’t had any issues (will report back if this changes.
I was suffering this issue also but not all Gen1 devices at once, I upgraded from 2024.6.4
to 2024.7.1
to try and alleviate with no joy, however after reading the docs again for any breaking changes or incompatibilities - seems that somewhere (that I at least did not notice) there was a need to shift over Gen1 devices from using multicast CoIoT to unicast with a specific IP and Port. (As I was doing them they were all set to mcast
).
Generation 1 devices use the CoIoT protocol to communicate with the integration. CoIoT must be enabled in the device settings. Navigate to the local IP address of your Shelly device, Internet & Security > ADVANCED - DEVELOPER SETTINGS and check the box Enable CoIoT.
We recommend using unicast for communication. To enable this, enter the local IP address of the Home Assistant server and port 5683 into the CoIoT peer field and push SAVE button. This is mandatory for battery operated devices (even if USB connected). After changing the CoIoT peer, the Shelly device needs to be manually restarted.
Ref here: https://www.home-assistant.io/integrations/shelly
After updating all my Gen1 devices to use unicast of my Home Assistant node with port 5683
as stated - they all worked fine.
UPDATE: This said, and where the integration config entries state that the device is connecting ok - I cannot control it via Home Assistant. The state is updated of the switch entity (for Gen1 Shelly 1 & also 2.5's) when the physical switch is switched, however I cannot turn it on/off via Home Assistant anymore.
Hi @danstreeter ,
confirming that my setup is using the COIOT protocol as per your comment in the breaking changes. For me this also guaranteed that the Shelly Unit was talking to my HASS service (and extremely reliably), but I also have the same issue of HASS not talking to my Shelly Units.
For no particular reason mine has been stable for a few days on 2024.7.1
If it can be of help, I would like to point out the following. I solved the issue by adding the device with an old version of Home Assistant 2026.4.1. Only at that point was the Shelly 2.5 automatically re-added simply upon reboot. After adding it, I updated to the latest version and it seems to be working. It appears that the latest versions have some problems during the new configuration phase of the device.
I have 1 Shello Pro4pm running fine with colot . But 1 shelly adc keeps changing his ipadres. I configured a fixed ip, but that data is reset every x amount of time. Maybe device malfuncion
I see the same behavior as reported by @danstreeter, the devices report state back to HA, but I cannot control them.
I have 3 Shelly TRV running firmware version 20240619-130912/v2.2.4@ee290818 running with CoIoT (fixed peer) Homeassistant version 2024.7.2
2024-07-13 09:10:46.251 DEBUG (MainThread) [aioshelly.common] host 10.0.20.17:80: error: DeviceConnectionError(TimeoutError())
2024-07-13 09:10:46.252 DEBUG (MainThread) [aioshelly.block_device.device] host 10.0.20.17: error: DeviceConnectionError(DeviceConnectionError(TimeoutError()))
2024-07-13 09:10:46.252 ERROR (MainThread) [homeassistant.components.shelly] Error connecting to Shelly device shellytrv-60A423D91C66, error: DeviceConnectionError(DeviceConnectionError(TimeoutError()))
Every now an again it actually works to control the device.
The latency to the device seems quite high to me. Maybe increasing the timeout and/or adding one or two retries can help? (edit: it looks like it is already doing that https://github.com/home-assistant-libs/aioshelly/blob/a07ead7206a82067cecda0334feeb34f9cd990f0/aioshelly/block_device/device.py#L314C25-L314C42 )
ping 10.0.20.17
PING 10.0.20.17 (10.0.20.17): 56 data bytes
64 bytes from 10.0.20.17: icmp_seq=0 ttl=254 time=90.696 ms
Request timeout for icmp_seq 1
64 bytes from 10.0.20.17: icmp_seq=1 ttl=254 time=1168.199 ms
64 bytes from 10.0.20.17: icmp_seq=2 ttl=254 time=168.275 ms
64 bytes from 10.0.20.17: icmp_seq=3 ttl=254 time=318.678 ms
64 bytes from 10.0.20.17: icmp_seq=4 ttl=254 time=1893.700 ms
64 bytes from 10.0.20.17: icmp_seq=5 ttl=254 time=893.189 ms
Request timeout for icmp_seq 7
64 bytes from 10.0.20.17: icmp_seq=6 ttl=254 time=2257.171 ms
64 bytes from 10.0.20.17: icmp_seq=7 ttl=254 time=2397.987 ms
64 bytes from 10.0.20.17: icmp_seq=8 ttl=254 time=1397.390 ms
64 bytes from 10.0.20.17: icmp_seq=9 ttl=254 time=396.683 ms
64 bytes from 10.0.20.17: icmp_seq=10 ttl=254 time=801.953 ms
^C
--- 10.0.20.17 ping statistics ---
12 packets transmitted, 11 packets received, 8.3% packet loss
round-trip min/avg/max/stddev = 90.696/1071.266/2397.987/789.782 ms
Morning all. I thought I was onto something but alas - no joy.
Upgraded one of my Gen1 Shelly1's which is having this issue to BETA firmware version 20231107-162940/v1.14.1-rc1-g0617c15
(from 20230913-112003/v1.14.0-gcb84623
) and I could control it via Home Assistant - for a moment. Then it returned to its DeviceConnectionError
state again.
@ranathan14 - I upgraded from 2024.6.4
with all my Shelly devices already part of the install, then they broke rather than adding them straight into the new version. To further test a theory I removed one of my existing devices that this issue is occuring on, but am now unable to add it again. :( So that one is dead to me now unable to get it back into HASS.
Not absolutely sure if this is related, but I started having connectivity issues with my gen3 mini devices after 2024.6.4. I switched their powersave feature off a few days ago, and they have been stable after that.
I have a similar issue. I get duplicate devices for the same phone. One with 97 Entities, one with 98. I disabled the one with 97 entries. But magically it enabled itself again.
@webjester0 please create a new issue, your issue is not related to this issue.
I'm running Core 2024.7.2 and had the same issue that I could not add my shelly TVRs. I enabled CoIoT as described here: https://www.home-assistant.io/integrations/shelly/#shelly-device-configuration-generation-1 After that the TVRs did not show up automatically but I was able to add them manually by its IP. Not sure if that's the issue here but it worked for me so maybe that helps someone else.
Since yesterday's update 2024.8 it no longer connects. In the previous ones, after restarting and disconnecting switches, it occasionally connected and stayed for days.
2024-08-08 19:46:13.356 DEBUG (MainThread) [aioshelly.rpc_device.device] host 192.168.1.103:80: error: DeviceConnectionError(RpcCallError(404, 'No handler for Shelly.GetComponents'))
Since yesterday's update 2024.8 it no longer connects. In the previous ones, after restarting and disconnecting switches, it occasionally connected and stayed for days.
2024-08-08 19:46:13.356 DEBUG (MainThread) [aioshelly.rpc_device.device] host 192.168.1.103:80: error: DeviceConnectionError(RpcCallError(404, 'No handler for Shelly.GetComponents'))
This is a different issue, please create a new issue with diagnostics if you want your issue to be fixed
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
I recently upgraded to 2024.6.4 (I believe I might have missed 2024.6.3, but this issue was not present in 2024.6.0 and i believe it was fine .6.1). As part of this upgrade, I noticed that my Shelly Gen 1 devices (Shelly 1, Shelly Dimmers) are having intermittent connection issues - the same as was identified in this thread: https://github.com/home-assistant/core/issues/116975
I get all identical issues as per the previous thread where this was fixed:
Shelly device moves into a state where it becomes unresponsive in the front-end, but is still showing as active. The error is DeviceConnectionError Shelly device still operates and responds via hitting the Shelly device URL Shelly device, when hit via the URL directly still updates inside Home Assistant (i.e. I can receive new status updates) After some period of this, the Shelly devices go offline fully in Home Assistant and via URL I can force reconnect the devices (via Unifi) to start the cycle again
This issue is unique to Shelly Gen 1 devices as per before (my shelly gen 2 devices are once again rock solid).
Notes:
Shelly devices firmware: v1.14.0-gcb84623 Shelly devices us CoIoT connected via ip:port to HASS Shelly devices are all fixed IPs
I believe this is the same issue as previously where the Gen 1 devices are getting overwhelmed by too many requests (I know they only support two concurrent connections); then my unifi reconnect command resets this back to normal
What version of Home Assistant Core has the issue?
2024.6.4
What was the last working version of Home Assistant Core?
2024.6.0
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
config_entry-shelly-445d0d281f721c56d3ad74de6dc6882e (1).json
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response