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:-
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.
- 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.
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.
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?