As probably a few of you have done after the Energy panel integration in home assistant, I forced the missing attributes to some of my sensors in order to see them in the Energy .
customization.yaml
# Reading of total energy of the house (always incrementing)
sensor.tasmota_energy_meter_energy_total:
device_class: energy
state_class: measurement
last_reset: '1970-01-01T00:00:00+00:00'
# Reading of total energy used by Device A today (since midnight)
sensor.tasmota_energy_meter_DeviceA_today:
device_class: energy
state_class: measurement
last_reset: '1970-01-01T00:00:00+00:00'
Although I don’t care much about the last_reset
time of the first sensor (being a always incrementing number, a sort of “absolute”), I do care a lot about the last_reset
time of the second one, being reset to 0 every day at midnight.
I’m looking for a solution here that would allow me to manually change the last_reset
time (every day at midnight).
I think this guy had an interesting thought but that’s still not a good solution:
How to update trigger templates correct - Configuration - Home Assistant Community (home-assistant.io)
In a nutshell, how can I modify an attribute while HA is running?
Maybe there is a way to add the last_reset
directly to the mqtt message I receive from the tasmota device?