Below is my config:
- platform: rest
resource: https://api.....
method: GET
name: waste_collection
scan_interval: 3600
json_attributes:
- datum
- fracties[0].name
The date is filled out correctly as an attribute. But the ‘name’ component has an issue.
No error, just no data.
I’ve tried several approaches:
fracties.0.name
fracties[0][‘name’]
…
Not working.
How can I get the data into the sensor attributes?
You can’t, not the way the REST Sensor is currently implemented. The items you list under json_attributes must be “top level” fields in the JSON response. The best you can do is list just fracties, and then you’ll see the entire value of that field as an attribute. Then, if you need just the value of the name key, you could use a template sensor to get it.