I’ve used @frenck’s very advanced esp config to get my Sonoff Pow 2.
I have it mostly where I want, there are two minor issues left.
I would like it be turned on when it boots.
I have the blue led to turn on when it uses power, I would rather have it reflect the ‘running’ sensor.
But I can’t get it to be on when it boots, and so far the blue LED indicates if it uses more than 4w.
esphome:
name: dryer
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
on_boot:
then:
- switch.turn_on: relay
wifi:
ssid: "xx"
password: "xxx"
uart:
rx_pin: RX
baud_rate: 4800
logger:
baud_rate: 0
api:
ota:
password: "veryverysecret"
time:
- platform: homeassistant
id: homeassistant_time
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Dryer Button"
on_press:
- switch.toggle: fakebutton
- platform: template
name: "Dryer Running"
filters:
- delayed_off: 120s
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: "Dryer Relay"
optimistic: true
id: fakebutton
turn_on_action:
- switch.turn_on: relay
turn_off_action:
- switch.turn_off: relay
- platform: gpio
id: relay
pin: GPIO12
output:
- platform: esp8266_pwm
id: pow_blue_led
pin:
number: GPIO13
inverted: True
light:
- platform: monochromatic
name: "Dryer Blue LED"
output: pow_blue_led
id: led
sensor:
- platform: wifi_signal
name: "Dryer WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Dryer Uptime"
- platform: cse7766
update_interval: 20s
current:
name: "Dryer Current"
accuracy_decimals: 2
voltage:
name: "Dryer Voltage"
accuracy_decimals: 0
power:
name: "Dryer Power"
accuracy_decimals: 0
id: power
on_value_range:
- above: 4.0
then:
- light.turn_on: led
- below: 3.0
then:
- light.turn_off: led
- platform: total_daily_energy
name: "Dryer daily energy"
power_id: power
filters:
- multiply: 0.001
unit_of_measurement: kWh
text_sensor:
- platform: version
name: "Dryer ESPHome Version"
- platform: wifi_info
ip_address:
name: "Bad Multisensor ip"
ssid:
name: "Bad Multisensor ssid"