Skip to content

Instantly share code, notes, and snippets.

@bbbenji
Last active September 22, 2021 20:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbbenji/62a0b7978603844f1881a0893ebbdc6c to your computer and use it in GitHub Desktop.
Save bbbenji/62a0b7978603844f1881a0893ebbdc6c to your computer and use it in GitHub Desktop.
# GPIO0
# GPIO1
# GPIO2
# GPIO3 Button middle
# GPIO4 Button left
# GPIO5 Button right
# GPIO12 Relay/LED red left
# GPIO13 LED green (all)
# GPIO14 Relay/LED red middle
# GPIO15 Relay/LED red Right
# GPIO16
esphome:
name: switch_01
platform: ESP8266
board: esp01_1m
<<: !include .common.yaml
# Status LED
status_led:
pin:
number: GPIO13
inverted: false
# Buttons
binary_sensor:
- platform: gpio
pin:
number: GPIO4
mode: INPUT_PULLUP
inverted: true
name: "switch_01 Button Left"
on_press:
- switch.toggle: relay_1
- platform: gpio
pin:
number: GPIO3
mode: INPUT_PULLUP
inverted: true
name: "switch_01 Button Middle"
on_press:
- switch.toggle: relay_2
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
inverted: true
name: "switch_01 Button Right"
on_press:
- switch.toggle: relay_3
# Relays
switch:
- platform: gpio
name: "switch_01 Relay Left"
pin: GPIO12
id: relay_1
- platform: gpio
name: "switch_01 Relay Middle"
pin: GPIO14
id: relay_2
- platform: gpio
name: "switch_01 Relay Right"
pin: GPIO15
id: relay_3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment