Attributes templating

Some background
I have not been working with Home Assistant that long, but in a couple of days my configuration has been getting more and more complex.

I am currently using the REST sensor to download information from the Open Hardware Monitor API (http://openhardwaremonitor.org/) This API returns an enourmous JSON object with all kinds of information. CPU Speed, Temperatures of my system, etc.

The problem
With the current implementation it is not possible to ‘catch’ all the information for one component in one sensor. Because there is no way to set the value of the attributes for a Template Sensor.

Example:
A CPU Core has a couple of properties which I would like to show in a custom state card.

  • Load
  • Temperature
  • Clockrate

At the moment, fetching this information takes 3 calls to the same API, getting the same return value, but reading a different key from the JSON dictionary, while this information could be fetched in one request.

I know this could be problematic for the history, because only the state is tracked (I think?) so logging would only be on the property defined as state

Another ‘solution’ for this, would be that the Template Sensor would support filling the attributes dictionary. That way it would be possible to create 3 REST sensors, fetching the right information, but then we would be able to create a Template Sensor, which combines this info into one sensor with the right attributes.

I have a similar request.

Simply put, can templates be allowed for attributes defined in the customize section?

I would like to have that option too.

I currently convert the on/off status of a door sensor into open/closed but would also like to have a 0/1 for graphing with grafana. Of course I can create another sensor just for the graphs or maybe do some conversion again in influx or grafana, but having an attribute to store the “graph_value” would be nice.

can a template sensor have attributes as well as value?

Thanks

Any updates on this from anyone? I’ve just started looking into creating this ability but I’m brand new to coding…