Philips Hue Android SDK Checking for Sunset/ -


i working on app uses philips hue sdk. want perform action if after sunset. looks there sensor on bridge can return true or false if user under daylight.

i'm finding documentation little lacking in area, or @ least i'm not finding it. i've found http://www.developers.meethue.com/documentation/supported-sensors gives no information how use it. other thing i've found http://www.developers.meethue.com/documentation/java-sdk-getting-started#usingsensors says how find new sensors. don't want sensors, want access daylight sensor , check daylight , if not something.

thanks can provide.

you can accomplish setting json values appropriately on bridge. here how using debug/clip.html tool on bridge. use 1 of hue api's perform these operations also, using debug tool easy.

first, put (update) daylight sensor config own long , lat. these values omaha, ne. offsets can set plus or minus 120 minutes make state change earlier or later computed sunrise/sunset time specified lat/long coordinate.

/api/<username>/sensors/1/config  {   "long": "96.0419w",   "lat": "41.2647n",   "sunriseoffset": 0,   "sunsetoffset":  0 } 

if right, state/daylight value should change accordingly.

now, post (create) rule fire based on daylight state:

/api/<username>/rules  {   "name": "turn lights off @ sunrise",   "conditions": [     {       "address": "/sensors/1/state/daylight",       "operator": "eq",       "value": "true"     }   ],   "actions": [     {       "address": "/groups/0/action",       "method": "put",       "body": {         "on": false       }     }   ] } 

this rule turn lights (group 0) off when sensor's state/daylight value flips true @ sunrise. add second rule turn lights on @ sunset.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -