Skip to content

Instantly share code, notes, and snippets.

@dattas
Created March 19, 2019 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dattas/1549af84e273cdf673d750fb46607694 to your computer and use it in GitHub Desktop.
Save dattas/1549af84e273cdf673d750fb46607694 to your computer and use it in GitHub Desktop.
esphome:
name: $devicename
platform: ESP8266
board: esp01_1m
wifi: !include wifi.yaml
# Enable logging
logger:
# Enable Home Assistant API
api:
password: $api_password
ota:
password: $api_password
binary_sensor:
- platform: gpio
id: btn_relay
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
filters:
- delayed_on: 100ms
- delayed_off: 100ms
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: $devicename_nice
pin: GPIO12
id: relay
on_turn_on:
then:
- light.turn_on: led
on_turn_off:
then:
- light.turn_off: led
light:
- platform: monochromatic
output: basic_led
id: led
output:
- platform: esp8266_pwm
id: basic_led
pin:
number: GPIO13
inverted: True
status_led:
pin:
number: GPIO13
inverted: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment