Sonoff Basic Expansion Mod - Buttons, PIR Motion Sensors, Tasmota Rules and more!

The Sonoff Hydra-Basic with two capacitive touch buttons and a PIR motion sensor.  Break into the powerful Rules of the Tasmota firmware and control more than one light/function with a Sonoff Basic.

Parts List:
Sonoff Basic
USB FTDI Adapter(Sonoff Flashing)
Male Headers
AM312 PIR Sensor
Capacitive Touch Button
Jumper Wires
Fuses (optional but recommended)

DrZzs video on step by step how to flash a Sonoff -

Tasmota Rules Commands Used:

backlog switchmode1 3;switchmode2 1;switchmode3 1

rule1 on switch2#state=1 do publish cmnd/S20Beta/POWER TOGGLE endon
rule1 on

rule2 on switch3#state=1 do publish HydraBasic/PIR/state YES endon on switch3#state=0 do publish HydraBasic/PIR/state NO endon
rule2 on

rule3 on switch3#state=1 do publish cmnd/TuyaDimTest/Dimmer 75 endon on switch3#state=0 do publish cmnd/TuyaDimTest/Dimmer 25 endon
rule3 on

HomeAssistant Binary Sensor Config YAML

- platform: mqtt
    name: "HydraBasic Motion"
    state_topic: "HydraBasic/PIR/state"
    availability_topic: "tele/HydraBasic/LWT"
    qos: 1
    payload_on: "YES"
    payload_off: "NO"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: false
    device_class: motion

GitHub Link with all the rules and sample HomeAssistant Config -

The Sonoff Basic is mains powered device!  There is a danger of electrocution if not installed properly. If you don't know how to install a Sonoff, please call an electrician.


Popular posts from this blog

Smart Laundry Notifications with a Sonoff S31 & Home Assistant

Part 1 - How to Expand Tasmota/Sonoff Devices with the I2C Protocol - I²C

Finally! A Tasmota WiFi Dimmer Smart Switch