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.