-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
lastActivation: duplicate key #98
Comments
That's a bug alright, thanks for reporting and for providing the dump file. Homebridge deCONZ chokes on the Samjin multisensor, which combines a door/window sensor (ZHAOpenClose), a temperature sensors (ZHATemperature), and a vibration sensor (ZHAVibration). Homebridge deCONZ should expose it as a single accessory with Contact Sensor, Temperature Sensor, and Motion Sensor services, incl. Eve history for all three. The bug is that it adds the Last Activiation characteristic for the Motion Sensor to the primary service, instead of to the Motion Sensor service. Usually, for motion sensors, the primary service is the Motion Sensor service, but for the multi sensor, the Context Sensor is the primary. |
Bug fix: SyntaxError: lastActivation: duplicate key. For multi-sensor with Contact and Motion service , see #98.
Could you try beta v0.1.3-0? |
Thanks! Can confirm it's working in beta v0.1.3-0 after removing the accessory from cache first. Closing this. |
@ebaauw: I am reopening this issue. It stills fails with the same error. It happens after the first restart after first activation of the motion sensor. If I then go into the cachedAccessories and delete lastActivation for the motion sensor, the service is created correctly. But if I then activate the sensor and restart homebridge, the error reappears. |
See #111 it looks like deCONZ changed how it exposed the sensor? Messing with |
Thank you for your quick reply! An updated homebridge-deconz.json is available here. For comparison the homebridge-deconz.json from the first post is still available here. I don't like messing around in cachedAccessories either, but it sure beats having to restore from backup using Controller for HomeKit to restore room information, scenes and automations while troubleshooting this. I believe lastActivation is just handled internally by this plugin as it doesn't look to be exposed in the deCONZ REST-API. I'm not quite sure commit 94d5e3d at any point solved this issue. 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). Please note: I have been setting the DDF Mode of Deconz to strict lately (due to incorrect handling in legacy code for some other device I have). I haven't experiences that this has affected the Samsung multi-sensor, but I though I should mention it since you asked if deCONZ changed how it exposed the sensor. |
Yes, same for Times Opened.
No, it didn't; I missed the same issue for the Contact Sensor.
No, the Motion Sensor is. Another bug, but with the rework of Eve history, I'm now able to create any combination (up to seven characteristics), and the notion of primary service has become irrelevant for sensors.
No, it hasn't. I was under the assumption that the previous commit had solved the issue, which it only would have when the Contact Sensor was the primary service. |
Bug fix: _Contact Sensor_ listed wrongly, so it wasn't considered determining the primary service, see #98.
Could you try beta v0.1.5-0? |
Works in beta v0.1.5-0. Closing this issue again. Thank you for your help. |
Released v0.1.7. |
I get an SyntaxError in the logs in the latest version (not present in v0.0.27). I think this is related to a motion sensor:
Ekraveien 18: error: SyntaxError: lastActivation: duplicate key
at Motion.addCharacteristicDelegate (/homebridge/node_modules/homebridge-deconz/node_modules/homebridge-lib/lib/ServiceDelegate/index.js:242:13)
at new Sensor (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Sensor.js:73:48)
at Gateway.addAccessory (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Gateway.js:612:25)
at Gateway.analyseFullState (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Gateway.js:1068:20)
at Gateway.poll (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Gateway.js:903:18)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Gateway.heartbeat (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Gateway.js:339:9)
When updating from v.0.0.27 to 0.1.2 I had to do a full unexposed and expose of the whole gateway to get a functional setup. This error occurred after the first restart of homebridge after that.
homebridge-deconz.json is available here.
The text was updated successfully, but these errors were encountered: