Skip to content

Instantly share code, notes, and snippets.

@OttoWinter
Created February 24, 2019 14:03
Show Gist options
  • Save OttoWinter/25d1fccf10e70e083539a591eace1393 to your computer and use it in GitHub Desktop.
Save OttoWinter/25d1fccf10e70e083539a591eace1393 to your computer and use it in GitHub Desktop.
---
# esp06: Yet unused Sonoff POW R2
#
# This ESPHome code is used on a Sonoff POW R2.
# It is used to detect if my Dryer is running.
# It exposes a lot of information, including an
# additional binary sensor. This allows easy
# automations from Home Assistant.
#
esphome:
name: esp06
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: !secret esphome_esp06_static_ip
gateway: !secret wifi_gateway
subnet: !secret wifi_subnet
dns1: !secret wifi_dns1
dns2: !secret wifi_dns2
logger:
# Disable the Serial interface on the POW
# It is used by the power sensor
baud_rate: 0
# Enable UART for the power sensor
uart:
rx_pin: RX
baud_rate: 4800
api:
password: !secret esphome_esp06_api_password
ota:
password: !secret esphome_esp06_ota_password
sensor:
- platform: wifi_signal
name: esphome_esp06_wifi_signal
update_interval: 10s
- platform: uptime
name: esphome_esp06_uptime
- platform: cse7766
update_interval: 5s
current:
name: scullery_dryer_current
voltage:
name: scullery_dryer_voltage
power:
id: power
name: scullery_dryer_power
text_sensor:
- platform: version
name: esphome_esp06_esphome_version
switch:
- platform: restart
name: esphome_esp06_restart
- platform: gpio
id: powerbutton
name: scullery_dryer
pin: GPIO12
on_turn_on:
- light.turn_on: led
on_turn_off:
- light.turn_off: led
binary_sensor:
- platform: gpio
id: button
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: true
on_press:
- switch.toggle: powerbutton
# This binary sensor tells if the Dryer is running or not
- platform: template
name: scullery_dryer_running
filters:
- delayed_off: 15s
lambda: |-
return id(power).state > 75;
output:
- platform: esp8266_pwm
id: blue_led
pin:
number: GPIO13
inverted: true
light:
- platform: monochromatic
output: blue_led
id: led
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment