Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shelly Plus Smoke configured but without entities #117818

Open
dseira opened this issue May 20, 2024 · 9 comments
Open

Shelly Plus Smoke configured but without entities #117818

dseira opened this issue May 20, 2024 · 9 comments

Comments

@dseira
Copy link

dseira commented May 20, 2024

The problem

Shelly Plus Smoke is configured in the HA as a device but it is not showing any entity:

image

Following the shelly integration guide, in the Shelly Plus Smoke web interface it is already configured the outbound websocket:

image

Shelly Plus Smoke is updated in the latest firmware available:

image

There is no HTTPS in front of HA, just HTTP.

In the diagnostic logs (attached) in HA, it seems that the shelly device is sending correctly the information, for example:

2024-05-20 21:17:07.697 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Websocket server connection from 192.xxx.xxx.38 starting
2024-05-20 21:17:07.697 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Websocket server connection from 192.xxx.xxx.38 ready
2024-05-20 21:17:07.716 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] recv(192.xxx.xxx.38): {'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'ws', 'method': 'NotifyFullStatus', 'params': {'ts': 2.46, 'ble': {}, 'cloud': {'connected': False}, 'devicepower:0': {'id': 0, 'battery': {'V': 2.94, 'percent': 85}}, 'mqtt': {'connected': False}, 'smoke:0': {'id': 0, 'alarm': False, 'mute': False}, 'sys': {'mac': '80646fd1xxyy', 'restart_required': False, 'time': None, 'unixtime': None, 'uptime': 2, 'ram_size': 263324, 'ram_free': 155424, 'fs_size': 458752, 'fs_free': 188416, 'cfg_rev': 20, 'kvs_rev': 0, 'webhook_rev': 0, 'available_updates': {}, 'wakeup_reason': {'boot': 'poweron', 'cause': 'button'}, 'wakeup_period': 86400, 'reset_reason': 1}, 'wifi': {'sta_ip': '192.xxx.xxx.38', 'status': 'got ip', 'ssid': 'IOT', 'rssi': -79}, 'ws': {'connected': True}}}
2024-05-20 21:17:07.772 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Calling WsRPC message update for device id 80646fd1xxyy
2024-05-20 21:17:07.772 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Notification: NotifyStatus {'ts': 2.47, 'ws': {'connected': True}}
2024-05-20 21:17:07.774 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Trying to connect to device at 192.xxx.xxx.38
2024-05-20 21:17:07.786 INFO (MainThread) [aioshelly.rpc_device.wsrpc] Connected to 192.xxx.xxx.38
2024-05-20 21:17:07.786 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] send(192.xxx.xxx.38:80): {'id': 1, 'method': 'Shelly.GetConfig', 'src': 'aios-139631028800160', 'dst': 'shellyplussmoke-80646fd1xxyy', 'auth': {'realm': 'shellyplussmoke-80646fd1xxyy', 'username': 'admin', 'nonce': 1716230827, 'cnonce': 1716232627, 'response': '8eeafc0b2a7222ef7c5d6825126c5ee03dc668abd73b264d63060d5d31153348', 'algorithm': 'SHA-256'}}

But no entity is shown.

Thanks in advance.

What version of Home Assistant Core has the issue?

core-2024.5.4

What was the last working version of Home Assistant Core?

No response

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

home-assistant_shelly_2024-05-20T21-17-49.606Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

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!

Code owner commands

Code owners of shelly can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign shelly Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


shelly documentation
shelly source
(message by IssueLinks)

@bieniu
Copy link
Member

bieniu commented May 20, 2024

Missing entities means incorrect websocket outbound configuration or device not waking up from sleep after configuration.

@dseira
Copy link
Author

dseira commented May 20, 2024

What do you mean? HA is connecting to shelly smoke device and getting all the information:

2024-05-20 21:17:07.774 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Trying to connect to device at 192.xxx.xxx.38
2024-05-20 21:17:07.786 INFO (MainThread) [aioshelly.rpc_device.wsrpc] Connected to 192.xxx.xxx.38
2024-05-20 21:17:07.786 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] send(192.xxx.xxx.38:80): {'id': 1, 'method': 'Shelly.GetConfig', 'src': 'aios-139631028800160', 'dst': 'shellyplussmoke-80646fd1xxyy', 'auth': {'realm': 'shellyplussmoke-80646fd1xxyy', 'username': 'admin', 'nonce': 1716230827, 'cnonce': 1716232627, 'response': '8eeafc0b2a7222ef7c5d6825126c5ee03dc668abd73b264d63060d5d31153348', 'algorithm': 'SHA-256'}}
2024-05-20 21:17:07.803 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] recv(192.xxx.xxx.38:80): {'id': 1, 'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'aios-139631028800160', 'error': {'code': 401, 'message': '{"auth_type": "digest", "nonce": 2, "nc": 1, "realm": "shellyplussmoke-80646fd1xxyy", "algorithm": "SHA-256"}'}}
2024-05-20 21:17:07.803 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Shelly.GetConfig(None) -> {'id': 1, 'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'aios-139631028800160', 'error': {'code': 401, 'message': '{"auth_type": "digest", "nonce": 2, "nc": 1, "realm": "shellyplussmoke-80646fd1xxyy", "algorithm": "SHA-256"}'}}
2024-05-20 21:17:07.803 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] send(192.xxx.xxx.38:80): {'id': 2, 'method': 'Shelly.GetConfig', 'src': 'aios-139631028800160', 'dst': 'shellyplussmoke-80646fd1xxyy', 'auth': {'realm': 'shellyplussmoke-80646fd1xxyy', 'username': 'admin', 'nonce': 2, 'cnonce': 1716232627, 'response': '3b8550fff976e95747dada4cca9085ba20f41a11c89abbe228f40d3f0556fed7', 'algorithm': 'SHA-256'}}
2024-05-20 21:17:07.839 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] recv(192.xxx.xxx.38:80): {'id': 2, 'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'aios-139631028800160', 'result': {'ble': {'enable': True, 'rpc': {'enable': True}}, 'cloud': {'enable': False, 'server': 'iot.shelly.cloud:6012/jrpc'}, 'devicepower:0': {}, 'mqtt': {'enable': False, 'server': None, 'client_id': 'shellyplussmoke-80646fd1xxyy', 'user': None, 'ssl_ca': None, 'topic_prefix': 'shellyplussmoke-80646fd1xxyy', 'rpc_ntf': True, 'status_ntf': False, 'use_client_cert': False, 'enable_rpc': True, 'enable_control': True}, 'smoke:0': {'id': 0, 'name': None}, 'sys': {'device': {'name': None, 'mac': '80646fd1xxyy', 'fw_id': '20240425-141501/1.3.0-ga3fdd3d', 'discoverable': True}, 'location': {'tz': 'Europe/Madrid', 'lat': 38.4786, 'lon': -0.7902}, 'debug': {'level': 2, 'file_level': None, 'mqtt': {'enable': False}, 'websocket': {'enable': False}, 'udp': {'addr': None}}, 'ui_data': {}, 'rpc_udp': {'dst_addr': None, 'listen_port': None}, 'sntp': {'server': 'time.google.com'}, 'cfg_rev': 20}, 'wifi': {'ap': {'ssid': 'ShellyPlusSmoke-80646fd1xxyy', 'is_open': True, 'enable': False}, 'sta': {'ssid': 'IOT', 'is_open': False, 'enable': True, 'ipv4mode': 'static', 'ip': '192.xxx.xxx.38', 'netmask': '255.xxx.xxx.0', 'gw': '192.xxx.xxx.1', 'nameserver': '1.1.1.1'}, 'sta1': {'ssid': None, 'is_open': True, 'enable': False, 'ipv4mode': 'dhcp', 'ip': None, 'netmask': None, 'gw': None, 'nameserver': None}, 'roam': {'rssi_thr': -80, 'interval': 60}}, 'ws': {'enable': True, 'server': 'ws://192.xxx.xxx.37:8123/api/shelly/ws', 'ssl_ca': '*'}}}
2024-05-20 21:17:07.839 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Shelly.GetConfig(None) -> {'id': 2, 'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'aios-139631028800160', 'result': {'ble': {'enable': True, 'rpc': {'enable': True}}, 'cloud': {'enable': False, 'server': 'iot.shelly.cloud:6012/jrpc'}, 'devicepower:0': {}, 'mqtt': {'enable': False, 'server': None, 'client_id': 'shellyplussmoke-80646fd1xxyy', 'user': None, 'ssl_ca': None, 'topic_prefix': 'shellyplussmoke-80646fd1xxyy', 'rpc_ntf': True, 'status_ntf': False, 'use_client_cert': False, 'enable_rpc': True, 'enable_control': True}, 'smoke:0': {'id': 0, 'name': None}, 'sys': {'device': {'name': None, 'mac': '80646fd1xxyy', 'fw_id': '20240425-141501/1.3.0-ga3fdd3d', 'discoverable': True}, 'location': {'tz': 'Europe/Madrid', 'lat': 38.4786, 'lon': -0.7902}, 'debug': {'level': 2, 'file_level': None, 'mqtt': {'enable': False}, 'websocket': {'enable': False}, 'udp': {'addr': None}}, 'ui_data': {}, 'rpc_udp': {'dst_addr': None, 'listen_port': None}, 'sntp': {'server': 'time.google.com'}, 'cfg_rev': 20}, 'wifi': {'ap': {'ssid': 'ShellyPlusSmoke-80646fd1xxyy', 'is_open': True, 'enable': False}, 'sta': {'ssid': 'IOT', 'is_open': False, 'enable': True, 'ipv4mode': 'static', 'ip': '192.xxx.xxx.38', 'netmask': '255.xxx.xxx.0', 'gw': '192.xxx.xxx.1', 'nameserver': '1.1.1.1'}, 'sta1': {'ssid': None, 'is_open': True, 'enable': False, 'ipv4mode': 'dhcp', 'ip': None, 'netmask': None, 'gw': None, 'nameserver': None}, 'roam': {'rssi_thr': -80, 'interval': 60}}, 'ws': {'enable': True, 'server': 'ws://192.xxx.xxx.37:8123/api/shelly/ws', 'ssl_ca': '*'}}}

@bieniu
Copy link
Member

bieniu commented May 20, 2024

This device must connect to the HA server after waking up from sleep, not the HA server to the device. Does your HA server use the IP address 192.xxx.xxx.37 and is available on the local network on port 8123 without SSL encryption?

@dseira
Copy link
Author

dseira commented May 20, 2024

Yes.

In the debug, I can see this:

2024-05-20 21:17:07.697 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Websocket server connection from 192.xxx.xxx.38 starting
2024-05-20 21:17:07.697 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Websocket server connection from 192.xxx.xxx.38 ready
2024-05-20 21:17:07.716 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] recv(192.xxx.xxx.38): {'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'ws', 'method': 'NotifyFullStatus', 'params': {'ts': 2.46, 'ble': {}, 'cloud': {'connected': False}, 'devicepower:0': {'id': 0, 'battery': {'V': 2.94, 'percent': 85}}, 'mqtt': {'connected': False}, 'smoke:0': {'id': 0, 'alarm': False, 'mute': False}, 'sys': {'mac': '80646fd1xxyy', 'restart_required': False, 'time': None, 'unixtime': None, 'uptime': 2, 'ram_size': 263324, 'ram_free': 155424, 'fs_size': 458752, 'fs_free': 188416, 'cfg_rev': 20, 'kvs_rev': 0, 'webhook_rev': 0, 'available_updates': {}, 'wakeup_reason': {'boot': 'poweron', 'cause': 'button'}, 'wakeup_period': 86400, 'reset_reason': 1}, 'wifi': {'sta_ip': '192.xxx.xxx.38', 'status': 'got ip', 'ssid': 'IOT', 'rssi': -79}, 'ws': {'connected': True}}}

@dseira
Copy link
Author

dseira commented May 20, 2024

I've also tested with and without password on the shelly device but without success.

@thecode
Copy link
Member

thecode commented May 20, 2024

From the log:

2024-05-20 21:17:07.786 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] send(192.xxx.xxx.38:80): {'id': 1, 'method': 'Shelly.GetConfig', 'src': 'aios-139631028800160', 'dst': 'shellyplussmoke-80646fd1xxyy', 'auth': {'realm': 'shellyplussmoke-80646fd1xxyy', 'username': 'admin', 'nonce': 1716230827, 'cnonce': 1716232627, 'response': '8eeafc0b2a7222ef7c5d6825126c5ee03dc668abd73b264d63060d5d31153348', 'algorithm': 'SHA-256'}}
2024-05-20 21:17:07.803 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] recv(192.xxx.xxx.38:80): {'id': 1, 'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'aios-139631028800160', 'error': {'code': 401, 'message': '{"auth_type": "digest", "nonce": 2, "nc": 1, "realm": "shellyplussmoke-80646fd1xxyy", "algorithm": "SHA-256"}'}}
2024-05-20 21:17:07.803 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Shelly.GetConfig(None) -> {'id': 1, 'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'aios-139631028800160', 'error': {'code': 401, 'message': '{"auth_type": "digest", "nonce": 2, "nc": 1, "realm": "shellyplussmoke-80646fd1xxyy", "algorithm": "SHA-256"}'}}
2024-05-20 21:17:07.803 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] send(192.xxx.xxx.38:80): {'id': 2, 'method': 'Shelly.GetConfig', 'src': 'aios-139631028800160', 'dst': 'shellyplussmoke-80646fd1xxyy', 'auth': {'realm': 'shellyplussmoke-80646fd1xxyy', 'username': 'admin', 'nonce': 2, 'cnonce': 1716232627, 'response': '3b8550fff976e95747dada4cca9085ba20f41a11c89abbe228f40d3f0556fed7', 'algorithm': 'SHA-256'}}
2024-05-20 21:17:07.839 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] recv(192.xxx.xxx.38:80): {'id': 2, 'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'aios-139631028800160', 'result': {'ble': {'enable': True, 'rpc': {'enable': True}}, 'cloud': {'enable': False, 'server': 'iot.shelly.cloud:6012/jrpc'}, 'devicepower:0': {}, 'mqtt': {'enable': False, 'server': None, 'client_id': 'shellyplussmoke-80646fd1xxyy', 'user': None, 'ssl_ca': None, 'topic_prefix': 'shellyplussmoke-80646fd1xxyy', 'rpc_ntf': True, 'status_ntf': False, 'use_client_cert': False, 'enable_rpc': True, 'enable_control': True}, 'smoke:0': {'id': 0, 'name': None}, 'sys': {'device': {'name': None, 'mac': '80646fd1xxyy', 'fw_id': '20240425-141501/1.3.0-ga3fdd3d', 'discoverable': True}, 'location': {'tz': 'Europe/Madrid', 'lat': 38.4786, 'lon': -0.7902}, 'debug': {'level': 2, 'file_level': None, 'mqtt': {'enable': False}, 'websocket': {'enable': False}, 'udp': {'addr': None}}, 'ui_data': {}, 'rpc_udp': {'dst_addr': None, 'listen_port': None}, 'sntp': {'server': 'time.google.com'}, 'cfg_rev': 20}, 'wifi': {'ap': {'ssid': 'ShellyPlusSmoke-80646fd1xxyy', 'is_open': True, 'enable': False}, 'sta': {'ssid': 'IOT', 'is_open': False, 'enable': True, 'ipv4mode': 'static', 'ip': '192.xxx.xxx.38', 'netmask': '255.xxx.xxx.0', 'gw': '192.xxx.xxx.1', 'nameserver': '1.1.1.1'}, 'sta1': {'ssid': None, 'is_open': True, 'enable': False, 'ipv4mode': 'dhcp', 'ip': None, 'netmask': None, 'gw': None, 'nameserver': None}, 'roam': {'rssi_thr': -80, 'interval': 60}}, 'ws': {'enable': True, 'server': 'ws://192.xxx.xxx.37:8123/api/shelly/ws', 'ssl_ca': '*'}}}
2024-05-20 21:17:07.839 DEBUG (MainThread) [aioshelly.rpc_device.wsrpc] Shelly.GetConfig(None) -> {'id': 2, 'src': 'shellyplussmoke-80646fd1xxyy', 'dst': 'aios-139631028800160', 'result': {'ble': {'enable': True, 'rpc': {'enable': True}}, 'cloud': {'enable': False, 'server': 'iot.shelly.cloud:6012/jrpc'}, 'devicepower:0': {}, 'mqtt': {'enable': False, 'server': None, 'client_id': 'shellyplussmoke-80646fd1xxyy', 'user': None, 'ssl_ca': None, 'topic_prefix': 'shellyplussmoke-80646fd1xxyy', 'rpc_ntf': True, 'status_ntf': False, 'use_client_cert': False, 'enable_rpc': True, 'enable_control': True}, 'smoke:0': {'id': 0, 'name': None}, 'sys': {'device': {'name': None, 'mac': '80646fd1xxyy', 'fw_id': '20240425-141501/1.3.0-ga3fdd3d', 'discoverable': True}, 'location': {'tz': 'Europe/Madrid', 'lat': 38.4786, 'lon': -0.7902}, 'debug': {'level': 2, 'file_level': None, 'mqtt': {'enable': False}, 'websocket': {'enable': False}, 'udp': {'addr': None}}, 'ui_data': {}, 'rpc_udp': {'dst_addr': None, 'listen_port': None}, 'sntp': {'server': 'time.google.com'}, 'cfg_rev': 20}, 'wifi': {'ap': {'ssid': 'ShellyPlusSmoke-80646fd1xxyy', 'is_open': True, 'enable': False}, 'sta': {'ssid': 'IOT', 'is_open': False, 'enable': True, 'ipv4mode': 'static', 'ip': '192.xxx.xxx.38', 'netmask': '255.xxx.xxx.0', 'gw': '192.xxx.xxx.1', 'nameserver': '1.1.1.1'}, 'sta1': {'ssid': None, 'is_open': True, 'enable': False, 'ipv4mode': 'dhcp', 'ip': None, 'netmask': None, 'gw': None, 'nameserver': None}, 'roam': {'rssi_thr': -80, 'interval': 60}}, 'ws': {'enable': True, 'server': 'ws://192.xxx.xxx.37:8123/api/shelly/ws', 'ssl_ca': '*'}}}

It looks like there are two attempts to connect to the device within 40msec which may be related to #116975 but I still don't see the full flow in the log and it makes no sense.

@dseira can you remove the device, enable Debug for Shelly integration, wait for this error, disable debug and attach the log.

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.

Please attach the full log so it will be possible to understand what happen.

Thanks

@dseira
Copy link
Author

dseira commented May 20, 2024

Hi @thecode,

This is the full log (with another shelly devices) after removing the shelly smoke device, enabling the integration debug and reconnecting it:

home-assistant_shelly_2024-05-20T23-01-34.092Z.log

In this case, the shelly smoke doesn't have the password configured.

Thanks.

@dseira
Copy link
Author

dseira commented May 20, 2024

Interesting, after reseting the HA (after the above process) seems that it can reach the device:

image

Could it be because of the passwordless configuration? Strange because I have other shelly devices with password (but no one gen2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants