Created
January 22, 2019 22:35
-
-
Save frenck/1b4f0ea98f1f6d86d597c2d9636636db to your computer and use it in GitHub Desktop.
Sonoff POW R2 Washing Machine Sensor Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Hello.
Please how can I reprogram SONOFF POW R2 to run using ESPHome ?
Go on esphome.io, they explain quite well how to reprogram it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use utility_meter inside ESPHome or in Home Assistant. That's what I do.