ebaauw / homebridge-hue

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

Expose more precise Hue bridge daylight sensor status #1186

Open fjwillemsen opened 1 month ago

fjwillemsen commented 1 month ago

Issue

The Hue bridge has a built-in daylight sensor that can be exposed. The Phoscon App also shows the PHDL00 daylight sensor of the Hue bridge. Both homebridge-hue homebridge-deconz seem to treat this as a binary sensor, with 100,000.0 lux if daylight is true and 0.0001 lux otherwise. However, the output of the sensor (in the logs below) contains a lot more information that would make it more useful, such as the sunrise and sunset times and, most importantly, a much more complete status (described here) that would be very useful for automations:

100: nadir
110: end of night
120: nautical dawn
130: dawn
140: start of sunrise
150: end of sunrise
160: golden hour 1
170: solar noon
180: golden hour 2
190: start of sunset
200: end of sunset
210: dusk
220: nautical dusk
230: start of night

Can support for this output be added to homebridge-hue and / or homebridge-deconz?

Log Messages

Output of deconz get /sensors/1:

{
  "config": {
    "configured": true,
    "on": true,
    "sunriseoffset": 30,
    "sunsetoffset": -30
  },
  "etag": [removed from log],
  "manufacturername": "Philips",
  "modelid": "PHDL00",
  "name": "Daylight",
  "state": {
    "dark": false,
    "daylight": true,
    "lastupdated": "2024-05-25T09:21:40.724",
    "status": 160,
    "sunrise": "2024-05-25T03:36:12",
    "sunset": "2024-05-25T19:43:19"
  },
  "swversion": "1.0",
  "type": "Daylight",
  "uniqueid": "00:21:2e:ff:ff:06:04:9c-01"
}
ebaauw commented 1 month ago

The Phoscon App also shows the PHDL00 daylight sensor of the Hue bridge.

I doubt that Phoscon shows anything from a Hue bridge. It does show the built-in Daylight sensor of the deCONZ gateway.

Both homebridge-hue homebridge-deconz seem to treat this as a binary sensor, with 100,000.0 lux if daylight is true and 0.0001 lux otherwise.

The built-in Hue bridge sensor is pretty much that. Only the built-in deCONZ sensor exposes the additional information.

Can support for this output be added to homebridge-hue and / or homebridge-deconz?

Both plugins have already supported this for years. Check out a decent HomeKit app (like Eve). The limitation is Apple’s Home app, not the Homebridge plugins.

image