I have a few template sensors set up to track the remaining energy after individual devices. For example, I have "Living Room General" which measures the daily energy reported by the living room circuit using an emporia vue and subtracts the energy measured by two IKEA outlets at the aquarium and the TV:
{{
(0 if states("sensor.family_room_lights_and_outlets_energy_today") == "unknown" else states("sensor.family_room_lights_and_outlets_energy_today")) | float -
(0 if states("sensor.living_room_media_daily_energy") == "unknown" else states("sensor.living_room_media_daily_energy")) | float -
(0 if states("sensor.turtle_tank_daily_energy") == "unknown" else states("sensor.turtle_tank_daily_energy")) | float
}}
The issue is, the individual device usage on the dashboard is insanely higher than what is reported by the template. This is the case with all my templates calculating in this way. I have daily energy meter helpers set up for the plugs that don't reset each day, and those are what I'm using.
In this example for the living room, the correct value, and what shows on the device info, is around 1.069 kWh, but the energy dashboard reports over 28 kWh. I am having this issue with all the templates I set up this way. The actual monitors of the sub-devices looks correct on the graph (for instance Turtle Tank and Living Room Media in this case). What I would expect to see on the dashboard for "Living Room General" is a bar the size of the difference between "Living Room Lights and Outlets Energy Today" (which I added to show the total of what that breaker reads, but I don't actually need to visualize once all this is working) and "Turtle Tank" (pretty much ignoring "Living Room Media" since that's super low)
Does anyone have any ideas why there is such a discrepency between the numbers? I can see the discrepency in the detail usage "Untracked consumption"