Skip to main content

2 switches switch2.1

Two switches.

← Device types

Use​

For devices with two outputs, or for a two-switch state that several boards share.

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 2 switches:Living room
@$ui t=switch2.1
@$state s1=1;s2=1

State keys @$state​

KeyValuesMeaning
s10 / 1Switch 1: 1 when on
s20 / 1Switch 2

Commands <cid>@​

CommandMeaning
s1=1Turn switch 1 on
s1=0Turn switch 1 off
s2=1Turn switch 2 on
s2=0Turn switch 2 off
all=1Turn all on
all=0Turn 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​

  • all=1 and all=0 are rule commands that every device with channel keys accepts. Send the state once after handling them.

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"]}

Examples​

Type file​

iosignal/devices/types/switch2.1.json (rev 2) · CDN

The screen labels in the type file are in Korean; apps show them as written.