I see that the Hue API provides, on the "Daylight" sensor, fields for geographic location, and a sunrise/sunset offset.
To be specific:
lat
long
sunriseoffset
sunsetoffset
The API as currently published does not provide any information that I could find on how the sunrise/sunset can be used.
If I use the update sensor API to set the latitude and longitude, will the sunrise/sunset offsets be populated with data automatically, and I can query those to adjust my light schedule accordingly? I want to do e.g. "every day, light on at sunset + 20 minutes".
I was going to implement the necessary algorithm myself, but in light of these fields do I need to?
When testing this, I updated the latitude and longitude on the sensor config, here is a dump of the result of querying the sensor after the update:
{
"state": {
"daylight":false,
"lastupdated":"2014-11-06T19:19:31"
},
"config": {
"on":true,
"long":"1.5333W",
"lat":"56.2442N",
"sunriseoffset":30,
"sunsetoffset":-30
},
"name":"Daylight",
"type":"Daylight",
"modelid":"PHDL00",
"manufacturername":"Philips",
"swvversion":"1.0"
}
You can see the latitude and longitude values that I set (by default they are 'none').
It's now evident that the sunrise and sunset offsets are not calculated values. They are instead used to configure when the sensor value trips over from daylight to not-daylight or vice versa - for example, daylight becomes true "sunrise offset" minutes after sunrise.
Does the bridge know about sunrise and sunset times for the given geographic location?
If so, can I reliably query this sensor to determine daylight or not-daylight taking into account sunrise and sunset?