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 H&T constantly raising error "Sleeping device did not update within 7200 seconds interval" #85563

Closed
MacrosorcH opened this issue Jan 9, 2023 · 6 comments · Fixed by #85566

Comments

@MacrosorcH
Copy link

The problem

Every time it wakes up to report new temperature/humidity values, the Shelly Plus H&T triggers a "Sleeping device did not update within 7200 seconds interval" error in the logs. See logs below.

What version of Home Assistant Core has the issue?

2023.1.2

What was the last working version of Home Assistant Core?

2022.12.x

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

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-01-09 20:24:54.399 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Termostato Bagno Sopra data: Sleeping device did not update within 7200 seconds interval
2023-01-09 20:24:54.585 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aioshelly/rpc_device/device.py", line 275, in call_rpc
return await self._wsrpc.call(method, params)
File "/usr/local/lib/python3.10/site-packages/aioshelly/rpc_device/wsrpc.py", line 347, in call
resp = await self._rpc_call(method, params, timeout)
File "/usr/local/lib/python3.10/site-packages/aioshelly/rpc_device/wsrpc.py", line 379, in _rpc_call
resp: dict[str, Any] = await call.resolve
aioshelly.exceptions.DeviceConnectionError: <aioshelly.rpc_device.wsrpc.RPCCall object at 0x7f91f748e0>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 504, in _async_connected
await self._async_run_connected_events()
File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 512, in _async_run_connected_events
await self._async_connect_ble_scanner()
File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 520, in _async_connect_ble_scanner
await async_stop_scanner(self.device)
File "/usr/local/lib/python3.10/site-packages/aioshelly/ble/__init__.py", line 35, in async_stop_scanner
script_name_to_id = await _async_get_scripts_by_name(device)
File "/usr/local/lib/python3.10/site-packages/aioshelly/ble/__init__.py", line 29, in _async_get_scripts_by_name
scripts = await device.script_list()
File "/usr/local/lib/python3.10/site-packages/aioshelly/rpc_device/device.py", line 218, in script_list
data = await self.call_rpc("Script.List")
File "/usr/local/lib/python3.10/site-packages/aioshelly/rpc_device/device.py", line 281, in call_rpc
raise DeviceConnectionError from err
aioshelly.exceptions.DeviceConnectionError

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 9, 2023

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 Change the title of 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.

(message by CodeOwnersMention)


shelly documentation
shelly source
(message by IssueLinks)

@thecode
Copy link
Member

thecode commented Jan 9, 2023

@MacrosorcH can you download diagnostics from the device card in Home Assistant and attach in a comment? Thanks

@MacrosorcH
Copy link
Author

@thecode Many thanks for the quick reply! Here is the diagnostics file:
config_entry-shelly-30ac10cacc1faf14e5a3ec7b6fda8bd9.json.txt

@thecode
Copy link
Member

thecode commented Jan 9, 2023

Can you please add the following to configuration.yaml, restart home assistant, wait for the device to send an update (or for the "Sleeping device did not update within 7200 seconds interval" message to show in logs) 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

@bdraco
Copy link
Member

bdraco commented Jan 9, 2023

There is a bug where we try to stop the ble scanner because it is disabled.

We should not do this on sleepy devices.

Its only now apparent because the lib used to swallow the exception

@bdraco
Copy link
Member

bdraco commented Jan 9, 2023

Also opened home-assistant-libs/aioshelly#330 to fix the Task exception was never retrieved

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

Successfully merging a pull request may close this issue.

6 participants