Confirmed users
184
edits
(→Specific services and channels: + Lights) |
(Adding Hue Light service doc) |
||
Line 196: | Line 196: | ||
== Lights == | == Lights == | ||
Sample service entry for a ''Philips Hue Lightstrip Plus'': | |||
[ | |||
{ | |||
"adapter": "philips_hue@link.mozilla.org", | |||
"getters": { | |||
"getter:available.4.001788fffe25681a.philips_hue@link.mozilla.org": { | |||
"adapter": "philips_hue@link.mozilla.org", | |||
"id": "getter:available.4.001788fffe25681a.philips_hue@link.mozilla.org", | |||
"kind": { | |||
"adapter": "Philips Hue Adapter", | |||
"kind": "available", | |||
"typ": "OnOff", | |||
"vendor": "foxlink@mozilla.com" | |||
}, | |||
"mechanism": "getter", | |||
"service": "service:4.001788fffe25681a.philips_hue@link.mozilla.org", | |||
"tags": [] | |||
}, | |||
"getter:power.4.001788fffe25681a.philips_hue@link.mozilla.org": { | |||
"adapter": "philips_hue@link.mozilla.org", | |||
"id": "getter:power.4.001788fffe25681a.philips_hue@link.mozilla.org", | |||
"kind": "LightOn", | |||
"mechanism": "getter", | |||
"service": "service:4.001788fffe25681a.philips_hue@link.mozilla.org", | |||
"tags": [] | |||
} | |||
}, | |||
"id": "service:4.001788fffe25681a.philips_hue@link.mozilla.org", | |||
"properties": { | |||
"manufacturer": "Philips", | |||
"model": "LST002", | |||
"name": "Hue lightstrip plus 1", | |||
"type": "Light/ColorLight" | |||
}, | |||
"setters": { | |||
"setter:power.4.001788fffe25681a.philips_hue@link.mozilla.org": { | |||
"adapter": "philips_hue@link.mozilla.org", | |||
"id": "setter:power.4.001788fffe25681a.philips_hue@link.mozilla.org", | |||
"kind": "LightOn", | |||
"mechanism": "setter", | |||
"service": "service:4.001788fffe25681a.philips_hue@link.mozilla.org", | |||
"tags": [] | |||
} | |||
}, | |||
"tags": [ | |||
"type:Light/ColorLight" | |||
] | |||
} | |||
] | |||
Turn | === Channels === | ||
==== getter:availability ==== | |||
Response: | |||
{"OnOff":"Off"} when light not ready to receive commands (f.e. no external power) | |||
{"OnOff":"On"} when light ready to receive commands | |||
==== getter:power ==== | |||
Response: | |||
{"OnOff":"Off"} when the light is completely turned off | |||
{"OnOff":"On"} when the light is turned on | |||
==== setter:power ==== | |||
Value: | |||
{"OnOff":"Off"} to turn the light off | |||
{"OnOff":"On"} to turn the light on | |||
=== Examples === | |||
==== Check availability of an individual light ==== | |||
PUT http://localhost:3000/api/v1/channels/get {"id":"getter:available.4.001788fffe25681a.philips_hue@link.mozilla.org"} | |||
==== Turn all the lights off ==== | |||
PUT http://localhost:3000/api/v1/channels/set {"select":{"kind":"LightOn"},"value":{"OnOff":"Off"}} |