Hi,
I am using HA since years now. currently I included my PV and EV stuff too. since I would like to track the energy consumption of my EV (paying from a different account), I had the idea of creating an new sensor giving me current months energy consumption delta from the historical stat. however I worked on this for a while and I am struggeling to get it working. here is what I have defined
- platform: history_stats
name: Monthly Power Consumption
entity_id: sensor.goecharger_go_e_gemini_energy_total
state: "total_increasing"
type: count
start: '{{ now().replace(day=1).replace(hour=0, minute=0, second=0).strftime("%Y-%m-%d %H:%M:%S") }}'
end: '{{ (now().replace(day=1).replace(hour=0, minute=0, second=0) + timedelta(days=32)).strftime("%Y-%m-%d %H:%M:%S") }}'
The result is always 0. I am pretty sure that start and end condition will work like this, although the end date could be better calculated. about state and type I am uncertain here if the issue is coming from one of those.
if I check the entity in the developer options it gives me the following info
state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: Total Charged
and state returns the current totally accumulated amout of energy consummed since the beginning.
Any help is very much apprechiated.
BR,
Chris