Hi,
I've created a template that is supposed to collect what I'm paying for electricity with an hourly rate. I've got a sensor to give me the hourly price, this updates every fifth minute. The trouble is that I'm getting very weird values from this sensor. I suppose it has to do with the update interval, and that I am counting wrong somewhere, but not sure how.
- platform: template
sensors:
total_energy_cost_moving_rate:
friendly_name: "Total Energy Cost Moving Rate"
unit_of_measurement: "SEK"
value_template: >
{% set usage = states('sensor.frient_utility_meter_test') | float %}
{% set moving_cost = states('sensor.nordpool_kwh_se3_sek_3_10_025') | float %}
{% set cost = usage * moving_cost %}
{{ cost | round(2) }}
The sole purpose with this sensor is to add it to a utility meter, so that I can calculate the daily cost from it.
See the image for output of a utility meter with this sensor as input. I would expect the value to be somewhere around 30 SEK.
I've also got an almost exact copy of this sensor, but with a set rate, as comparison. This works as expected, so the problem lies somewhere within the nordpool sensor reading. I've also attached an image of that sensors output (note that it updates every fifth minute, but the value only changes once an hour).