Changing a Utility Meter cycling period

Hi.

I have created several utility meters using the Helper tab in HA UI, I initially set them to cycle monthly. How do I change the cycling period of some of those WITHOUT the need to delete the utility meter and set it up from scratch.

Choosing the UTILITY METER OPTIONS in the Utility Meter settings doesn’t show the entire setup configuration of that utility meter and as a result I cannot change its cycling period.

I am attaching a small mp4 to make it clear

I also can’t find a yaml editable input to manually change this.

here is the setup parameters when creating the utility meter for the first time.

Unfortunately, I can’t find a way to edit those parameters again after creating the utility meter.

Also interested.

Yes, you need to create a new one.

While this won’t help with your existing Utility Meters, This new Custom Integration provides numerous new capabilities for Utility Meters, including being able to change the cycling period.
I might look into adding a new feature to migrate the basic Utility Meter to this new version.

It is possible to edit a utility meter set up within the GUI, *BUT it is not for the faint hearted.

If in File Editor or VSC Code you go to:

\YourHA_ipaddress\config.storage\core.config_entries

you will find a file with all the data. That is a double \ at the start of the address - this formatting knocks off the first backstroke.

A recent update to HA made this harder to decipher but you will find each entry starts with a new number in VSC Code.

For example, this is a GUI Utility Meter to measure energy use by my coffee machine:

{"created_at":"1970-01-01T00:00:00+00:00","data":{},"disabled_by":null,"discovery_keys":{},"domain":"utility_meter","entry_id":"bb0b23e1c2db91e9be4c8dbca982278","minor_version":2,"modified_at":"2025-08-07T01:55:26.985603+00:00","options":{"always_available":false,"cycle":"weekly","delta_values":false,"name":"Coffee MAchine A Weekly Energy","net_consumption":false,"offset":0.0,"periodically_resetting":true,"source":"sensor.coffee_machine_energy","tariffs":[]},"pref_disable_new_entities":false,"pref_disable_polling":false,"source":"user","subentries":[],"title":"Coffee Machine Weekly Energy","unique_id":null,"version":2},

Use with caution - and maybe set up a test meter first.

@cabberley Hi Chris,

I’m used to manually defining utility_meter(s) and groups in yaml to end up with a set of meters that are tracking the peak / shoulder / off-peak consumption (and if using energy_meter and a sensor for import / fit prices, then the $ also).

Trying to work out if and HOW to do this with your integration, any examples available ? Your readme refers to tariff periods etc, but I can’t see any where to do this. There is the box to enter tariff names, but not too sure how to setup the"

Peak = 7am - 9am and 5pm - 8pm (Mon-Fri)
Shoulder = 9am - 5pm and 10pm - 10pm (Mon-Fri)
Off-Peak = All other times / All Day Weekends

Thanks.

I use an automation that triggers based on the times when the tariffs change.
With each utility meter there is a select option to set which of the tariffs to track the usage and/or cost against. I labels/named each trigger then when the item time occurs the action changes the select for each meter. To save time I also group various meters I have so I don’t have to add them individually to the automation.

Blockquote


If you have a tariff for Peak / Off-Peak / Shoulder, does adding another called ‘Total’ (is it case sensitive?) then automatically see that total sensor tracking the costs/$ (from a supplied price sensor), no matter the tariff period choosen in the selector ?

i.e.
Peak = $1
Shoulder = $1
Off-Peak = $1
Total = $3

Thanks @cabberley

Didn’t think you’d reply so fast, so was looking at old code and realised an automation was needed. If anyone else wants an example for a tariff plan with:

Peak - Monday to Friday during 7am - 9am and 5pm - 8pm
Shoulder - Monday to Friday during 9am - 5pm and 8pm - 10pm
Off-Peak - All other times

alias: Energy Consumption Meter - Set Electricity Tariff
description: Set Electricity Tariff depending upon the day of week and time
triggers:
  - trigger: homeassistant
    event: start
  - trigger: time
    at:
      - "07:00:10"
      - "09:00:10"
      - "17:00:10"
      - "20:00:10"
      - "22:00:10"
conditions: []
actions:
  - choose:
      - conditions:
          - condition: time
            weekday:
              - mon
              - tue
              - wed
              - thu
              - fri
          - condition: template
            value_template: "{{ (7 <= now().hour < 9) or (17 <= now().hour < 20) }}"
        sequence:
          - action: select.select_option
            target:
              entity_id: select.energy_consumption
            data:
              option: Peak
        alias: PEAK - If Monday to Friday and 7-9am or 5-8pm
      - conditions:
          - condition: time
            weekday:
              - mon
              - tue
              - wed
              - thu
              - fri
          - condition: template
            value_template: "{{ (9 <= now().hour < 17) or (20 <= now().hour < 22) }}"
        sequence:
          - action: select.select_option
            target:
              entity_id: select.energy_consumption
            data:
              option: Shoulder
        alias: Shoulder - If Monday to Friday and  9am - 5pm or 8 - 10pm
    default:
      - action: select.select_option
        target:
          entity_id: select.energy_consumption
        data:
          option: Off-Peak
        alias: Off-Peak - All other times
mode: single

This is based on the Next Gen meter being called ‘Energy Consumption’ (giving you an entity select.energy_consumption that has the aforementioned tariff rates defined in it) and if you then select the option for ‘Create Multiple Predefined reset cycle meters’ and then select the Daily / Weekly / Monthly / Yearly etc options, you’ll end up with meters called ‘Energy Consumption Daily Peak’ / ‘Energy Consumption Weekly Shoulder’ etc.

If you need a sensor showing the current price to import or FIT, here’s an example.

# Based upon Australian energy retailer 'Red Energy' and their Time of Use Tariff Plan.
# v1.0 - Updated 1 July 2023 for new Red Energy Rates
# v1.1 - Updated 1 October 2023 for new Red Energy Rates
# v2.0 - Updated 4 January 2024 to replace static FIT rate with a sensor that allows for use with variable FIT providers

template:
  - sensor:

#########################
#  Electricity_Price provides a method to allow selecting the 'Use an entity with current rate' in Energy Dashboard.
#
#  This tariff plan is based upon a Time of Use (ToU) plan with different charges at the following times:
#
#  Peak      : $0.41745 p/kWh. Monday to Friday between 7am - 9am and 5pm - 8pm.
#  Shoulder  : $0.35695 p/kWh. Monday to Friday between 9am - 5pm and 8pm - 10pm.
#  Off-Peak  : $0.26928 p/kWh. Monday to Friday between 10pm and 7am. Saturday and Sunday - All Day.
#
#  Note: If you energy provider plan has different times, you must update them here AND also in the Automation (that updates the Selector) at the bottom.
#

    - name: "Electricity - Price" 
      unique_id: electricity_price
      unit_of_measurement: "$/kWh"
      device_class: monetary
      state:  "
        {%set Peak = 0.41745 %}
        {%set WeekdayShoulder = 0.33495 %}
        {%set OffPeak = 0.26928 %}
        {%set H = as_timestamp(now())|timestamp_custom ('%-H')|float(0) %} {##Hour (24-hour clock) as a decimal number. 0, 1, 2, ... 23##}
        {%set w = as_timestamp(now())|timestamp_custom ('%w')|float(0) %} {##HWeekday as a decimal number, where 0 is Sunday and 6 is Saturday.	0, 1, …, 6##}	 
        {##0 for weekday, 1 for weekend##}
        {% if (w == 0) or  (w == 6) %} {% set weekday = 0 %}
        {% else %} {% set weekday = 1 %}
        {% endif %}
        {% set charge = 0 %}
        {##peak##}
        {% if (weekday == 1) and (H >= 7) and (H < 9) %} {{Peak}}
        {% elif (weekday == 1) and (H >= 17) and (H < 20) %} {{Peak}}
        {##weekday shoulder##}
        {% elif (weekday == 1) and (H >= 9) and (H < 17) %} {{WeekdayShoulder}}
        {% elif (weekday == 1) and (H >= 20) and (H < 22) %} {{WeekdayShoulder}}
        {##off peak##}
        {% else %} {{OffPeak}}
        {% endif %}
        "

#########################
#  This sensor publishes the currently active tariff rate
#  to be used in dashboard cards to show what rate is active.
#

    - name: "Electricity - Active Tariff"
      unique_id: electricity_active_tariff
      state: >
        {% set H = now().hour %}
        {% set weekday = now().weekday() < 5 %}
        {% if weekday and ((H >= 7 and H < 9) or (H >= 17 and H < 20)) %}
          Peak Tariff
        {% elif weekday and ((H >= 9 and H < 17) or (H >= 20 and H < 22)) %}
          Shoulder Tariff
        {% else %}
          Off-Peak Tariff
        {% endif %}


#########################
#
#  Current Feed in Tariff (FIT) / Export rate, rate 1 & 2 allows setting a second rate if variable FIT rates (i.e. $0.15 for first 10kWh, then $0.07 thereafter)
#
    - name: "Electricity - FIT"
      unique_id: electricity_fit
      unit_of_measurement: "$/kWh"
      device_class: monetary
      icon: mdi:cash-plus
      state: >
        {## Enter compensation per kWh rates below ##}
        {% set rate1 = 0.04 %}
        {% set rate2 = 0.04 %}
        {% set fit_exported_today = states('sensor.sigen_plant_daily_grid_export_energy') | float %}
        {% if fit_exported_today <= 10 %} {{rate1}}
        {% else %} {{rate2}}
        {% endif %}
1 Like

How / is there anyway to multiple meters, such as the monthly or quarterly, is there a way to have an offset to the ‘rollover date’ ?

i.e. Quarterly gas bill, reading on the 11th day of November (not the 1st) or Monthly electricity bill that rollsover on the 8th of the month etc.

Thanks.