ebaauw / homebridge-deconz

Homebridge plugin for deCONZ
Apache License 2.0
137 stars 7 forks source link

totalConsumption: duplicate key #174

Closed torandreroland closed 1 year ago

torandreroland commented 1 year ago

With v1.0.3 I get totalConsumption: duplicate key-SyntaxError. The error is not present after reverting to v1.0.1.

[10/6/2023, 12:53:59 PM] [deCONZ] Ekraveien 18: error: SyntaxError: totalConsumption: duplicate key at Power.addCharacteristicDelegate (/homebridge/node_modules/homebridge-deconz/node_modules/homebridge-lib/lib/ServiceDelegate/index.js:229:13) at new Light (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Light.js:92:57) at Gateway.addAccessory (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Gateway.js:625:25) at Gateway.analyseFullState (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Gateway.js:1122:20) at Gateway.poll (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Gateway.js:966:18) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Gateway.heartbeat (/homebridge/node_modules/homebridge-deconz/lib/DeconzAccessory/Gateway.js:358:9)

homebridge-deconz.json can be viewed here.

I have two outlets of same type named Kitchen Appliance and Kitchen Charger. This only happens with Kitchen Charger. I suspect it's something with the ordering of the resources in the deconz API.

ebaauw commented 1 year ago

I cannot see the json file: it requires me to login.

I just came across this yesterday, for my ubisys D1. It happens when the ZHAPower resource comes before (has a lower resource ID than) the ZHAConsumption.

ebaauw commented 1 year ago

Fixed in v1.0.4.

torandreroland commented 1 year ago

Wow, that was fixed fast. I can confirm the new version is working. Closing this issue.

Thank you!