I would like to calculate something like rain/temperature anomalies to display in the front end. I have a table of long-term rainfall and average temps for each week at my location, let’s say 4 columns of floats time 52 weeks. It is simple to create a statistics/template sensor to e.g. track the total rainfall over the last 7 days and compare with the long-term average.
But where do I actually store the data table? There isn’t a natural input_table entity where I could put it. What’s the kosher way of doing this?
I could just hardcode it into the template sensor as a list, but that seems a bit too hacky?
You could create a google spreadsheet, then use a RESTFul sensor to create a sensor in HA that has all of the information in the attributes of that sensor all pulled from the spreadsheet.
This is an interesting idea… Is there the 255 character maximum for an input_text? But maybe I can write it as an attribute of some input_entity as @arretx suggests?
So I’ve put the data table into a custom jinja template macro which returns a value form it. This way is can be used by multiple templates if need be without retyping.