To the best of my knowledge, the statistics data that home assistant is collecting as statistics (for entities that have a state_class can’t be used in automation/templates/etc.
If I want to do a comparison (value increasing/decreasing, change from an hour ago, yesterday’s high/low/average) I either need to create new entities and store additional duplicated information in the database, or use some external SQL.
It would be handy if some of that data was available as entity attributes, or at least there was a way to query it from templates/automations.
Note that it works because apexcharts-card passes the hass object to data generators. Depending on the API a frontend card gives you, you may not have enough access to play with.
Was also looking for this.
I want to send out a notification if the precious max value of a sensor was exceeded, preferably without having to create new entities.