thenewwazoo / homebridge-lutron-caseta-leap

Homebridge support for Lutron Caseta Smart Bridge 2
Apache License 2.0
76 stars 27 forks source link

Occupancy sensor never clears if more than one in a room #114

Open Idleyute opened 1 year ago

Idleyute commented 1 year ago

Describe The Bug: I had two sensors in my master bathroom in the lutron app and in HomeKit, one sensor just never cleared occupancy, even when it was cleared in the lutron app. It’s not a big deal..the easy workaround is to create a fake room in the lutron app to get around this limitation. Just thought you’d like to know. (Even with the fake room in the lutron app, the two sensors are still in the same room in HomeKit and work swimmingly)

To Reproduce: You’d need two sensors and this bug definitely isn’t serious enough for the added expense. But yea two sensors in the same room in the lutron app, and one sensor won’t clear in HomeKit.

Expected behavior: Both sensors should clear.

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

thenewwazoo commented 1 year ago

Interesting! The plugin itself doesn't know anything about the rooms. I wonder if there's a serial number bug or something. Unfortunately, I do only have one occupancy sensor, but if I ever get another one I'll be sure to test it. I plan to leave this report open until/when that happens. Thank you for the report!

bobvandevijver commented 7 months ago

@thenewwazoo I believe this is caused due to the OccupancySensorRouter implementation (I am working on the Homey integration, and am using your implementation from time to time to know what LEAP is doing).

An occupancy group can have multiple sensors in it, but the status is from the sensors in the group combined. When additional sensors are registered with the same group, the OccupancySensorRouter will only have the callback registered for the latest sensor added as it uses the group href as identifier. If you change the router so that you can register multiple callbacks for the same occupancy group, I believe it should be solved!