This is my first post ever, I’ve been here for a long time, but just reading. After all this years I’ve learned a lot so I feel like I owe you this contribution, cuz I searched a lot and I found nothing so here you go, a configuration example of the new Sonoff POW Elite or POWR316D for ESPHome.
Hi, first of all, thanks for your contribution. I’m having trouble registering my Sonoff POW Elite, it does not show me the current consumption etc. To where exactly have I upload this configuration?
Awesome! I was waiting for someone to do the hard work of setting up config and getting the libraries for the LCD on these so thanks! Will test it out soon.
Are the readings of your devices correct? For example, with an amperage of 15.5A and a voltage of 230V, the power I get is about 3.05kW when it should be about 3.5kW.
I’m still on ewelink firmware because for some reason i can’t use the serial port without errors
I’ve flashed the sonoff with the custom firmware. I’ve tested the load of some appliances first with a standalone reader first … In my case the readings
of the sonoff are showing the same results as the standalone power monitor.
Thanks for the answer. Could you explain how to flash this sonoff? I’m having problems getting always “unhandled exception” or “invalid head of packet” erros. With the same serial i’m able to flash other sonoff devices and ESP without any problem. My serial adapter have a cp2102 chip, so i don’t think the problem is the serial adapter.
I’ve tried with pair button always pushed, pushed for a while and then released, wituout pushing the button… without succesful
i’ve used esphome flasher. this video helped me in the right direction. ⚡SONOFF POW Elite Tasmota Firmware - YouTube
I guess this video is not in your native language but the enabling the captions might help you.
So I finally got hold of 2 of these switches (for the pool pump and geyser)
Now between this post and the official ESPhome example Sonoff POW Elite 20a (POWR320D) | ESPHome-Devices I got the switch working fine. However I’m not getting any readings on the power sensors (power current voltage energy) all reading “unknown”
I have another sonoff pow2 which shows everything fine and the have supposedly the same cse7766 sensor.
Any idea from anyone?
Here is my config
substitutions:
friendly_name: Pool Pump
device_name: sonoff-pow-elite-pool-pump
esphome:
name: $device_name
esp32:
board: nodemcu-32s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: $device_name
password: !secret wifi_failover
captive_portal:
api:
ota:
logger:
baud_rate: 0
uart:
rx_pin: RX
baud_rate: 4800
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: cse7766
update_interval: 2s
current:
name: $friendly_name Current
id: a_sensor
voltage:
name: $friendly_name Voltage
id: v_sensor
power:
name: $friendly_name Power
id: w_sensor
energy:
name: $friendly_name Energy
id: wh_sensor
- platform: total_daily_energy
name: $friendly_name Total Daily Energy
power_id: w_sensor
- platform: wifi_signal
name: $friendly_name Wifi RSSI
update_interval: 60s
binary_sensor:
- platform: status
name: $friendly_name Status
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
id: button_1
on_press:
then:
- switch.toggle: relay_1
- platform: template # this is a fake sensor to tell the screen which info to show on display
id: page
publish_initial_state: true
internal: true
display:
platform: tm1621
id: tm1621_display
cs_pin: GPIO25
data_pin: GPIO14
read_pin: GPIO26
write_pin: GPIO27
lambda: |-
if (id(page).state) {
it.display_voltage(true);
it.display_kwh(false);
it.printf(0, "%.1f", id(v_sensor).state);
it.printf(1, "%.1f", id(a_sensor).state);
} else {
it.display_voltage(false);
it.display_kwh(true);
it.printf(0, "%.1f", id(wh_sensor).state);
it.printf(1, "%.1f", id(w_sensor).state);
}
output:
- platform: ledc
id: led
pin:
number: GPIO18
inverted: True
switch:
- platform: template
name: $friendly_name
optimistic: true
id: relay_1
lambda: |-
if (isnan(id(w_sensor).state)) {
return {};
} else if (id(w_sensor).state > 4) {
// Running
return true;
} else {
// Not running
return false;
}
turn_off_action:
- switch.turn_on: relay_off
turn_on_action:
- switch.turn_on: relay_on
- platform: gpio
restore_mode: ALWAYS_ON
internal: true
id: relay_off
pin: GPIO04
on_turn_on:
- delay: 500ms
- switch.turn_off: relay_off #bi-stable relay so no need to keep on.
- light.turn_off: switch_led
interlock: [relay_on]
- platform: gpio
restore_mode: ALWAYS_OFF
internal: true
id: relay_on
pin: GPIO02
on_turn_on:
- delay: 500ms
- switch.turn_off: relay_on #bi-stable relay so no need to keep on.
- light.turn_on: switch_led
interlock: [relay_off]
- platform: restart
name: $friendly_name Restart
light:
- platform: monochromatic
id: switch_led
output: led
internal: True
- platform: status_led
id: wifi_status_led
internal: True
pin:
number: GPIO05
inverted: True
interval:
- interval: 30s
then:
if:
condition:
wifi.connected:
then:
- light.turn_on: wifi_status_led
else:
- light.turn_off: wifi_status_led
@fstof I’ve recently posted a problem with the POWR320D and the example you post, with the switch not working, but readings seems to work OK, not solved yet…
Try tasmota to see if all is working fine, i don’t think is a diferent sensor…
Below you have the link to tasmota. You only have to download the tasmota32.bin, upload to POWR320D, reboot, connect to the new SSID go to http://192.168.4.1 config your ssid, and finally choose powr320d template from the list. You can see all values on the web without configure anything of mqtt