I have I json file looking like
[ {"temperature": 77, "id": "sensor02", "name": "livingroom", "connected": true} ]
Because of the square brackets I use this to get the “connected” state:
in sensors.yaml
- platform: rest
scan_interval: 10
resource: someresource
value_template: '{{ value_json[0].connected }}'
json_attributes:
name: '{{ value_json[0].name }}'
#- value_json[0].name
this works for the connected state, but I don’t know how to setup the attributes. Both lines in the example above did not work.