Trying to get some air pollution data using this sensor and json.
The documentation from the data provider https://api.nilu.no/docs/
Testing the url in https://jsonlint.com/ gets me this result:
[{
“zone”: “Øst og Sørlandet”,
“municipality”: “Lillehammer”,
“area”: “Lillehammer”,
“station”: “Bankplassen”,
“eoi”: “NO0074A”,
“component”: “PM10”,
“fromTime”: “2018-08-02T10:00:00+01:00”,
“toTime”: “2018-08-02T11:00:00+01:00”,
“value”: 14.85,
“unit”: “µg/m³”,
“index”: 1,
“color”: “6ee86e”,
“latitude”: 61.112880,
“longitude”: 10.464970
}, {
“zone”: “Øst og Sørlandet”,
“municipality”: “Lillehammer”,
“area”: “Lillehammer”,
“station”: “Bankplassen”,
“eoi”: “NO0074A”,
“component”: “PM2.5”,
“fromTime”: “2018-08-02T10:00:00+01:00”,
“toTime”: “2018-08-02T11:00:00+01:00”,
“value”: 6.70,
“unit”: “µg/m³”,
“index”: 1,
“color”: “6ee86e”,
“latitude”: 61.112880,
“longitude”: 10.464970
}, {
“zone”: “Øst og Sørlandet”,
“municipality”: “Lillehammer”,
“area”: “Lillehammer”,
“station”: “Bankplassen”,
“eoi”: “NO0074A”,
“component”: “NO2”,
“fromTime”: “2018-08-02T10:00:00+01:00”,
“toTime”: “2018-08-02T11:00:00+01:00”,
“value”: 7.5991443850,
“unit”: “µg/m³”,
“index”: 1,
“color”: “6ee86e”,
“latitude”: 61.112880,
“longitude”: 10.464970
}]
How do I set up my RESTful sensor, and how do I pick up the values to another sensor, the value for PM10 into sensor.pm10?
The rest sensor here not working:
- platform: rest
resource: https://api.nilu.no/aq/utd.json?areas=Lillehammer&stations=Bankplassen
name: "API Nilu"
value_template: "{{ value_json.status }}"
json_attributes:
- results