Utility Meter - Am I missing something

I am trying to set up the utility_meter integration with two tariffs. The problem is that even when one of the tariffs is selected, the sensors for both tariffs get updated.

I am getting the source energy reading from a Shelly 1/PM which measures kW minutes. So I have created the sensor as follows to get kWh’s:-

platform: mqtt
state_topic: "shellies/shelly1pm-E6468B/relay/0/energy"
name: "Shower Room Heater Energy"
unit_of_measurement: "kWh"
value_template: "{{ (value | float * 0.000017) | round(2) }}"
force_update: true

I then set up the utility_meter sensor’s as follows:-

  source: sensor.shower_room_heater_energy
  cycle: monthly
    - Creuse
    - Pleine

This then gives me 2 sensors:

  • sensor.shower_room_heater_monthly_energy_pleine
  • sensor.shower_room_heater_monthly_energy_creuse

I the have a Node Red flow that changes between the pleine and creuse tariff using the select_tariff service. This seems to be working as the sensors are showing a status of ‘paused’ for the creuse sensor and ‘collecting’ for the pleine sensor.

However, both the pleine and the creuse sensor’s show the same value and when I turn the heater that is being monitored on they both increment at the same rate. I was expecting only the sensor for the currently active tariff would be affected.

Any ideas please?

That was a typo, I’m sure you meant W minutes otherwise your sensor template is off by a factor of 1000 :slight_smile:

Your Utility meter is specified correctly but…

that mqtt sensor wont work with the Utility meter. As soon as you stop drawing power for a minute the W min reading drops to 0.

You want the total power counter that can be accessed via a restful sensor, not mqtt.

See: https://shelly-api-docs.shelly.cloud/#shelly1-1pm-status

You can adapt the RESTful sensor I posted here: Configuring Shelly EM Energy Meter to this:

- platform: rest
  name: Shower Room Heater Energy
  resource: http://ip_address/status # inset your Shelly ip address
  username: !secret shelly_usr # delete if you dont use a user name and password
  password: !secret shelly_pwd # delete if you dont use a user name and password
  authentication: basic # delete if you dont use a user name and password
  value_template: '{{ value_json.meters.total | float /1000 }}' # gets value and converts Wh ro kWh
  scan_interval: 300 # My Shelly EM only updates this value every 5 minutes. Check yours and make it faster if you can.
  unit_of_measurement: kWh

I’m not 100% positive that value template is correct. If it does not work post the info that appears on your [shelly_ip_address]/status page and I’ll help you work it out.

Also be aware that your total energy meter resets to zero if power is lost. This does not happen with the Shelly EM.

Hi Tom,

Thanks for your reply. I used your method and the figures obtained were exactly the same as the ones I got which is not a problem.

The issue I had was that the tariff sensors were both being updated at the same time. However, after several reboots that now seems to have fixed itself. The heater is on and only the ‘Pleine’ sensor is being updated.

I do not know what fixed it but hopefully it will stay fixed.

Ok the Shelly PM must operate differently to the EM then.


One question:
You pay 0.000017 €/kWh?
where you live that you can buy energy that cheap?
Or am I miss something?

EDIT sorry for to fast reading/answer :grinning::
Your sensor is kW NOT kWh

Still cheap but not thaaaat much :grinning:



I had this same issue, my utility_meter updated both tariffs. What is strange is that I have monthly and daily meters and the daily one worked ok, but not the monthly. After restart all is good. I checked in debug and it was updated even though status was status: paused. I have Home Assistant 2021.10.7 installed by IOTstack. Anybody else had this issue?

Best regards