Skip to content

Instantly share code, notes, and snippets.

@mpneuried
Forked from frenck/pow.yaml
Created May 11, 2019 18:27
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 mpneuried/04babe949bde512e371b90119b2fcf68 to your computer and use it in GitHub Desktop.
Save mpneuried/04babe949bde512e371b90119b2fcf68 to your computer and use it in GitHub Desktop.
Sonoff POW R2 Washing Machine Sensor Example
esphomeyaml:
name: pow
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
wifi:
ssid: 'Demo'
password: 'Livestream'
# Enable logging
logger:
baud_rate: 0
uart:
rx_pin: RX
baud_rate: 4800
# Enable Home Assistant API
api:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff POW Button"
on_press:
- switch.toggle: fakebutton
- platform: template
name: "Washing Machine Running"
filters:
- delayed_off: 15s
lambda: |-
if (isnan(id(power).state)) {
return {};
} else if (id(power).state > 4) {
// Running
return true;
} else {
// Not running
return false;
}
switch:
- platform: template
name: "Sonoff POW 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: pow_blue_led
pin:
number: GPIO13
inverted: True
light:
- platform: monochromatic
name: "Sonoff POW Blue LED"
output: pow_blue_led
id: led
sensor:
- platform: wifi_signal
name: "Sonoff POW WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Sonoff POW Uptime"
- platform: cse7766
update_interval: 2s
current:
name: "Sonoff POW Current"
voltage:
name: "Sonoff POW Voltage"
power:
name: "Sonoff POW Power"
id: power
on_value_range:
- above: 4.0
then:
- light.turn_on: led
- below: 3.0
then:
- light.turn_off: led
text_sensor:
- platform: version
name: "Sonoff POW ESPHome Version"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment