binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "X11 Button"
on_press:
- switch.toggle: relay
- platform: status
name: "X11 Status"
sensor:
- platform: wifi_signal
name: "X11 WiFi Signal"
update_interval: 300s
switch:
- platform: gpio
id: red_led
pin:
number: GPIO16
inverted: true
- platform: gpio
id: blue_led
pin:
number: GPIO13
inverted: true
- platform: gpio
name: "X11 Relay"
pin: GPIO14
id: "relay"
# Turn off red LED to show blue when turned on
on_turn_on:
- switch.turn_off: red_led
- switch.turn_on: blue_led
# Turns on the red LED once the plug is turned off. Stock plug doesn't do this, to restore normal behavior remove the on_turn_on and on_turn_off
# blocks.
on_turn_off:
- switch.turn_on: red_led
- switch.turn_off: blue_led
- platform: restart
name: "X11 Restart"
暂无评论