Fan fan.1
A fan with on/off, speed 1–10 and swing.
Use
For devices that control motor speed and swing.
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 Fan:Living room
@$ui t=fan.1
@$state on=1;speed=1;swing=1
State keys @$state
| Key | Values | Meaning |
|---|---|---|
on | 0 / 1 | 1 when on, 0 when off |
speed | 1–10 | Speed 1–10 |
swing | 0 / 1 | 1 while swinging, 0 when fixed |
Commands <cid>@
| Command | Meaning |
|---|---|
on | Turn on |
off | Turn off |
speed={v} | Set speed to {v} |
swing=1 | Start swing |
swing=0 | Stop swing |
{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
- Keep speed and swing while off and use them when turning on, so the app screen matches.
Default picture
Without v=1 in $ui and a $view, apps use this picture. Its values name the $state keys the picture reads.
{"kind":"fan","on":"on","speed":"speed"}
Examples
No Arduino example uses this type yet.
Type file
iosignal/devices/types/fan.1.json (rev 3) · CDN
The screen labels in the type file are in Korean; apps show them as written.