Utility_meter configuration - is this correct?

I’m finally getting some utility information setup in HA, and want to make sure my logic is sound. I’m on the most recent (88.1).

The utility_meter is relatively new, and the docs aren’t completely clear. I wasn’t able to find previous posts on the exact setup I’m using.

Here’s my situation:

  • Rainforest Eagle gateway sending instantaneous wattage consumption every few seconds using its Cloud service via py-eagle-mqtt running in a Docker container, which is pulled into an MQTT sensor called “sensor.current_energy_use”. Working fine. Note that I have solar, so these watt values are often negative during the day.

  • Added an Integration Sensor to take the instantaneous readings and generate running kWH:

  • platform: integration
    source: sensor.current_energy_use
    name: energy_kwh
    unit_prefix: k
    round: 2
  • Added a few utility_meter entries, using the Integration sensor value (sensor.energy_kwh):

utility_meter:
daily_energy_used:
source: sensor.energy_kwh
cycle: daily
tariffs:
- normal
weekly_energy_used:
source: sensor.energy_kwh
cycle: weekly
tariffs:
- normal
monthly_energy_used:
source: sensor.energy_kwh
cycle: monthly
tariffs:
- normal

Is this the correct setup for the utility_meter? Tracking the Integration sensor vs instantaneous?

Also, do the daily, weekly, monthly values automatically reset? When do the weekly values reset (on Sunday?)

Finally, I see there was a recent commit to enable net consumption on the utility_meter which I may test out, since this time of year our net daily usage is typically a negative kWH (we’re generating more than we’re using) and that’s not what the utility_meter sensors are showing currently.

Thanks in advance!

Yes! energy is measured in kWh (what you get when you integrate W - your instantaneous reads)

It’s there on the documentation: Utility Meter - Home Assistant you can change this too using offset

Good! any issue just use Sign in to GitHub · GitHub

Thanks! I was pretty sure I was on the right track, but wanted to confirm (as well as allow others to search…).

Also thanks for these components, very useful to those of us with solar who want to track our usage.

I’ll upgrade to 88.2 (on 88.1 now) and pull down the component files you changed with the commit.
Looking at the code, it appears I’ll need to add “net_consumption: true” to enable the net consumption feature.

You can also try the new beta 0.89b0

As for the net_consumption, can’t take the credit, that was an addition by Justin Bassett

Hi Gents
How is the net_consumption driven, I have two seperate sensors for exporting and importing
Can I have two seperate sources in the utility meter integration one driving in a positive direction and the other in a negative.
Thanks

Sorry you cannot… you can create a template sensor that sums the 2

Ok Great thank you

Thanks very much for this, this put on on the right track to feed Watts into the Utility Meter using the ‘integration’ integration. Not sure I would have come up with this on my own. cheers.