Utility Meter not updating (solved)

Hi,

I’m trying to setup a utility meter to measure electrical energy consumption. I have a sensor that delivers the current power consumption via MQTT:

- platform: mqtt
  name: power_meter
  state_topic: "home/current_power"
  unit_of_measurement: "W"

Then I use an integration sensor to calculate the energy consumption:

- platform: integration
  source: sensor.power_meter

The resulting entity “sensor.power_meter_integral” is then passed to the utility meter:

utility_meter:
  electrical_energy:
    source: sensor.power_meter_integral
    cycle: daily

Although the sensor itself and the integration sensor are being updated, the utility meter stays at “0”. Is there anything missing or wrong in the config? The log file does not show any warnings or errors.

Thanks for any help!

I don’t understand where this is coming from and where it’s located in your config.
I can’t find any component called utility_meter?

It’s a Home Assistant component:
https://www.home-assistant.io/components/utility_meter/

got it, was expecting a blue icon :man_facepalming:
Stupid question have you tried to start with a dash (-) like the other components?
Also you’ve not saved it under sensors have you?

scrap that, I think it’s because it’s looking for sensor.power_meter_integral when you name your sensor sensor.power_meter
try this and see if it works:

utility_meter:
  electrical_energy:
    source: sensor.power_meter
    cycle: daily

Thanks for that hint - actually it was something different but similar:

Using the sensor “sensor.power_meter” in the integration component creates a sensor called “sensor.sensor_power_meter_integral”. But I referenced “sensor.power_meter_integral” instead. That was the issue.

Thanks for pointing me in the right direction!

1 Like