Sonoff POWR3

Hello Everybody,
I bought a sonoff POWR3 a few days ago, and I add it to my HA system.
On my system I have a button to switch on/off my sonoff but I haven’t informations about power and current.
When I’m going to the dev tools I have informations about the power and current.
Is there anyway to show up these informations?
Thanks you for you help.

You will need to create template sensors

I’ve already created a template but it doesn’t work.

  • platform: template
    sensors:
    today_power:
    friendly_name: XXXXX
    unit_of_measurement: kW
    value_template: “{{ state_attr(‘switch.XXXX’, ‘power’) }}”

Difficult to say that way :

And did you reload templates, or restart HA ?

I reloaded HA but I don’t have power/curent consumption.

How did you add it to HA?

For my Sonoff POW R3 (that’s the big 25 amp unit) I added a template like this:

State template:
{{ state_attr('switch.XXX', 'power').replace(" W", "") }}

Unit: W (capital)

Device class: Power

State class: Measurement

To get the value for “XXX” above, first I had to add the eWeLink add-on to Home Assistant. Then I had to login to the assistant which let me see my device on the local network. Then I was able to find their entity ID from the switch that was added.

My YAML varies slightly from the previous suggestion as I have to remove the trailing “ W” from the value to get the numerical wattage. It also doesn’t appear to update very regularly, perhaps only a couple of times per day.