I need a bit help… My heat pump has two energy meters, one for the indoor unit and 1 for the outdoor unit. At the moment I’ve added these separate to the energy dashboard but I like to have 1 which merge these values.
The new sensor adds the values together but I cannot add the sensor in the energy dashbord as individual device.
So I added state_class: total_increasing but that doesn’t do the trick. When I check my configuation it states:
Configuration warnings
Invalid config for ‘template’ from integration ‘sensor’ at configuration.yaml, line 20: ‘state_class’ is an invalid option for ‘sensor.template’, check: sensors->energieverbruik_warmtepomp->state_class
I cannot figure out what I’m doing wrong. Can anyone help or point me into the right direction?
Thanks!
Edit: I’ve already found the solution, add a utility meter with the combined entity ID
That is another way to solve it.The problem with your template was that it is and old style template sensor definition. New style you should define the sensor under the top level template: and not sensor:
You are setting yourself up for failure. This sensor will create havoc with the energy dashboard unless both sensors are always reporting valid values.
If one of your sensors becomes unavailable the total will drop. When the sensor returns the total will increase. This increase will be logged incorrectly as energy use.
To combat this issue you must use an availability template.
This will mark the total sensor as unavailable if one or both the source sensors are not reporting numbers. This will prevent the issue as changing from unavailable to some value will not cause an energy reading to be logged.