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 Motion sensors unavailable while CoAP messages are coming in #117734

Open
PimDoos opened this issue May 19, 2024 · 9 comments · May be fixed by #118969
Open

Shelly Motion sensors unavailable while CoAP messages are coming in #117734

PimDoos opened this issue May 19, 2024 · 9 comments · May be fixed by #118969

Comments

@PimDoos
Copy link
Contributor

PimDoos commented May 19, 2024

The problem

My Shelly Motion sensors (gen 1, SHMOS-01 and SHMOS-02) become unavailable within about 1 hour 15 minutes after startup.
After restarting Home Assistant or reloading the Shelly integration, the sensors work fine for just over 1 hour. After this, they become unavailable.

I have enabled debug logging (see attached files) for aioshelly and homeassistant.components.shelly. In the logs I see two things happening:

  1. aioshelly shows the devices are sending periodic CoAP messages every 30 minutes, as they should
  2. Roughly 1 hours and 15 minutes after startup, the shelly component logs Error fetching <device name> data: Sleeping device did not update within 3600 seconds interval

What version of Home Assistant Core has the issue?

core-2024.5.4

What was the last working version of Home Assistant Core?

core-2024.4.4

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

shelly-overloop.log
shelly-toilet.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

State history for the 'Toilet Motion' and and 'Overloop Motion' sensors during the log snippets.
image
image

@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)

@rhoddan
Copy link

rhoddan commented May 26, 2024

I have similar for almost all my Shellies
Skärmavbild 2024-05-26 kl  22 26 22

@thecode
Copy link
Member

thecode commented May 26, 2024

@rhoddan by similar I assume you checked the logs and saw that CoAP packets arrive correctly? can you share the log and diagnostics?

@PimDoos can you retest with core 2024.5.5, it should resolve this issue - #116975 (comment)

@logicland
Copy link

Same issue with a Shelly Motion Sensor, deleting and reinstalling this from the integration fixes it for an hour or so, rebooting HA makes it work for around a day.

The sensor uses a fixed IP 192.168.178.xxx:5683, CoLot is enabled, MQTT is Clean Session enabled, Max QoS=1

Rebooting the device has no effect, the device functions normally via http

btw this is with Core 2024.5.5

@PimDoos
Copy link
Contributor Author

PimDoos commented May 29, 2024

After upgrading to 2024.5.5, the issue persists for me.

Error fetching Overloop Motion data: Sleeping device did not update within 3600 seconds interval
Error fetching Toilet Motion data: Sleeping device did not update within 3600 seconds interval

@patriiiiiiiiiick
Copy link

Having similar issue with my TRVs. COAP messages arrive.

2024-06-03 00:43:14.504 DEBUG (MainThread) [aioshelly.block_device.coap] CoapMessage: ip=192.168.0.146, type=CoapType.PERIODIC(30), options={11: b's', 3332: b'SHTRV-01#60A423DCBF4C#2', 3412: b'\x1c!', 3420: b'\x00q'}, payload={'G': [[0, 3101, 18.8], [0, 3102, 65.9], [0, 3103, 8.0], [0, 3104, 46], [0, 3115, 0], [0, 3116, 0], [0, 3117, 0], [0, 3118, 0], [0, 3111, 100], [0, 3121, 0.0], [0, 3122, 0], [0, 9103, 5]]}

@thecode thecode linked a pull request Jun 6, 2024 that will close this issue
20 tasks
@PimDoos
Copy link
Contributor Author

PimDoos commented Jun 7, 2024

After upgrading to 2024.5.5, the issue persists for me.

Error fetching Overloop Motion data: Sleeping device did not update within 3600 seconds interval
Error fetching Toilet Motion data: Sleeping device did not update within 3600 seconds interval

Ironically, since I posted this I restarted HA once and did not have any issues with any of my battery powered Shelly devices since.
Until today when I upgraded to 2024.06.0: two of my Shelly motion sensors became unavailable again after just over an hour. I'm curious to see if the PR fixes this.

@bieniu
Copy link
Member

bieniu commented Jun 9, 2024

Today I performed a 12-hour Shelly Motion test. Device entities in HA were available all the time. We suspect that the problem may be caused by blocking the event loop by another integration (probably custom one). The CoIoT packet with status reaches the HA server but cannot be processed correctly.
To check this, please enable HA built-in debug mode, restart HA and attach the log file after few hours.

@PimDoos
Copy link
Contributor Author

PimDoos commented Jun 11, 2024

I've run HA with debug mode enabled for just over a day, and this one stands out:
image

I'll disable entsoe and see if that fixes the issue. Looks like the issue has already been reported with the custom integration. JaccoR/hass-entso-e#156

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

Successfully merging a pull request may close this issue.

9 participants