Skip to content

Shell script for controlling a Sonoff switch

Notifications You must be signed in to change notification settings

psqli/sonoff.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

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"