Utility_Meter reset on specific day

Hi!

I’m looking for a way to reset my monthly utility-meter on a specific day instead of the 1st day of the month, since my electricity provider doesn’t bill me on the 1st of each month. I’ve been searching for a way to reset the values and then create an automation for it but unfortunately there doesn’t seem to be a concrete solution for this.

Could anyone help me figure this out?

Thank you!

Use the offset option of the utility meter.

1 Like

Or if the day changes month to month (due to weekends or whatever) use this service:

utility_meter.reset

You can call it from a button in the frontend.

I have a similar script that I manually call quarterly when I notice the meter reader captured on my front camera. I use a script because I have to clear two meters and their sum which is stored in an input_number.

1 Like

Unfortunately I can’t find the reset option, and if I set it manually it returns an error saying I there’s no service with that name.

image

This is how I have the utility meter configured on my configuration.yaml

utility_meter:
  monthly_energy:
    source: sensor.shelly_em_total
    cycle: monthly
  daily_energy:
    source: sensor.shelly_em_total
    cycle: daily

whereas shelly is configured as:

- platform: mqtt
  name: "shelly_em_total"
  state_topic: "shellies/shellyem-109730/emeter/0/total"
  qos: 2
  unit_of_measurement: "kWh"
  value_template: "{{ (value | float / 1000 ) | round(1) }}"  
  icon: mdi:gauge

Hmm,that’s strange. Did you try if it appears after a restart?

I’ve add the utility meter for more than a month now. I’ve done a lot for restarts meanwhile, however I just did another one just to make sure…aaaand nothing…calibrate is still the only option available.

I’m getting out of ideas soon. You could try commenting out the utility_meter sections, restart, uncomment them again and restart.

Yeah very odd:

ute_serv

Edit: Ah! Thought I remembered something abut needing to define a tariff to be able to use these services:

1 Like

Yes! Adding tariffs did the trick :slight_smile:

image

Thanks a lot!

Now I can also play with offset to make my second part of the question work.

1 Like

Could you please show your utility meter yaml file? i added tariffs but still cant see the “utility_meter.reset” service

I have a similar issue to the OP. My electric meter isn’t read on the same day every month. Same thing for the water meter, come to think of it. I can’t imagine I’m the only one.

My first thought was to set the cycle to yearly and do this:

This should work for every cycle except January. If I understand it correctly, the utility_meter will reset at midnight on new year’s eve. So when the meter is read later that month, it won’t show the full total since the last time I manually reset it (using the service.)

Is there be a cycle “never” or “manual” option? Am I missing something obvious?

No you are not. January would indeed be a problem.

I just went an checked how I got around this.

I use a daily Utility Meter cycle and an automation triggered just before midnight that adds the total for the day to an input number. My reset script sets this input number to zero.

1 Like

Thanks for the quick reply!!

I already use history_stats to sum up my daily usage. I was thinking of using that as the source in a utility_meter, but it looks like the better solution would be to copy the history_stats value to an input number daily, and skip the utility meter altogether.

Documentation is actually wrong… you don’t need to set a cycle (it’s Optinal) therefore without a cycle it will never reset

I’m new to this. set up meters for a lot of fo devices, daily, monthly and quarterly.

I set an offset for monthly as days: 11

expected the value to reset to zero. It did not. Tried 10 also, restarted. Nothing
Only reset if I called the service reset.

Where am I going wrong?

e.g.

  living_light_monthly_energy:
    source: sensor.living_light_energy
    cycle: monthly
    tariffs:
      - peak
      - offpeak 
    offset:
     days: 10  

Update: some of them did reset - a couple didn’t must be an error in my coding. Have to revise them.

But the offset is correct, it should reset on its own on the 11th if the offset is 10?

I am being billed different days of the month also so I guess I’ll need to use the reset service call.

I assume I need to reset it on the day or can I specify a previous day in the service call?

On the day. The service call accepts no parameters other than an entity_id: Utility Meter - Home Assistant