Skip to main content

RGB light rgb-light.1

A color light with on/off, brightness and color.

← Device types

Use​

For one color light, such as an RGB LED or a WS2812 strip. To control LEDs one by one, see the iris types.

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 RGB light:Living room
@$ui t=rgb-light.1
@$state on=1;level=0;color=#ff8800

State keys @$state​

KeyValuesMeaning
on0 / 11 when on, 0 when off
level0–100%Brightness 0–100 (%)
color#rrggbbColor #rrggbb (lowercase hex)

Commands <cid>@​

CommandMeaning
onTurn on
offTurn off
level={v}Set brightness to {v}%
color={v}Set color to #rrggbb

{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​

  • color is # followed by six hex digits. Send the state in the same format so the color picker shows the current color.

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","level":"level","color":"color"}

Examples​

No Arduino example uses this type yet.

Type file​

iosignal/devices/types/rgb-light.1.json (rev 2) · CDN

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