Closed jmunowitch closed 1 year ago
After some more futzing around, I was able to fix this!
Both of the sensor templates needed to have state_class
set to total_increasing
:
- name: "Grid To Home"
unique_id: 'Grid To Home'
state: "{{state_attr('sensor.energy_calc', 'Grid_to_home_[kWh]')}}"
device_class: energy
state_class: total_increasing
unit_of_measurement: "kWh"
- sensor:
- name: "Solar To Grid"
unique_id: 'Solar To Grid'
state: "{{state_attr('sensor.energy_calc', 'Solar_to_grid_[kWh]')}}"
device_class: energy
state_class: total_increasing
unit_of_measurement: "kWh"
Hi, im currently on vacation but will have a look once I'm back. But timezones will be the issue for sure. I live in Germany and your 4pm is my midnight..
I guess this needs to be replaced with "local timezone" https://github.com/KoljaWindeler/energy_calc/blob/30dc7567f00ca67028eed41da09aaf761f739d4b/custom_components/energy_calc/sensor.py#L119
I stubbled upon the repo as the solution to my HA energy problems! I am excited because it solves a significant challenge to using the HA energy dashboard
Once setting this up, the energy dashboard worked great! Until I noticed the data seems to be resetting at 4pm local time (America/Los_Angeles):
I am a bit baffled why this is happening. My uneducated guess is timezones... but I have no real evidence of this.
in config_entries:
Solar is coming in through the solaredge integration and the power is coming from the ha-emporia-vue integration.
Any help in figuring out why the stats are resetting at 4pm local time would be great!