I would like to use a helper sensor for historical statistics. I use the Duke Energy integration which pulls meter data from Duke Energy.
Because the data can be delayed up to 24-48 hours the integration does not provide an entity. It is an integration which purely provides statistics.
For example, statistic:
duke_energy:electric_<device>_energy_consumption
I would like to create a statistics sensor which provides statistic values from 2 days ago as the sensor. This would allow me to do additional math such as billing data from published price per kilowatt pricing based on my region.
Currently, helper sensors (including history and statistic sensors) require an entity ID.
What else I have tried
I tried using a template sensor but in the documentation, there’s lots of examples for entity states but none that I could find regarding statistics (or date ranges of statistics).
Reporting back: I was not able to figure this out. I even went to the original pull request on GitHub which introduced this statistic change for the recorder.
I found no way to use this in templating (I’m not very experienced at templating so could be I don’t know where to look).
I saw these docs I should have linked them with my reply. I don’t see how the YAML examples provided there relate to template sensors.
For example, I can’t get it to work in Developer Tools > Template using the Template editor. That’s the same syntax template sensors use when I configure them under Settings> Devices > Helpers, Template sensor.