core: Shelly 3EM "Retrying setup: DeviceConnectionError()"

The problem

HA cant connect to shelly 3EM opening ‘visit’ link web of shelly is opened

Screenshot 2023-04-25 at 18 29 25 Screenshot 2023-04-25 at 18 29 10

status page returns

{
"wifi_sta": {
"connected": true,
"ssid": "---",
"ip": "---",
"rssi": -72
},
"cloud": {
"enabled": true,
"connected": true
},
"mqtt": {
"connected": false
},
"time": "18:50",
"unixtime": 1682437830,
"serial": 47622,
"has_update": false,
"mac": "84CCA8ACADC2",
"cfg_changed_cnt": 1,
"actions_stats": {
"skipped": 0
},
"relays": [
{
"ison": true,
"has_timer": false,
"timer_started": 0,
"timer_duration": 0,
"timer_remaining": 0,
"overpower": false,
"is_valid": true,
"source": "input"
}
],
"emeters": [
{
"power": 80.81,
"pf": 0.24,
"current": 1.39,
"voltage": 237.4,
"is_valid": true,
"total": 7216058.9,
"total_returned": 217345.3
},
{
"power": 60.85,
"pf": 0.22,
"current": 1.16,
"voltage": 236.2,
"is_valid": true,
"total": 5871538.5,
"total_returned": 232219.2
},
{
"power": -119.73,
"pf": -0.57,
"current": 0.89,
"voltage": 236.32,
"is_valid": true,
"total": 2893827.8,
"total_returned": 310726.1
}
],
"total_power": 21.93,
"emeter_n": {
"current": 0,
"ixsum": 1.69,
"mismatch": false,
"is_valid": false
},
"fs_mounted": true,
"v_data": 1,
"ct_calst": 0,
"update": {
"status": "idle",
"has_update": false,
"new_version": "20221027-110030/v1.12.1-ga9117d3",
"old_version": "20221027-110030/v1.12.1-ga9117d3",
"beta_version": "20230329-163507/v1.13.0-rc2-g1b3e5af"
},
"ram_total": 49928,
"ram_free": 30536,
"fs_size": 233681,
"fs_free": 153612,
"uptime": 3010242
}
Home Assistant 2023.4.6
Supervisor 2023.04.1
Frontend 20230411.1 - latest

What version of Home Assistant Core has the issue?

core-2023.4.6

What was the last working version of Home Assistant Core?

cant say

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Shelly

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-04-25 18:40:34.733 INFO (MainThread) [homeassistant.components.shelly] Starting CoAP context with UDP port 5683
2023-04-25 18:40:34.736 DEBUG (MainThread) [aioshelly.block_device.coap] Socket initialized on port 5683
2023-04-25 18:40:34.753 DEBUG (MainThread) [aioshelly.block_device.coap] Adding device ACADC2 to CoAP message subscriptions
2023-04-25 18:40:34.754 DEBUG (MainThread) [aioshelly.block_device.coap] Sending request 'cit/s' to device ---
2023-04-25 18:40:34.755 DEBUG (MainThread) [homeassistant.components.shelly] Setting up online block device shellyem3-84CCA8ACADC2
2023-04-25 18:40:41.707 DEBUG (MainThread) [aioshelly.block_device.coap] CoapMessage: ip=---, type=periodic(30), options={11: b's', 3332: b'SHEM-3#84CCA8ACADC2#2', 3412: b'\x96\x00', 3420: b'\xcd\xb8'}, payload={'G': [[0, 9103, 1], [0, 1101, 1], [0, 4105, -256.92], [0, 4106, 7216047.9], [0, 4107, 217339.9], [0, 4108, 236.44], [0, 4109, 1.71], [0, 4110, -0.64], [0, 4205, -277.72], [0, 4206, 5871426.4], [0, 4207, 232213.0], [0, 4208, 236.36], [0, 4209, 1.57], [0, 4210, -0.75], [0, 4305, -458.6], [0, 4306, 2893827.8], [0, 4307, 310697.5], [0, 4308, 237.05], [0, 4309, 2.06], [0, 4310, -0.94], [0, 6102, 0]]}
2023-04-25 18:40:41.712 DEBUG (MainThread) [aioshelly.block_device.coap] Calling CoAP message update for device id ACADC2
2023-04-25 18:40:42.261 DEBUG (MainThread) [aioshelly.common] host ---: error: DeviceConnectionError(ClientConnectorError(ConnectionKey(host='---', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=-5984794341828039238), OSError(113, "Connect call failed ('---', 80)")))
2023-04-25 18:40:42.261 DEBUG (MainThread) [aioshelly.block_device.device] host ---: error: DeviceConnectionError(DeviceConnectionError(ClientConnectorError(ConnectionKey(host='---', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=-5984794341828039238), OSError(113, "Connect call failed ('---', 80)"))))
2023-04-25 18:40:42.261 WARNING (MainThread) [homeassistant.config_entries] Config entry 'shellyem3-84CCA8ACADC2' for shelly integration not ready yet: DeviceConnectionError(); Retrying in background

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

Please add the following to configuration.yaml, restart home assistant, wait for the device to become unavailable and attach the log.

logger:
  default: info
  logs:
    aioshelly: debug 
    homeassistant.components.shelly: debug

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

Thanks

If you did not enable the uptime sensor in HA this is valid. Uptime is not pushed into HA. We only get it when we connect to the device, so a value of 37 is correct. If you enable the uptime sensor in HA we manually pull /status. I don’t really recommend enabling this sensor unless you are debugging something. As far as I see once unicast is set your device functions correctly.