Light light.1
A light, relay or single LED that only turns on and off.
Use
For any device driven by one switch: a light, an outlet relay, an LED on the board.
On the device
On connecting, the device announces this type with t= in @$ui and sends @$state whenever its state changes. Apps send commands to <cid>@.
@$name My Light:Living room
@$ui t=light.1
@$state on=1
State keys @$state
| Key | Values | Meaning |
|---|---|---|
on | 0 / 1 | 1 when on, 0 when off |
Commands <cid>@
| Command | Meaning |
|---|---|
on | Turn on |
off | Turn off |
toggle | Switch to the opposite state |
{v} is the slider or color value. Even for an unknown command the device should send its current state, so the app does not wait.
Implementation notes
- After handling a command, always send on=1 or on=0 to @$state. That is when the app stops waiting.
- Even for an unknown command, send the current state so the app does not wait.
Default picture
Without v=1 in $ui and a $view, apps use this picture. Its values name the $state keys the picture reads.
{"kind":"bulb","on":"on"}
Examples
- d1-mini-led-button — example page on arduino.iosignal.net
- uno-ethernet-button — example page on arduino.iosignal.net
- uno-ethernet-ir — example page on arduino.iosignal.net
- uno-r4-wifi-heart — example page on arduino.iosignal.net
Type file
iosignal/devices/types/light.1.json (rev 2) · CDN
The screen labels in the type file are in Korean; apps show them as written.