binary_sensor: - platform: gpio pin: number: GPIO0 mode: INPUT_PULLUP inverted: True name: "Nome do dispositivo (quando pressiona o botão físico)" on_press: - switch.toggle: relay switch: - platform: gpio name: "Nome do dispositivo (switch)" pin: GPIO12 id: relay status_led: pin: number: GPIO13 inverted: yes