Using a Rest Service
Home Assistant Configuration
rest:
resource: https://www.xxxx.com
scan_interval: 3600
sensor:
- name: rubbish
value_template: 'OK'
json_attributes:
- "GARDEN"
- "REFUSE"
- "RECYCLING"
- name: rubbish-garden
value_template: '{{value_json["GARDEN"]}}'
- name: rubbish-recycling
value_template: '{{ value_json["RECYCLING"]}}'
- name: rubbish-refuse
value_template: '{{ value_json["REFUSE"]}}'
The above configuration creates a sensor with 3 attributes, it requests a json file every hour in the format shown below and extracts the 3 dates and creates sensors for each of the 3 values.
{"GARDEN":"2021-03-18","RECYCLING":"2021-03-19","REFUSE":"2021-03-19"}