Skip to content

Single Relay Devices

digiblur edited this page Oct 15, 2019 · 2 revisions

Single Relay Switch (Sonoff Basic, Smart Plugs, Single Button Light Switches, etc)

Copy the below example into configuration.yaml under the light or switch group depending on your use case. You can only have one switch group and one light group in the configuration.

switch:
  - platform: mqtt
    name: "Sonoff Basic 1"
    state_topic: "stat/sonoff/POWER"
    command_topic: "cmnd/sonoff/POWER"
    availability_topic: "tele/sonoff/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"

Use POWER1, POWER2, etc when you are using a switch with more than one relay (if SetOption26 is on you will also use POWER1 even if only one relay exists)