title: How to use sunset and sunrise data
body: <p>I see that the Hue API provides, on the "Daylight" sensor, fields for geographic location, and a sunrise/sunset offset.</p>
  
  <p>To be specific:</p>
  
  <pre><code>lat
  long
  sunriseoffset
  sunsetoffset
  </code></pre>
  
  <p>The API as currently published does not provide any information that I could find on how the sunrise/sunset can be used.</p>
  
  <p>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".</p>
  
  <p>I was going to implement the necessary algorithm myself, but in light of these fields do I need to?</p>
  
  <p>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:</p>
  
  <pre><code>{
    "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"
  }
  </code></pre>
  
  <p>You can see the latitude and longitude values that I set (by default they are 'none').</p>
  
  <p>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.</p>
  
  <p>Does the bridge know about sunrise and sunset times for the given geographic location?</p>
  
  <p>If so, can I reliably query this sensor to determine daylight or not-daylight taking into account sunrise and sunset?</p>