core icon indicating copy to clipboard operation
core copied to clipboard

BTHome missing Shelly BLU Motion events

Open patriiiiiiiiiick opened this issue 1 year ago • 8 comments

The problem

I am using Shelly BLU Motion to switch on some lights and maintain them on. However, I observe that, despite us being there moving around, the lights switch off regularly. While I do find the last motion event in the Shelly app, that event is not listed in the logbook. There is nothing either in the log file. 1000017833 1000017811

Do I enable debug logging and report back when it has happened again?

What version of Home Assistant Core has the issue?

core-2024.7.2

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

BTHome

Link to integration documentation on our website

https://www.home-assistant.io/integrations/bthome

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

patriiiiiiiiiick avatar Jul 20 '24 05:07 patriiiiiiiiiick

Hey there @ernst79, mind taking a look at this issue as it has been labeled with an integration (bthome) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of bthome 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 bthome 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)


bthome documentation bthome source (message by IssueLinks)

home-assistant[bot] avatar Jul 20 '24 05:07 home-assistant[bot]

Maybe its a bluetooth range issue? Have you enable and tracked your signal strength? If so, what values are typical?

jum0n avatar Aug 04 '24 17:08 jum0n

Since the event is logged by the Shelly app, a range issue would not explain this missed event.

patriiiiiiiiiick avatar Aug 05 '24 11:08 patriiiiiiiiiick

The app is using the Bluetooth radio of your Phone, while home assistant is using the Bluetooth radio of the HA device. So, it can happen that the range between sensor and Phone is ok, but not to your HA Bluetooth radio. Moreover, the Bluetooth radio of your HA machine can interfere with wifi, as the both use 2.4 GHz. Try using an external BT dongle on an USB extension cable or try using a ESPHome Bluetooth proxy device.

Ernst79 avatar Aug 05 '24 12:08 Ernst79

I beg to disagree: my phone is not connecting with Bluetooth to/from the sensor. The Bluetooth signal can go through 2 paths:

  • through the RPi,
  • through a Shelly plus device serving as a Bluetooth proxy. The plus device reports events to https://control.shelly.cloud/ which is reflected in the mobile app (some info is also cached on the plus device).

In the past, I had disabled Bluetooth on the RPi to see if it helped, but it didn't.

patriiiiiiiiiick avatar Aug 05 '24 13:08 patriiiiiiiiiick

It still might be helpful to enable and track what signal strength values are being reported in HA.

jum0n avatar Aug 05 '24 16:08 jum0n

Ok, didnt know that shelly also works via a shelly plus device. But as said by jum0n, show us the RSSI values in HA. Also check the Bluetooth intergration debug logs, to see is messages arive at all from your sensor's mac address.

Ernst79 avatar Aug 05 '24 23:08 Ernst79

Nothing in the log file in debug mode even when it works. Does that mean that this is not going through BTHome?

Maybe I should put Shelly in debug.

patriiiiiiiiiick avatar Sep 21 '24 10:09 patriiiiiiiiiick

I disabled the Bluetooth gateway of my Shelly plus device. The motion is still detected and the log file remains empty despite enabling debug in BTHome. Is enabling debug logging through the UI indeed supported?

patriiiiiiiiiick avatar Sep 25 '24 21:09 patriiiiiiiiiick

I am even more puzzled now. I disabled the Bluetooth integration and things continue to work. How is that possible?

patriiiiiiiiiick avatar Sep 25 '24 21:09 patriiiiiiiiiick

It seems that Shelly Plus device is the guilty one. I went to unplug it and Bluetooth communications stopped working. I therefore enabled the Bluetooth integration and things resumed working. However, there is still nothing in the log file in debug mode. Over and out for now.

patriiiiiiiiiick avatar Sep 25 '24 22:09 patriiiiiiiiiick

While waiting for #126988, I would like to enable debug on this integration. I will try to use the bthome key but please communicate to me me which one it is.

I have missed events on a device which has a signal strength of -68 to -78 dbm.

logger:
  default: warning
  logs:
    bthome: debug

patriiiiiiiiiick avatar Oct 03 '24 14:10 patriiiiiiiiiick

I have a similar problem. HA does not detect all BLU Shelly Motion events, especially the "cleared" ones and sometimes the sensor remains in the "motion detected" state for hours. I attach two screenshots from the Shelly App and from HA logbook showing the differences.

IMG_2014 Screenshot 2024-11-30 alle 12 34 44

vonBrizien avatar Nov 30 '24 11:11 vonBrizien

I am exchanging with Shelly support on the issue. Beacon mode doesn't work well for BLU Motion sensors, while working properly with BLU DW.

image

patriiiiiiiiiick avatar Dec 01 '24 20:12 patriiiiiiiiiick

After I put a gateway (a Shelly Plug S Gen3) in the same room as the motion sensor it is working fine. Probably it was a matter of signal strength, since the closest gateway was on a different floor.

vonBrizien avatar Dec 16 '24 18:12 vonBrizien

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.