I gathered logs and have seen a bunch of 401 response codes from the shelly device. I don’t know exactly what’s happening. Assume ha integration asks for multiple data points and the shelly device changes nonce too many times. Also, after boot of the shelly device, it connects with ws way before it got time from an sntp server. I assume this causes the nonce changes. I tried a local sntp server at home but it only seemed to mitigate the issue by a little bit.
00:24:09.470 host 10.2.4.1:80: RPC device create, MAC: 123456789012
07:32:45.822 Websocket server connection from 10.2.4.1 starting
07:32:45.822 Websocket server connection from 10.2.4.1 ready
07:32:45.852 recv(10.2.4.1): {'src': 'shellyplussmoke-123456789012', 'dst': 'ws', 'method': 'NotifyFullStatus', 'params': {'ts': 1731566804.16, 'ble': {}, 'cloud': {'connected': False}, 'devicepower:0': {'id': 0, 'battery': {'V': 2.99, 'percent': 97}}, 'mqtt': {'connected': False}, 'smoke:0': {'id': 0, 'alarm': False, 'mute': False}, 'sys': {'mac': '123456789012', 'restart_required': False, 'time': None, 'unixtime': None, 'uptime': 2, 'ram_size': 254968, 'ram_free': 160560, 'fs_size': 393216, 'fs_free': 172032, 'cfg_rev': 23, 'kvs_rev': 0, 'webhook_rev': 0, 'available_updates': {}, 'wakeup_reason': {'boot': 'poweron', 'cause': 'undefined'}, 'wakeup_period': 86400, 'reset_reason': 1}, 'wifi': {'sta_ip': '10.2.4.1', 'status': 'got ip', 'ssid': 'MY_WIFI', 'rssi': -56}, 'ws': {'connected': True}}}
07:32:45.852 host 10.2.4.1:80: RPC device initialize
07:32:45.852 Trying to connect to device at 10.2.4.1
07:32:45.871 Connected to 10.2.4.1
07:32:45.871 send(10.2.4.1:80): {'id': 1, 'method': 'Shelly.GetDeviceInfo', 'src': 'aios-140219336950416', 'dst': 'shellyplussmoke-123456789012'}
07:32:45.901 recv(10.2.4.1): {'src': 'shellyplussmoke-123456789012', 'dst': 'ws', 'method': 'NotifyStatus', 'params': {'ts': 1731566804.17, 'ws': {'connected': True}}}
07:32:45.902 recv(10.2.4.1:80): {'id': 1, 'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'result': {'name': 'Rauchmelder', 'id': 'shellyplussmoke-123456789012', 'mac': '123456789012', 'slot': 1, 'model': 'SNSN-0031Z', 'gen': 2, 'fw_id': '20241011-114442/1.4.4-g6d2a586', 'ver': '1.4.4', 'app': 'PlusSmoke', 'auth_en': True, 'auth_domain': 'shellyplussmoke-123456789012'}}
07:32:45.902 send(10.2.4.1:80): {'id': 2, 'method': 'Shelly.GetConfig', 'src': 'aios-140219336950416', 'dst': 'shellyplussmoke-123456789012', 'auth': {'realm': 'shellyplussmoke-123456789012', 'username': 'admin', 'nonce': 1731736965, 'cnonce': 1731738765, 'response': 'bf1eae0a75d9f6740bdafe9c35a1e013d8c3058386520bffa108e58eacbf3181', 'algorithm': 'SHA-256'}}
07:32:45.902 send(10.2.4.1:80): {'id': 3, 'method': 'Shelly.GetComponents', 'src': 'aios-140219336950416', 'params': {'dynamic_only': True}, 'dst': 'shellyplussmoke-123456789012', 'auth': {'realm': 'shellyplussmoke-123456789012', 'username': 'admin', 'nonce': 1731736965, 'cnonce': 1731738765, 'response': 'bf1eae0a75d9f6740bdafe9c35a1e013d8c3058386520bffa108e58eacbf3181', 'algorithm': 'SHA-256'}}
07:32:46.423 recv(10.2.4.1:80): {'id': 2, 'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'error': {'code': 401, 'message': '{"auth_type": "digest", "nonce": 1731566804, "nc": 1, "realm": "shellyplussmoke-123456789012", "algorithm": "SHA-256"}'}}
07:32:46.497 recv(10.2.4.1:80): {'id': 3, 'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'error': {'code': 401, 'message': '{"auth_type": "digest", "nonce": 1731566804, "nc": 1, "realm": "shellyplussmoke-123456789012", "algorithm": "SHA-256"}'}}
07:32:46.497 result(10.2.4.1:80): Shelly.GetConfig(None) -> UndefinedType._singleton
07:32:46.497 result(10.2.4.1:80): Shelly.GetComponents({'dynamic_only': True}) -> UndefinedType._singleton
07:32:46.497 send(10.2.4.1:80): {'id': 4, 'method': 'Shelly.GetConfig', 'src': 'aios-140219336950416', 'dst': 'shellyplussmoke-123456789012', 'auth': {'realm': 'shellyplussmoke-123456789012', 'username': 'admin', 'nonce': 1731566804, 'cnonce': 1731738766, 'response': '3750c3f5b8eac4b28c9d062ca36aa34901139fde7602728ec9ffd583fb5e8dbb', 'algorithm': 'SHA-256'}}
07:32:46.498 send(10.2.4.1:80): {'id': 5, 'method': 'Shelly.GetComponents', 'src': 'aios-140219336950416', 'params': {'dynamic_only': True}, 'dst': 'shellyplussmoke-123456789012', 'auth': {'realm': 'shellyplussmoke-123456789012', 'username': 'admin', 'nonce': 1731566804, 'cnonce': 1731738766, 'response': '3750c3f5b8eac4b28c9d062ca36aa34901139fde7602728ec9ffd583fb5e8dbb', 'algorithm': 'SHA-256'}}
07:32:46.541 recv(10.2.4.1:80): {'id': 4, 'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'error': {'code': 401, 'message': '{"auth_type": "digest", "nonce": 1731738766, "nc": 1, "realm": "shellyplussmoke-123456789012", "algorithm": "SHA-256"}'}}
07:32:46.558 recv(10.2.4.1): {'src': 'shellyplussmoke-123456789012', 'dst': 'ws', 'method': 'NotifyStatus', 'params': {'ts': 1731738766.49, 'cloud': {'connected': True}}}
07:32:46.586 recv(10.2.4.1:80): {'id': 5, 'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'error': {'code': 401, 'message': '{"auth_type": "digest", "nonce": 1731738766, "nc": 1, "realm": "shellyplussmoke-123456789012", "algorithm": "SHA-256"}'}}
07:32:46.586 recv(10.2.4.1:80): {'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'method': 'NotifyStatus', 'params': {'ts': 1731738766.49, 'cloud': {'connected': True}}}
07:32:46.586 result(10.2.4.1:80): Shelly.GetConfig(None) -> UndefinedType._singleton
07:32:46.586 result(10.2.4.1:80): Shelly.GetComponents({'dynamic_only': True}) -> UndefinedType._singleton
07:32:46.586 host 10.2.4.1:80: error: InvalidAuthError(InvalidAuthError('{"auth_type": "digest", "nonce": 1731738766, "nc": 1, "realm": "shellyplussmoke-123456789012", "algorithm": "SHA-256"}'))
07:32:46.586 Websocket client connection from 10.2.4.1:80 closed
07:32:52.543 recv(10.2.4.1): {'src': 'shellyplussmoke-123456789012', 'dst': 'ws', 'method': 'NotifyStatus', 'params': {'ts': 1731738772.48, 'smoke:0': {'id': 0, 'alarm': False}}}
07:32:52.543 host 10.2.4.1:80: RPC device initialize
07:32:52.543 Trying to connect to device at 10.2.4.1
07:32:52.547 recv(10.2.4.1): {'src': 'shellyplussmoke-123456789012', 'dst': 'ws', 'method': 'NotifyStatus', 'params': {'ts': 1731738772.48, 'sys': {'wakeup_reason': {'cause': 'status_update'}}}}
07:32:52.550 recv(10.2.4.1): {'src': 'shellyplussmoke-123456789012', 'dst': 'ws', 'method': 'NotifyEvent', 'params': {'ts': 1731738772.48, 'events': [{'component': 'sys', 'event': 'sleep', 'ts': 1731738772.48}]}}
07:32:52.558 Connected to 10.2.4.1
07:32:52.558 send(10.2.4.1:80): {'id': 6, 'method': 'Shelly.GetDeviceInfo', 'src': 'aios-140219336950416', 'dst': 'shellyplussmoke-123456789012', 'auth': {'realm': 'shellyplussmoke-123456789012', 'username': 'admin', 'nonce': 1731566804, 'cnonce': 1731738766, 'response': '3750c3f5b8eac4b28c9d062ca36aa34901139fde7602728ec9ffd583fb5e8dbb', 'algorithm': 'SHA-256'}}
07:32:52.581 recv(10.2.4.1:80): {'id': 6, 'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'result': {'name': 'Rauchmelder', 'id': 'shellyplussmoke-123456789012', 'mac': '123456789012', 'slot': 1, 'model': 'SNSN-0031Z', 'gen': 2, 'fw_id': '20241011-114442/1.4.4-g6d2a586', 'ver': '1.4.4', 'app': 'PlusSmoke', 'auth_en': True, 'auth_domain': 'shellyplussmoke-123456789012'}}
07:32:52.581 result(10.2.4.1:80): Shelly.GetDeviceInfo(None) -> {'name': 'Rauchmelder', 'id': 'shellyplussmoke-123456789012', 'mac': '123456789012', 'slot': 1, 'model': 'SNSN-0031Z', 'gen': 2, 'fw_id': '20241011-114442/1.4.4-g6d2a586', 'ver': '1.4.4', 'app': 'PlusSmoke', 'auth_en': True, 'auth_domain': 'shellyplussmoke-123456789012'}
07:32:52.581 send(10.2.4.1:80): {'id': 7, 'method': 'Shelly.GetConfig', 'src': 'aios-140219336950416', 'dst': 'shellyplussmoke-123456789012', 'auth': {'realm': 'shellyplussmoke-123456789012', 'username': 'admin', 'nonce': 1731736972, 'cnonce': 1731738772, 'response': 'db5d3e581d043aad2256f012e7afceb3a6ed913881ef3cfd0c7025120089d693', 'algorithm': 'SHA-256'}}
07:32:52.581 send(10.2.4.1:80): {'id': 8, 'method': 'Shelly.GetComponents', 'src': 'aios-140219336950416', 'params': {'dynamic_only': True}, 'dst': 'shellyplussmoke-123456789012', 'auth': {'realm': 'shellyplussmoke-123456789012', 'username': 'admin', 'nonce': 1731736972, 'cnonce': 1731738772, 'response': 'db5d3e581d043aad2256f012e7afceb3a6ed913881ef3cfd0c7025120089d693', 'algorithm': 'SHA-256'}}
07:32:52.617 recv(10.2.4.1:80): {'id': 7, 'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'result': {'ble': {'enable': False, 'rpc': {'enable': True}}, 'cloud': {'enable': True, 'server': 'shelly-121-eu.shelly.cloud:6022/jrpc'}, 'devicepower:0': {}, 'mqtt': {'enable': False, 'server': None, 'client_id': 'shellyplussmoke-123456789012', 'user': None, 'ssl_ca': None, 'topic_prefix': 'shellyplussmoke-123456789012', 'rpc_ntf': True, 'status_ntf': False, 'use_client_cert': False, 'enable_rpc': True, 'enable_control': True}, 'smoke:0': {'id': 0, 'name': 'Rauchmelder'}, 'sys': {'device': {'name': 'Rauchmelder', 'mac': '123456789012', 'fw_id': '20241011-114442/1.4.4-g6d2a586', 'discoverable': True}, 'location': {'tz': 'Europe/Berlin', 'lat': 1.8296, 'lon': 2.9813}, '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': 23}, 'wifi': {'ap': {'ssid': 'ShellyPlusSmoke-123456789012', 'is_open': True, 'enable': False}, 'sta': {'ssid': 'MY_WIFI', 'is_open': False, 'enable': True, 'ipv4mode': 'dhcp', 'ip': None, 'netmask': None, 'gw': None, 'nameserver': None}, '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://10.0.1.2:8123/api/shelly/ws', 'ssl_ca': '*'}}}
07:32:52.662 recv(10.2.4.1:80): {'id': 8, 'src': 'shellyplussmoke-123456789012', 'dst': 'aios-140219336950416', 'result': {'components': [], 'cfg_rev': 23, 'offset': 0, 'total': 0}}
07:32:52.662 result(10.2.4.1:80): Shelly.GetConfig(None) -> {'ble': {'enable': False, 'rpc': {'enable': True}}, 'cloud': {'enable': True, 'server': 'shelly-121-eu.shelly.cloud:6022/jrpc'}, 'devicepower:0': {}, 'mqtt': {'enable': False, 'server': None, 'client_id': 'shellyplussmoke-123456789012', 'user': None, 'ssl_ca': None, 'topic_prefix': 'shellyplussmoke-123456789012', 'rpc_ntf': True, 'status_ntf': False, 'use_client_cert': False, 'enable_rpc': True, 'enable_control': True}, 'smoke:0': {'id': 0, 'name': 'Rauchmelder'}, 'sys': {'device': {'name': 'Rauchmelder', 'mac': '123456789012', 'fw_id': '20241011-114442/1.4.4-g6d2a586', 'discoverable': True}, 'location': {'tz': 'Europe/Berlin', 'lat': 1.8296, 'lon': 2.9813}, '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': 23}, 'wifi': {'ap': {'ssid': 'ShellyPlusSmoke-123456789012', 'is_open': True, 'enable': False}, 'sta': {'ssid': 'MY_WIFI', 'is_open': False, 'enable': True, 'ipv4mode': 'dhcp', 'ip': None, 'netmask': None, 'gw': None, 'nameserver': None}, '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://10.0.1.2:8123/api/shelly/ws', 'ssl_ca': '*'}}
07:32:52.662 result(10.2.4.1:80): Shelly.GetComponents({'dynamic_only': True}) -> {'components': [], 'cfg_rev': 23, 'offset': 0, 'total': 0}
07:32:52.662 host 10.2.4.1:80: RPC device init finished
07:32:53.018 Websocket client connection from 10.2.4.1:80 closed