I’d much rather this functionality was built into core - if you agree please have a look at this feature request: Retain last state change data of a sensor after reboot
I’d much rather this functionality was built into core - if you agree please have a look at this feature request: Retain last state change data of a sensor after reboot