Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
substitutions:
devicename: nome_do_nodo
ss_id: "Nome da Wifi"
pass: "Senha da Wifi"
switch4: "Nome switch4"
light_1: "Nome Luz1"
light_2: "Nome Luz2"
light_3: "Nome Luz3"
esphome:
name: ${devicename}
platform: ESP8266
board: esp01_1m
wifi:
ssid: ${ss_id}
password: ${pass}
fast_connect: true
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
########## Switch One################
- platform: gpio
id: switchone
filters:
- delayed_on: 80ms
pin:
number: 12
mode: INPUT_PULLUP
inverted: true
on_state:
then:
- light.toggle: light1
########## Switch 2 #############
- platform: gpio
id: switchotwo
filters:
- delayed_on: 80ms
pin:
number: 13
mode: INPUT_PULLUP
inverted: true
on_state:
then:
- light.toggle: light2
############ Switch 3 ################
- platform: gpio
id: switchthree
filters:
- delayed_on: 80ms
pin:
number: 14
mode: INPUT_PULLUP
inverted: true
on_state:
then:
- light.toggle: light3
############ Switch 4 ################
- platform: gpio
id: switchfour
filters:
- delayed_on: 80ms
pin:
number: 16
inverted: true
name: ${switch4}
############### Outputs ###############
output:
- platform: gpio
pin:
number: 5
id: relay1
- platform: gpio
pin:
number: 4
id: relay2
- platform: gpio
pin:
number: 15
id: relay3
############### Relays #####################
light:
- platform: binary
output: relay1
name: ${light_1}
id: light1
- platform: binary
output: relay2
name: ${light_2}
id: light2
- platform: binary
output: relay3
name: ${light_3}
id: light3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment