4 switches switch4.1
Four switches.
Use
For devices with four outputs, or for a four-switch state on a shared channel. The basic iris board firmware uses this type too.
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 4 switches:Living room
@$ui t=switch4.1
@$state s1=1;s2=1;s3=1;s4=1
State keys @$state
| Key | Values | Meaning |
|---|---|---|
s1 | 0 / 1 | Switch 1: 1 when on |
s2 | 0 / 1 | Switch 2 |
s3 | 0 / 1 | Switch 3 |
s4 | 0 / 1 | Switch 4 |
Commands <cid>@
| Command | Meaning |
|---|---|
s1=1 | Turn switch 1 on |
s1=0 | Turn switch 1 off |
s2=1 | Turn switch 2 on |
s2=0 | Turn switch 2 off |
s3=1 | Turn switch 3 on |
s3=0 | Turn switch 3 off |
s4=1 | Turn switch 4 on |
s4=0 | Turn switch 4 off |
all=1 | Turn all on |
all=0 | Turn all off |
{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
- Relay boards use relay4 (state keys r1–r4). Both types accept all=1 and all=0.
Default picture
Without v=1 in $ui and a $view, apps use this picture. Its values name the $state keys the picture reads.
{"kind":"relays","keys":["s1","s2","s3","s4"]}
Examples
- iris-basic — example page on arduino.iosignal.net
Type file
iosignal/devices/types/switch4.1.json (rev 2) · CDN
The screen labels in the type file are in Korean; apps show them as written.