I have a working set of template sensors, but they refresh every few minutes. The underlying data is refreshing every minute. How can I make this template sensor also refresh every minute?
energy_consumption_net_peak_kwh:
friendly_name: Net Energy peak
unit_of_measurement: kWh
value_template: "{{ (states('sensor.energy_consumption_tarif_2')|float - states('sensor.energy_production_tarif_2')|float ) | round(2)}}"
The value shown is correct, but only the time is not equal to the times of the underlying sensors. Both the consumption and production are updated every minute (also shown in table)
The template sensor will only update if the incoming values actually change — that is, are different from the previous value. Both of the sensor values used in the calculation remain the same for the last three entries on your table, for example.
This shouldn’t be a problem. If it is, you need to get sensor.time installed and built into your calculation with something like: