From aryxs3m, 4 Months ago, written in Plain Text.
Embed
  1. binary_sensor:
  2.   - platform: gpio
  3.     pin: GPIO0
  4.     name: "Push button"
  5.     id: btn_push
  6.     on_press:
  7.       then:
  8.         - switch.toggle: "sw_relay"
  9.  
  10. switch:
  11.   - platform: gpio
  12.     pin: GPIO5
  13.     name: "Relay"
  14.     id: "sw_relay"
  15.