ebaauw / homebridge-hue

Homebridge plugin for Philips Hue
Apache License 2.0
898 stars 91 forks source link

TypeError: Cannot read property 'undefined' of undefined #948

Closed philharmonie closed 3 years ago

philharmonie commented 3 years ago

Issue

I added 3 Aqara Humidity and Temperature Sensors to Deconz. Usually when I add sensors to deconz, they are appearing right away in the apple Home App when I restart home bridge. But this time, I receive the following issues:

Log Messages

[3/10/2021, 9:54:10 PM] [Hue] Philips hue: error: /sensors/21: {"manufacturername":"Hue Essentials","modelid":"Button state","name":"Dimmer switch 11 1000 State","recycle":true,"state":{"lastupdated":"2021-03-06T22:35:26","status":0},"swversion":"1.0","type":"CLIPGenericStatus","uniqueid":"jrVyGmpmRrXwpwW0JFTc66wcst6X7DNY"}
TypeError: Cannot read property 'undefined' of undefined
    at new HueSensor (/homebridge/node_modules/homebridge-hue/lib/HueSensor.js:1723:24)
    at HueAccessory.exposeSensorResource (/homebridge/node_modules/homebridge-hue/lib/HueAccessory.js:322:20)
    at HueAccessory.exposeSensorResources (/homebridge/node_modules/homebridge-hue/lib/HueAccessory.js:312:12)
    at HueAccessory.expose (/homebridge/node_modules/homebridge-hue/lib/HueAccessory.js:124:8)
    at HueBridge.exposeResources (/homebridge/node_modules/homebridge-hue/lib/HueBridge.js:583:49)
    at HueBridge.accessories (/homebridge/node_modules/homebridge-hue/lib/HueBridge.js:116:16)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 0)
    at HuePlatform.accessories (/homebridge/node_modules/homebridge-hue/lib/HuePlatform.js:352:29)
[3/10/2021, 9:54:11 PM] [Hue] homebridge: error: Cannot add a Service with the same UUID '00000084-0000-1000-8000-0026BB765292' and subtype '01-0400' as another Service in this Accessory.

homebridge-hue.json-2.gz

ebaauw commented 3 years ago

Please attach the debug dump file and capture and attach a debug log file. See the FAQ on how to do this.

Looks like issues with deCONZ:

philharmonie commented 3 years ago
  • The config part is missing from the CLIPGenericStatus sensor;
  • The resource for a light sensor is exposed multiple times.

What do you mean be config part is missing from CLIPGenericStatus sensor? Btw: I don't know what this sensor is.

ebaauw commented 3 years ago

It's a virtual sensor (variable) exposed by the REST API for API clients to keep a status. Looking at the log message, it seems to have be created by Hue Essentials. deCONZ should expose config.on and config.reachable on the resource, but the config object seems to be missing.

philharmonie commented 3 years ago

Thank you for trying to help be, but unfortunately I'm a little bit lost. I use the Hue Essentials App. How can I add the config part to that sensor? And why is that issue happening, when I pair the new Aqara Sensors?

ebaauw commented 3 years ago

homebridge-hue.json-2.gz

Sorry I couldn't look at that earlier from my iPad. Where did you get this file from? I don't understand it at all. The dump looks like a weird hybrid between a Hue bridge and deCONZ gateway.

I use the Hue Essentials App.

What do you mean by that? Does Hue Essentials sit in between deCONZ and Homebridge Hue?

How can I add the config part to that sensor?

The API should expose it. I don't know why it doesn't. Normally I would say this is a bug in deCONZ, but more likely a bug in the thing in between deCONZ and Homebridge Hue. The dump suggests your excluding CLIPGenericStatus sensors from being exposed, so I don't understand how the error can still occur. Please capture and attach a debug log file.

And why is that issue happening, when I pair the new Aqara Sensors?

I don't know. Not even sure if this is related.

Your Büro Hue motion sensor has two resources for the light level (22 and 24) and two for the temperature (23 and 25). That's causing the second error.