Skip to content

Instantly share code, notes, and snippets.

@frenck
Created January 22, 2019 22:49
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save frenck/0d22937041f8236bf5d4e09518d8f7fe to your computer and use it in GitHub Desktop.
Save frenck/0d22937041f8236bf5d4e09518d8f7fe to your computer and use it in GitHub Desktop.
Sonoff Basic ESPHome
esphomeyaml:
name: basic
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
wifi:
ssid: 'Demo'
password: 'Livestream'
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff Basic Button"
on_press:
- switch.toggle: fakebutton
switch:
- platform: template
name: "Sonoff Basic Relay"
optimistic: true
id: fakebutton
turn_on_action:
- switch.turn_on: relay
- light.turn_on: led
turn_off_action:
- switch.turn_off: relay
- light.turn_off: led
- platform: gpio
id: relay
pin: GPIO12
output:
- platform: esp8266_pwm
id: basic_green_led
pin:
number: GPIO13
inverted: True
light:
- platform: monochromatic
name: "Sonoff Basic Green LED"
output: basic_green_led
id: led
sensor:
- platform: wifi_signal
name: "Sonoff Basic WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Sonoff Basic Uptime"
text_sensor:
- platform: version
name: "Sonoff Basic ESPHome Version"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment