Skip to main content

Light light.1

A light, relay or single LED that only turns on and off.

← Device types

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​

KeyValuesMeaning
on0 / 11 when on, 0 when off

Commands <cid>@​

CommandMeaning
onTurn on
offTurn off
toggleSwitch 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​

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.