Closed torandreroland closed 1 year ago
Is this the Samsung multi-sensor from #98?
Damn, it looks to be the same bug as fixed in https://github.com/ebaauw/homebridge-deconz/commit/94d5e3d1f788f699f90b799bd4e63238e1d5ca6f, but on the Contact Sensor, instead of on the Motion Sensor. Missed those instances.
I don’t quite understand why it worked before, though. It looks like the Contact Sensor no longer is the primary service. Did deCONZ change the way it exposes the sensor, or did you delete resources from deCONZ?
See part of comment in #98:
I'm not quite sure commit https://github.com/ebaauw/homebridge-deconz/commit/94d5e3d1f788f699f90b799bd4e63238e1d5ca6f at any point solved issue https://github.com/ebaauw/homebridge-deconz/issues/98. It happens after first restart after I have activated the sensor (ie. opened the window), which in retrospect I didn't try before closing that issue originally.
I don't believe Contact Sensor is the primary service (or ever was). At least the json says "primary": "01-FC02" which is the ZHAVibration resource which I believe is the basis for a motion sensor service (ZHATemperature I assume is the basis for Temperature Sensor service and ZHAOpenClose should be the basis for Contact Sensor service).
Not sure if the message was the result of Times Opened being added to the wrong service, or due to initialisation, but it never hurts to initialise it explicitly.
Observed the times opened characteristic in beta v0.1.5-0. It is still added to the motion sensor service instead of the contact sensor. Additionally it isn't updated anymore when opening/closing the contact sensor.
I don't know if this is due to some migration issue from the old to the new characteristic, but I noticed this in the logging when restarting the first time after updating to beta v0.1.5-0 (for all such contact sensors):
Home Office Window Sensor: remove stale characteristic Times Opened Home Office Window Sensor: remove stale value timesOpened
Observed the times opened characteristic in beta v0.1.5-0. It is still added to the motion sensor service instead of the contact sensor. Additionally it isn't updated anymore when opening/closing the contact sensor.
How long after restarting Homebridge did you see this? HomeKit doesn't like configuration changes, and it might take a couple of minutes before the changes are reflected in HomeKit.
Could you try v0.1.7? Does the issue still occur after a while? And after un-exposing and re-exposing the sensor?
If so, please attached the cachedAccessories
file for this Homebridge instance.
The messages indicate that Homebridge deCONZ is cleaning up stale characteristics - I would hope from the Motion Sensor.
I can confirm that the characteristic is successfully added to the contact sensor and it's being updated as well.
This was tested on version 0.1.7, but it may be that I just didn't allow enough time for the changes to be reflected in HomeKit.
Closing this issue. Thank you for your help!
Characteristic timesOpened is according to cachedAccessories instanced with value null which leads to warning:
[homebridge-deconz] This plugin generated a warning from the characteristic 'Times Opened': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
I believe timesOpened should be instanced to 0 the first time.
Additionally the characteristic is added to the motion sensor service, but I would presume it should be added to contact sensor service.