I have 4 sensors (T, A, B, C) measuring energy consumption. Sensor T is measuring a socket with an extension. A, B, and C are connected to different sockets on that extension. Therefore, T should be equal to A + B + C + R, where R would be other remaining devices that don’t have sensors on them.
I’m trying to track the energy consumption of R.
For that, I created a template that computes R = T - (A + B + C). This template is yielding correct results. Then I have an utility meter with this template sensor as input. This meter is yielding incorrect results, this is the problem. By that I mean, the increments on this meter match exactly with the increments observed in T, instead of matching R.
I checked, I’m pointing the meter to the R template sensor, not T.
I’ve created a second meter with the same input, as a sanity check, I have the same result.
I would really appreciate some help understanding what I’m doing wrong here.
Config of the meter:
I wanted to put screenshot but was only allowed one
Input sensor: “Homelab Remaining Energy” aka R
Meter reset cycle: No cycle
Meter reset offset: 0
Supported tariffs: empty
Net consumption: off
Delta values: off
Periodically resetting: off
Sensor always available: on
Config of the R sensor template:
{% set homelab_total = states('sensor.homelab_energy_meter') | float %}
{% set hdds = states('sensor.hdds_energy_meter') | float %}
{% set nas = states('sensor.nas_energy_meter') | float %}
{% set wifi_ap = states('sensor.wifi_ap_energy_meter') | float %}
{{ homelab_total - (hdds + nas + wifi_ap) }}
Changes on these meters:
This is a chart with the changes to these meters. Not the states.
The brown line corresponds to sensor R.
The blue line is T.
The purple line that you don’t see becuase it totally overlaps blue is the meter for sensor R.
The pink line is the duplicate meter I created.
The purple and pink lines should overlap with the brown line.