Can anyone assist with working out how I get the “LongDate” value from the Refuse and Recycling sections within this JSON please?
{
"status":"OK",
"body":[
{
"collectionType":"Refuse",
"roundInfo":"Wed2",
"LongDate":"Wednesday 29 March",
"notes":null,
"crew":"R3",
"NextCollection":"2023-03-29"
},
{
"collectionType":"Recycling",
"roundInfo":"Wed2",
"LongDate":"Wednesday 22 March",
"notes":null,
"crew":"Z3",
"NextCollection":"2023-03-22"
},
{
"collectionType":"Garden",
"roundInfo":null,
"LongDate":"Wednesday 29 March",
"notes":null,
"crew":"V1",
"NextCollection":"2023-03-29"
},
{
"collectionType":"Food",
"roundInfo":"Wed2",
"LongDate":"Wednesday 22 March",
"notes":null,
"crew":"K4",
"NextCollection":"2023-03-22"
}
]
}
Tried all manor of config variations but either get no value or “Unknown” returned.
sensor:
- name: "Refuse"
json_attributes_path: "$.[0]"
json_attributes:
- LongDate
value_template: "{{ value_json[0]['LongDate'] }}"
- name: "Recycling"
value_template: "{{ value_json[1]['LongDate'] }}"
JSON Code as image if needed:
Thanks in advance.