Is there possibility to add attributes to the rest sensor like some native sensors have? For instance coinmarketcap sensor have these kind of attributes.
I know that there is setting json_attributes, but this did not behave like I expected.
Let’s say my json is like this: {"_id":"5a207f74e87cf540c6f2e5b6","value":34.1027,"amount":"854.7040","measurement_id":"home/el/supplier/cost","first_valuetime":"2017-12-01T00:00:00+02:00","last_valuetime":"2017-12-31T23:59:59+02:00"}
where sensor value is value and then I would like to see other entities like amount, first_valuetime and last_valuetime as a attributes. I tried it by following way:
I am using 0.59.2 version of Home Assistant and it is starting correctly without errors. I agree that indentation looks weird on my post. Maybe this was copy&paste error, sorry about this.
Still I cannot reach json_attributes by template like this {{ states.sensor.previous_month_bill.attributes }}
I am getting attributes, but without json_attributes: {'unit_of_measurement': '€', 'friendly_name': 'Edellisen kuukauden kertymä', 'icon': 'mdi:currency-eur'}
If I understood documention right, for instance get access to amount attribute should be work like this: {{ states.sensor.previous_month_bill.attributes["amount"] }}