Utility Meter power graph

Hi, I have my AC connected to Sonoff POW R2 and I am getting reading in HA in W which is currently using and I need to know how much power it uses for a week/month.
So I added Utility Meter to my .yaml

utility_meter:
  energy:
    source: sensor.sonoff_power
    cycle: weekly

The reading seems weird, it adds 2.5kW every time it turns on,
sdfa132afds
Here is the real power graph below.
sta%C5%BEen%C3%BD%20soubor
Can anyone help ?

1 Like

It looks like your sensor is reporting in real time kW, while the utility sensor needs to use kWh. Check out the Integration Sensor component.

If you feed the sensor.sonoff_power into the Integration Sensor on an hourly basis, it’ll output kWh which you can then use in the Utility Meter component.

1 Like

Yeah, So I tried to find it.

sensor:
  - platform: integration
    source: sensor.current_power
    name: energy_spent
    unit_prefix: k
    round: 2

I added it, and I will wait to see if it works.

So if I want to have more sources or more info like consumption for a week and month, I just use Integration Sensor and set it for week and day, because Utility Meter cant be used separately for more sources.

There is still some problem I did not find out. The real consumption during the night was 5.5kWh but it says 15.9kWh. I did something wrong with the code.

Why didn’t I think of that… I’ve been trying to find out why my HASS utility meter is saying that I am using almost 1 MW!

You can use multiple Utility Meter sensors with the same input source, you don’t need to change the Integration Sensor for day/week/monthly as long as it’s hourly in kWh.

For example here is mine which appears to be working and pretty near what my meter is reporting (I think…). The sensor.house_consumption is the sensor reporting real time kW that I first integrate, then feed it into the various Utility Meter sensors.

sensor:
  - platform: integration
    source: sensor.house_consumption
    name: energy_consumed

and then for the Utility Meter portion - Mine is a bit more complicated example as I have 3 TOU tariffs that I want to capture the quantities of to calculate the $$ for each.

utility_meter:
  daily_house:
    source: sensor.energy_consumed
    cycle: daily
    tariffs:
      - superoffpeak
      - offpeak
      - peak
      
  weekly_house:
    source: sensor.energy_consumed
    cycle: weekly
    tariffs:
      - superoffpeak
      - offpeak
      - peak
    
  hourly_house:
    source: sensor.energy_consumed
    cycle: hourly
    tariffs:
      - superoffpeak
      - offpeak
      - peak

I had the same config, but my meter gives me the kW as real power. That was why I got weird reading.
I need to convert kW to kWh but everything I found shows at least 3 times more.