/sonoff.sh

Shell script for controlling a Sonoff switch

Primary LanguageShell

sonoff.sh

Control Sonoff single channel switches and bulbs using the DIY mode.

Supported devices: BASICR3, RFR3, MINIR2, B02-BL, B05-BL.

Sonoff API documentation is available here.

Examples

Toggle switch:

./sonoff.sh 192.168.0.123 switch toggle

Get info about switch:

./sonoff.sh 192.168.0.123 info

Set bulb brightness to maximum, and set color to white:

./sonoff.sh 192.168.0.123 brgb 100 255 255 255

The same, but for white (warm/cold) bulbs:

./sonoff.sh 192.168.0.123 bwht 100 100

Set Wi-Fi network:

./sonoff.sh 192.168.0.123 wifi "Name" "p@ssword"