Hi,
I am trying to integrate a Shelly Pro 3EM in my HA but without success. I am using the Official Shelly integration and when I put the IP, I get values for less than 10 seconds and the Shelly becomes “unavailable”.
I did the configuration according to the Home Assistant docs, using the Websocket, but seems to not be working. I have another 5 Shellys that are working great.
Here is the Shelly debug:
{
"ts": 1689665633.42,
"level": 2,
"data": "shelly_notification:163 Status change of ws: {\"connected\":false}"
},
{
"ts": 1689665636.229,
"level": 2,
"data": "shelly_notification:163 Status change of em:0: {\"id\":0,\"a_act_power\":1.9,\"a_aprt_power\":10.5,\"a_current\":0.044,\"a_pf\":1.00,\"a_voltage\":238.0,\"b_act_power\":0.0,\"b_aprt_power\":9.7,\"b_current\":0.041,\"b_pf\":1.00,\"b_voltage\":238.0,\"c_act_power\":245.6,\"c_aprt_power\":315.3,\"c_current\":1.326,\"c_pf\":0.82,\"c_voltage\":238.0,\"n_current\":null,\"total_act_power\":247.494,\"total_aprt_power\":335.560,\"total_current\":1.411}"
},
{
"ts": 1689665638.755,
"level": 2,
"data": "shelly_http_client.:307 0x3ffe5684: WS ws://192.168.1.253:8123/api/shelly/ws"
},
{
"ts": 1689665638.771,
"level": 2,
"data": "shelly_http_client.:553 0x3ffe5684: WS handshake complete"
},
{
"ts": 1689665638.789,
"level": 2,
"data": "shelly_notification:163 Status change of ws: {\"connected\":true}"
}
]
From what I see, the websocket is lost and reconnected again but the Shelly continues to be “Unavailable”.
The Shelly Integration logs from Home Assistant:
2023-07-18 08:43:09.121 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] recv(192.168.1.244): {'src': 'shellypro3em-0cb815fcc9ec', 'dst': 'ws', 'method': 'NotifyStatus', 'params': {'ts': 1689666185.99, 'em:0': {'id': 0, 'a_act_power': 2.0, 'a_aprt_power': 10.5, 'a_current': 0.044, 'a_pf': 1.0, 'a_voltage': 238.6, 'b_act_power': 0.0, 'b_aprt_power': 9.6, 'b_current': 0.04, 'b_pf': 1.0, 'b_voltage': 238.7, 'c_act_power': 218.3, 'c_aprt_power': 318.7, 'c_current': 1.337, 'c_pf': 0.76, 'c_voltage': 238.6, 'n_current': None, 'total_act_power': 220.376, 'total_aprt_power': 338.74, 'total_current': 1.421}}}
2023-07-18 08:43:09.121 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Calling WsRPC message update for device id 0CB815FCC9EC
2023-07-18 08:43:09.121 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Notification: NotifyStatus {'ts': 1689666185.99, 'em:0': {'id': 0, 'a_act_power': 2.0, 'a_aprt_power': 10.5, 'a_current': 0.044, 'a_pf': 1.0, 'a_voltage': 238.6, 'b_act_power': 0.0, 'b_aprt_power': 9.6, 'b_current': 0.04, 'b_pf': 1.0, 'b_voltage': 238.7, 'c_act_power': 218.3, 'c_aprt_power': 318.7, 'c_current': 1.337, 'c_pf': 0.76, 'c_voltage': 238.6, 'n_current': None, 'total_act_power': 220.376, 'total_aprt_power': 338.74, 'total_current': 1.421}}
2023-07-18 08:43:09.121 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shellypro3em-0cb815fcc9ec data
2023-07-18 08:43:09.123 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Websocket client connection from 192.168.1.244 closed
2023-07-18 08:43:09.123 DEBUG (MainThread) [homeassistant.components.shelly] Reconnecting to Shelly RPC Device - shellypro3em-0cb815fcc9ec
2023-07-18 08:43:09.127 DEBUG (MainThread) [aioshelly.common] host 192.168.1.244: error: DeviceConnectionError(ClientConnectorError(ConnectionKey(host='192.168.1.244', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=-7903860631653832380), ConnectionRefusedError(111, "Connect call failed ('192.168.1.244', 80)")))
2023-07-18 08:43:09.127 DEBUG (MainThread) [aioshelly.rpc_device.device] host 192.168.1.244: error: DeviceConnectionError(DeviceConnectionError(ClientConnectorError(ConnectionKey(host='192.168.1.244', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=-7903860631653832380), ConnectionRefusedError(111, "Connect call failed ('192.168.1.244', 80)"))))
2023-07-18 08:43:09.127 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shellypro3em-0cb815fcc9ec data: Device disconnected: DeviceConnectionError(DeviceConnectionError(ClientConnectorError(ConnectionKey(host='192.168.1.244', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=-7903860631653832380), ConnectionRefusedError(111, "Connect call failed ('192.168.1.244', 80)"))))
2023-07-18 08:43:09.129 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shellypro3em-0cb815fcc9ec data in 0.006 seconds (success: False)
Looks like after some time the connection is refused by Shelly.
Did you pass through the same problem? What did you do to solve it?