Airly air quality

There’s network of sensors that monitor air quality in Poland called Airly.
There’s a map: https://airly.eu/map/pl/
There’s the API docs: https://developer.airly.eu/docs
Using our API requires registering an account. It is also possible to log in with existing GitHub, Google or Facebook account. A registered user is provided with an apikey which should be passed on each API request for authentication. The API key can be passed in a request as a custom header named apikey or as a query parameter.
Default rate limits per apikey are 1000 API requests per day and 50 API requests per minute.

Just use the REST component. Works great.

I’m experimenting with REST component. Unfortunately, without luck.

My config:

sensor:
  - platform: rest
    name: Airly
    resource: https://airapi.airly.eu/v2/measurements/installation?installationId=214
    scan_interval: 5
    value_template: '{{ value_json["current"]["fromDateTime"].title() }}'
    headers:
      Accept: application/json
      Accept-Language: en
      Accept-Encoding: gzip
      apikey: XXXX
    force_update: true

example response:


{"current":{"fromDateTime":"2018-12-02T18:16:59.016Z","tillDateTime":"2018-12-02T19:16:59.016Z","values":[{"name":"PM1","value":21.26},{"name":"PM25","value":31.61},{"name":"PM10","value":54.19},{"name":"PRESSURE","value":1003.89},{"name":"HUMIDITY","value":88.51},{"name":"TEMPERATURE","value":2.51}],"indexes":[{"name":"AIRLY_CAQI","value":52.62,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Postaraj się zostać z rodziną w domu.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":126.42},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":108.37}]},"history":[{"fromDateTime":"2018-12-01T19:00:00Z","tillDateTime":"2018-12-01T20:00:00Z","values":[{"name":"PM1","value":66.83},{"name":"PM25","value":100.07},{"name":"PM10","value":169.87},{"name":"PRESSURE","value":1015.75},{"name":"HUMIDITY","value":95.18},{"name":"TEMPERATURE","value":-0.87}],"indexes":[{"name":"AIRLY_CAQI","value":97.19,"level":"VERY_HIGH","description":"Zła jakość powietrza!","advice":"Chroń dzisiaj swoje płuca i nie wystawiaj ich na to zanieczyszczenie!","color":"#EF2A36"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":400.27},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":339.73}]},{"fromDateTime":"2018-12-01T20:00:00Z","tillDateTime":"2018-12-01T21:00:00Z","values":[{"name":"PM1","value":56.8},{"name":"PM25","value":83.46},{"name":"PM10","value":137.93},{"name":"PRESSURE","value":1015.54},{"name":"HUMIDITY","value":96.25},{"name":"TEMPERATURE","value":-0.6}],"indexes":[{"name":"AIRLY_CAQI","value":88.31,"level":"VERY_HIGH","description":"Zła jakość powietrza!","advice":"Nad tą lokalizacją unosi się smog. Rekomendujemy ograniczenie aktywności na zewnątrz.","color":"#EF2A36"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":333.82},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":275.86}]},{"fromDateTime":"2018-12-01T21:00:00Z","tillDateTime":"2018-12-01T22:00:00Z","values":[{"name":"PM1","value":50.76},{"name":"PM25","value":73.96},{"name":"PM10","value":121.18},{"name":"PRESSURE","value":1015.32},{"name":"HUMIDITY","value":96.25},{"name":"TEMPERATURE","value":-0.5}],"indexes":[{"name":"AIRLY_CAQI","value":83.66,"level":"HIGH","description":"Zła jakość powietrza!","advice":"Jakość powietrza możemy określić jednym słowem - FATALNIE.","color":"#EF7120"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":295.84},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":242.36}]},{"fromDateTime":"2018-12-01T22:00:00Z","tillDateTime":"2018-12-01T23:00:00Z","values":[{"name":"PM1","value":39.89},{"name":"PM25","value":58.84},{"name":"PM10","value":98.58},{"name":"PRESSURE","value":1015.2},{"name":"HUMIDITY","value":96.25},{"name":"TEMPERATURE","value":-0.29}],"indexes":[{"name":"AIRLY_CAQI","value":77.38,"level":"HIGH","description":"Zła jakość powietrza!","advice":"Samochód zostaw w domu, tramwaje i autobusy też są spoko!","color":"#EF7120"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":235.35},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":197.16}]},{"fromDateTime":"2018-12-01T23:00:00Z","tillDateTime":"2018-12-02T00:00:00Z","values":[{"name":"PM1","value":21.15},{"name":"PM25","value":31.48},{"name":"PM10","value":54.23},{"name":"PRESSURE","value":1014.95},{"name":"HUMIDITY","value":95.71},{"name":"TEMPERATURE","value":-0.19}],"indexes":[{"name":"AIRLY_CAQI","value":52.65,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze lekko zanieczyszczone.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":125.93},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":108.47}]},{"fromDateTime":"2018-12-02T00:00:00Z","tillDateTime":"2018-12-02T01:00:00Z","values":[{"name":"PM1","value":36.56},{"name":"PM25","value":53.26},{"name":"PM10","value":87.82},{"name":"PRESSURE","value":1014.39},{"name":"HUMIDITY","value":91.0},{"name":"TEMPERATURE","value":0.98}],"indexes":[{"name":"AIRLY_CAQI","value":73.64,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza jest niezadowalająca. Ogranicz aktywność na zewnątrz.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":213.04},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":175.64}]},{"fromDateTime":"2018-12-02T01:00:00Z","tillDateTime":"2018-12-02T02:00:00Z","values":[{"name":"PM1","value":29.7},{"name":"PM25","value":43.75},{"name":"PM10","value":74.47},{"name":"PRESSURE","value":1013.81},{"name":"HUMIDITY","value":91.0},{"name":"TEMPERATURE","value":0.86}],"indexes":[{"name":"AIRLY_CAQI","value":65.29,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze nie zachęca do spacerów","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":174.99},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":148.93}]},{"fromDateTime":"2018-12-02T02:00:00Z","tillDateTime":"2018-12-02T03:00:00Z","values":[{"name":"PM1","value":26.81},{"name":"PM25","value":39.51},{"name":"PM10","value":68.4},{"name":"PRESSURE","value":1013.23},{"name":"HUMIDITY","value":95.5},{"name":"TEMPERATURE","value":-1.24}],"indexes":[{"name":"AIRLY_CAQI","value":61.5,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze lekko zanieczyszczone.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":158.02},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":136.81}]},{"fromDateTime":"2018-12-02T03:00:00Z","tillDateTime":"2018-12-02T04:00:00Z","values":[{"name":"PM1","value":29.37},{"name":"PM25","value":45.27},{"name":"PM10","value":80.07},{"name":"PRESSURE","value":1012.8},{"name":"HUMIDITY","value":94.77},{"name":"TEMPERATURE","value":-1.1}],"indexes":[{"name":"AIRLY_CAQI","value":68.8,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza jest niezadowalająca. Ogranicz aktywność na zewnątrz.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":181.08},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":160.15}]},{"fromDateTime":"2018-12-02T04:00:00Z","tillDateTime":"2018-12-02T05:00:00Z","values":[{"name":"PM1","value":20.96},{"name":"PM25","value":31.55},{"name":"PM10","value":54.36},{"name":"PRESSURE","value":1012.33},{"name":"HUMIDITY","value":98.19},{"name":"TEMPERATURE","value":-1.92}],"indexes":[{"name":"AIRLY_CAQI","value":52.73,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza nie jest dzisiaj najlepsza.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":126.19},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":108.73}]},{"fromDateTime":"2018-12-02T05:00:00Z","tillDateTime":"2018-12-02T06:00:00Z","values":[{"name":"PM1","value":21.97},{"name":"PM25","value":33.05},{"name":"PM10","value":57.35},{"name":"PRESSURE","value":1011.65},{"name":"HUMIDITY","value":94.46},{"name":"TEMPERATURE","value":-1.64}],"indexes":[{"name":"AIRLY_CAQI","value":54.59,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze nie zachęca do spacerów","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":132.21},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":114.7}]},{"fromDateTime":"2018-12-02T06:00:00Z","tillDateTime":"2018-12-02T07:00:00Z","values":[{"name":"PM1","value":23.82},{"name":"PM25","value":35.81},{"name":"PM10","value":62.59},{"name":"PRESSURE","value":1011.04},{"name":"HUMIDITY","value":88.73},{"name":"TEMPERATURE","value":-1.14}],"indexes":[{"name":"AIRLY_CAQI","value":57.87,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza nie jest dzisiaj najlepsza.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":143.22},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":125.19}]},{"fromDateTime":"2018-12-02T07:00:00Z","tillDateTime":"2018-12-02T08:00:00Z","values":[{"name":"PM1","value":21.49},{"name":"PM25","value":32.1},{"name":"PM10","value":55.25},{"name":"PRESSURE","value":1010.48},{"name":"HUMIDITY","value":85.43},{"name":"TEMPERATURE","value":-0.77}],"indexes":[{"name":"AIRLY_CAQI","value":53.28,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza jest niezadowalająca. Ogranicz aktywność na zewnątrz.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":128.41},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":110.5}]},{"fromDateTime":"2018-12-02T08:00:00Z","tillDateTime":"2018-12-02T09:00:00Z","values":[{"name":"PM1","value":21.26},{"name":"PM25","value":31.68},{"name":"PM10","value":54.14},{"name":"PRESSURE","value":1009.69},{"name":"HUMIDITY","value":83.12},{"name":"TEMPERATURE","value":-0.64}],"indexes":[{"name":"AIRLY_CAQI","value":52.59,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Uważaj na siebie - zbyt długa ekspozycja na substancje zawarte w powietrzu może źle wpłynąć na Twoje zdrowie.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":126.71},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":108.28}]},{"fromDateTime":"2018-12-02T09:00:00Z","tillDateTime":"2018-12-02T10:00:00Z","values":[{"name":"PM1","value":21.53},{"name":"PM25","value":32.26},{"name":"PM10","value":55.39},{"name":"PRESSURE","value":1009.14},{"name":"HUMIDITY","value":79.77},{"name":"TEMPERATURE","value":1.31}],"indexes":[{"name":"AIRLY_CAQI","value":53.37,"level":"MEDIUM","description":"Bywało lepiej...","advice":"To nie jest najlepszy dzień na aktywność poza domem","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":129.05},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":110.78}]},{"fromDateTime":"2018-12-02T10:00:00Z","tillDateTime":"2018-12-02T11:00:00Z","values":[{"name":"PM1","value":21.44},{"name":"PM25","value":32.92},{"name":"PM10","value":57.59},{"name":"PRESSURE","value":1008.1},{"name":"HUMIDITY","value":77.81},{"name":"TEMPERATURE","value":2.32}],"indexes":[{"name":"AIRLY_CAQI","value":54.75,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze lekko zanieczyszczone.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":131.67},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":115.19}]},{"fromDateTime":"2018-12-02T11:00:00Z","tillDateTime":"2018-12-02T12:00:00Z","values":[{"name":"PM1","value":21.95},{"name":"PM25","value":33.21},{"name":"PM10","value":57.92},{"name":"PRESSURE","value":1007.23},{"name":"HUMIDITY","value":76.94},{"name":"TEMPERATURE","value":2.9}],"indexes":[{"name":"AIRLY_CAQI","value":54.95,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze nie zachęca do spacerów","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":132.86},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":115.83}]},{"fromDateTime":"2018-12-02T12:00:00Z","tillDateTime":"2018-12-02T13:00:00Z","values":[{"name":"PM1","value":24.53},{"name":"PM25","value":36.71},{"name":"PM10","value":63.28},{"name":"PRESSURE","value":1006.42},{"name":"HUMIDITY","value":76.75},{"name":"TEMPERATURE","value":2.94}],"indexes":[{"name":"AIRLY_CAQI","value":58.3,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza nie jest dzisiaj najlepsza.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":146.83},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":126.56}]},{"fromDateTime":"2018-12-02T13:00:00Z","tillDateTime":"2018-12-02T14:00:00Z","values":[{"name":"PM1","value":26.91},{"name":"PM25","value":40.84},{"name":"PM10","value":70.58},{"name":"PRESSURE","value":1006.09},{"name":"HUMIDITY","value":77.75},{"name":"TEMPERATURE","value":2.77}],"indexes":[{"name":"AIRLY_CAQI","value":62.86,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze nie zachęca do spacerów","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":163.36},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":141.16}]},{"fromDateTime":"2018-12-02T14:00:00Z","tillDateTime":"2018-12-02T15:00:00Z","values":[{"name":"PM1","value":37.14},{"name":"PM25","value":55.43},{"name":"PM10","value":92.22},{"name":"PRESSURE","value":1005.71},{"name":"HUMIDITY","value":81.11},{"name":"TEMPERATURE","value":2.23}],"indexes":[{"name":"AIRLY_CAQI","value":75.62,"level":"HIGH","description":"Zła jakość powietrza!","advice":"Wysokie stężenie pyłów zawieszonych w powietrzu. Ogranicz aktywność na zewnątrz.","color":"#EF7120"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":221.72},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":184.44}]},{"fromDateTime":"2018-12-02T15:00:00Z","tillDateTime":"2018-12-02T16:00:00Z","values":[{"name":"PM1","value":32.69},{"name":"PM25","value":48.41},{"name":"PM10","value":81.13},{"name":"PRESSURE","value":1005.17},{"name":"HUMIDITY","value":83.18},{"name":"TEMPERATURE","value":1.85}],"indexes":[{"name":"AIRLY_CAQI","value":69.46,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze nie zachęca do spacerów","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":193.63},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":162.26}]},{"fromDateTime":"2018-12-02T16:00:00Z","tillDateTime":"2018-12-02T17:00:00Z","values":[{"name":"PM1","value":30.72},{"name":"PM25","value":45.81},{"name":"PM10","value":77.04},{"name":"PRESSURE","value":1004.58},{"name":"HUMIDITY","value":84.58},{"name":"TEMPERATURE","value":2.16}],"indexes":[{"name":"AIRLY_CAQI","value":66.9,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Lepiej ogranicz dzisiaj swoją aktywność fizyczną na powietrzu.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":183.25},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":154.09}]},{"fromDateTime":"2018-12-02T17:00:00Z","tillDateTime":"2018-12-02T18:00:00Z","values":[{"name":"PM1","value":26.92},{"name":"PM25","value":39.97},{"name":"PM10","value":67.36},{"name":"PRESSURE","value":1004.04},{"name":"HUMIDITY","value":85.75},{"name":"TEMPERATURE","value":2.41}],"indexes":[{"name":"AIRLY_CAQI","value":60.85,"level":"MEDIUM","description":"Bywało lepiej...","advice":"To nie jest najlepszy dzień na aktywność poza domem","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":159.87},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":134.73}]},{"fromDateTime":"2018-12-02T18:00:00Z","tillDateTime":"2018-12-02T19:00:00Z","values":[{"name":"PM1","value":21.31},{"name":"PM25","value":31.55},{"name":"PM10","value":53.52},{"name":"PRESSURE","value":1003.9},{"name":"HUMIDITY","value":87.43},{"name":"TEMPERATURE","value":2.47}],"indexes":[{"name":"AIRLY_CAQI","value":52.2,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jeśli możesz, zostań w domu.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":126.18},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":107.03}]}],"forecast":[{"fromDateTime":"2018-12-02T19:00:00Z","tillDateTime":"2018-12-02T20:00:00Z","values":[{"name":"PM25","value":31.18},{"name":"PM10","value":56.99}],"indexes":[{"name":"AIRLY_CAQI","value":54.37,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Lepiej ogranicz dzisiaj swoją aktywność fizyczną na powietrzu.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":124.72},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":113.98}]},{"fromDateTime":"2018-12-02T20:00:00Z","tillDateTime":"2018-12-02T21:00:00Z","values":[{"name":"PM25","value":30.06},{"name":"PM10","value":56.07}],"indexes":[{"name":"AIRLY_CAQI","value":53.79,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza nie jest najlepsza, zalecamy ograniczenie i rozważenie podjęcia aktywności na wolnym powietrzu.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":120.25},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":112.14}]},{"fromDateTime":"2018-12-02T21:00:00Z","tillDateTime":"2018-12-02T22:00:00Z","values":[{"name":"PM25","value":27.19},{"name":"PM10","value":52.04}],"indexes":[{"name":"AIRLY_CAQI","value":51.28,"level":"MEDIUM","description":"Bywało lepiej...","advice":"To nie jest najlepszy dzień na aktywność poza domem","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":108.78},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":104.08}]},{"fromDateTime":"2018-12-02T22:00:00Z","tillDateTime":"2018-12-02T23:00:00Z","values":[{"name":"PM25","value":23.63},{"name":"PM10","value":46.99}],"indexes":[{"name":"AIRLY_CAQI","value":46.99,"level":"LOW","description":"Dobre powietrze.","advice":"Może warto pójść na spacer?","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":94.51},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":93.98}]},{"fromDateTime":"2018-12-02T23:00:00Z","tillDateTime":"2018-12-03T00:00:00Z","values":[{"name":"PM25","value":21.02},{"name":"PM10","value":43.29}],"indexes":[{"name":"AIRLY_CAQI","value":43.29,"level":"LOW","description":"Dobre powietrze.","advice":"Tak, tak – to prawda. Jakość powietrza jest dzisiaj dobra!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":84.1},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":86.59}]},{"fromDateTime":"2018-12-03T00:00:00Z","tillDateTime":"2018-12-03T01:00:00Z","values":[{"name":"PM25","value":18.86},{"name":"PM10","value":40.16}],"indexes":[{"name":"AIRLY_CAQI","value":40.16,"level":"LOW","description":"Dobre powietrze.","advice":"Zaczerpnij tchu!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":75.45},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":80.33}]},{"fromDateTime":"2018-12-03T01:00:00Z","tillDateTime":"2018-12-03T02:00:00Z","values":[{"name":"PM25","value":16.98},{"name":"PM10","value":37.07}],"indexes":[{"name":"AIRLY_CAQI","value":37.07,"level":"LOW","description":"Dobre powietrze.","advice":"Możesz wyjść i bez obaw cieszyć się otoczeniem.","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":67.92},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":74.14}]},{"fromDateTime":"2018-12-03T02:00:00Z","tillDateTime":"2018-12-03T03:00:00Z","values":[{"name":"PM25","value":15.42},{"name":"PM10","value":34.79}],"indexes":[{"name":"AIRLY_CAQI","value":34.79,"level":"LOW","description":"Dobre powietrze.","advice":"Nie przegap tego dnia! Czyste powietrze wzywa!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":61.68},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":69.57}]},{"fromDateTime":"2018-12-03T03:00:00Z","tillDateTime":"2018-12-03T04:00:00Z","values":[{"name":"PM25","value":13.84},{"name":"PM10","value":32.7}],"indexes":[{"name":"AIRLY_CAQI","value":32.7,"level":"LOW","description":"Dobre powietrze.","advice":"Zaczerpnij tchu!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":55.36},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":65.4}]},{"fromDateTime":"2018-12-03T04:00:00Z","tillDateTime":"2018-12-03T05:00:00Z","values":[{"name":"PM25","value":12.82},{"name":"PM10","value":30.74}],"indexes":[{"name":"AIRLY_CAQI","value":30.74,"level":"LOW","description":"Dobre powietrze.","advice":"Zapomnij o masce!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":51.26},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":61.48}]},{"fromDateTime":"2018-12-03T05:00:00Z","tillDateTime":"2018-12-03T06:00:00Z","values":[{"name":"PM25","value":13.09},{"name":"PM10","value":30.79}],"indexes":[{"name":"AIRLY_CAQI","value":30.79,"level":"LOW","description":"Dobre powietrze.","advice":"Rolki i rower niech idą dzisiaj w ruch!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":52.35},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":61.58}]},{"fromDateTime":"2018-12-03T06:00:00Z","tillDateTime":"2018-12-03T07:00:00Z","values":[{"name":"PM25","value":13.47},{"name":"PM10","value":31.32}],"indexes":[{"name":"AIRLY_CAQI","value":31.32,"level":"LOW","description":"Dobre powietrze.","advice":"Zapomnij o masce!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":53.89},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":62.65}]},{"fromDateTime":"2018-12-03T07:00:00Z","tillDateTime":"2018-12-03T08:00:00Z","values":[{"name":"PM25","value":14.29},{"name":"PM10","value":32.39}],"indexes":[{"name":"AIRLY_CAQI","value":32.39,"level":"LOW","description":"Dobre powietrze.","advice":"Zaczerpnij tchu!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":57.14},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":64.78}]},{"fromDateTime":"2018-12-03T08:00:00Z","tillDateTime":"2018-12-03T09:00:00Z","values":[{"name":"PM25","value":15.72},{"name":"PM10","value":34.48}],"indexes":[{"name":"AIRLY_CAQI","value":34.48,"level":"LOW","description":"Dobre powietrze.","advice":"Może warto pójść na spacer?","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":62.89},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":68.97}]},{"fromDateTime":"2018-12-03T09:00:00Z","tillDateTime":"2018-12-03T10:00:00Z","values":[{"name":"PM25","value":17.09},{"name":"PM10","value":36.45}],"indexes":[{"name":"AIRLY_CAQI","value":36.45,"level":"LOW","description":"Dobre powietrze.","advice":"Idealny dzień na sport na świeżym powietrzu!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":68.36},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":72.89}]},{"fromDateTime":"2018-12-03T10:00:00Z","tillDateTime":"2018-12-03T11:00:00Z","values":[{"name":"PM25","value":19.23},{"name":"PM10","value":39.84}],"indexes":[{"name":"AIRLY_CAQI","value":39.84,"level":"LOW","description":"Dobre powietrze.","advice":"Idealny dzień na sport na świeżym powietrzu!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":76.93},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":79.67}]},{"fromDateTime":"2018-12-03T11:00:00Z","tillDateTime":"2018-12-03T12:00:00Z","values":[{"name":"PM25","value":21.15},{"name":"PM10","value":42.58}],"indexes":[{"name":"AIRLY_CAQI","value":42.58,"level":"LOW","description":"Dobre powietrze.","advice":"Wspaniałe powietrze na spacer do parku!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":84.6},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":85.16}]},{"fromDateTime":"2018-12-03T12:00:00Z","tillDateTime":"2018-12-03T13:00:00Z","values":[{"name":"PM25","value":22.72},{"name":"PM10","value":45.4}],"indexes":[{"name":"AIRLY_CAQI","value":45.4,"level":"LOW","description":"Dobre powietrze.","advice":"Lepiej być nie może ;)","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":90.9},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":90.79}]},{"fromDateTime":"2018-12-03T13:00:00Z","tillDateTime":"2018-12-03T14:00:00Z","values":[{"name":"PM25","value":24.65},{"name":"PM10","value":48.25}],"indexes":[{"name":"AIRLY_CAQI","value":48.25,"level":"LOW","description":"Dobre powietrze.","advice":"Jakość powietrza jest dobra!","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":98.6},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":96.51}]},{"fromDateTime":"2018-12-03T14:00:00Z","tillDateTime":"2018-12-03T15:00:00Z","values":[{"name":"PM25","value":25.38},{"name":"PM10","value":49.7}],"indexes":[{"name":"AIRLY_CAQI","value":49.7,"level":"LOW","description":"Dobre powietrze.","advice":"Lepiej być nie może ;)","color":"#D1CF1E"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":101.51},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":99.39}]},{"fromDateTime":"2018-12-03T15:00:00Z","tillDateTime":"2018-12-03T16:00:00Z","values":[{"name":"PM25","value":25.83},{"name":"PM10","value":50.72}],"indexes":[{"name":"AIRLY_CAQI","value":50.45,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze nie zachęca do spacerów","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":103.31},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":101.44}]},{"fromDateTime":"2018-12-03T16:00:00Z","tillDateTime":"2018-12-03T17:00:00Z","values":[{"name":"PM25","value":26.56},{"name":"PM10","value":51.82}],"indexes":[{"name":"AIRLY_CAQI","value":51.14,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza nie jest dzisiaj najlepsza.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":106.25},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":103.63}]},{"fromDateTime":"2018-12-03T17:00:00Z","tillDateTime":"2018-12-03T18:00:00Z","values":[{"name":"PM25","value":27.41},{"name":"PM10","value":53.15}],"indexes":[{"name":"AIRLY_CAQI","value":51.97,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Jakość powietrza nie jest dzisiaj najlepsza.","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":109.63},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":106.3}]},{"fromDateTime":"2018-12-03T18:00:00Z","tillDateTime":"2018-12-03T19:00:00Z","values":[{"name":"PM25","value":28.78},{"name":"PM10","value":55.33}],"indexes":[{"name":"AIRLY_CAQI","value":53.33,"level":"MEDIUM","description":"Bywało lepiej...","advice":"Powietrze nie zachęca do spacerów","color":"#EFBB0F"}],"standards":[{"name":"WHO","pollutant":"PM25","limit":25.0,"percent":115.11},{"name":"WHO","pollutant":"PM10","limit":50.0,"percent":110.66}]}]}

(pretty JSON here: https://pastebin.com/UdvQLmqN)

Home-Assistant finishes with such logs:

gru 02 20:19:14 homeassistant hass[26593]: 2018-12-02 20:19:14 DEBUG (Thread-6) [homeassistant.components.sensor.rest] Updating from https://airapi.airly.eu/v2/measurements/installation?installationId=355
gru 02 20:19:14 homeassistant hass[26593]: 2018-12-02 20:19:14 DEBUG (MainThread) [homeassistant.components.light.hue] Finished group request in 0.032 seconds
gru 02 20:19:14 homeassistant hass[26593]: 2018-12-02 20:19:14 DEBUG (MainThread) [homeassistant.components.light.hue] Finished light request in 0.043 seconds
gru 02 20:19:14 homeassistant hass[26593]: 2018-12-02 20:19:14 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
gru 02 20:19:14 homeassistant hass[26593]: Traceback (most recent call last):
gru 02 20:19:14 homeassistant hass[26593]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
gru 02 20:19:14 homeassistant hass[26593]:     result = coro.send(None)
gru 02 20:19:14 homeassistant hass[26593]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 310, in async_update_ha_state
gru 02 20:19:14 homeassistant hass[26593]:     self.entity_id, state, attr, self.force_update, self._context)
gru 02 20:19:14 homeassistant hass[26593]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 903, in async_set
gru 02 20:19:14 homeassistant hass[26593]:     context)
gru 02 20:19:14 homeassistant hass[26593]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 673, in __init__
gru 02 20:19:14 homeassistant hass[26593]:     "State max length is 255 characters.").format(entity_id))
gru 02 20:19:14 homeassistant hass[26593]: homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.airly. State max length is 255 characters.

Try this:

# Airly
- platform: rest
  scan_interval: 120
  name: Airly
  resource: https://airapi.airly.eu/v2/measurements/nearest?indexType=AIRLY_CAQI&lat=XX&lng=XX&maxDistanceKM=1
  value_template: "{{ value_json['current']['values'][1]['value'] }} {{ value_json['current']['values'][2]['value'] }} {{ value_json['current']['values'][3]['value'] }} {{ value_json['current']['values'][4]['value'] }} {{ value_json['current']['values'][5]['value'] }} {{ value_json['current']['indexes'][0]['level'] }}"
  headers:
    apikey: !secret airly_apikey

- platform: template
  sensors:
    airly_pm25:
      unit_of_measurement: "μg/m3"
      value_template: "{{ states.sensor.airly.state.split(' ')[0] }}"
    airly_pm10:
      unit_of_measurement: "μg/m3"
      value_template: "{{ states.sensor.airly.state.split(' ')[1] }}"
    airly_pressure:
      unit_of_measurement: "hPA"
      value_template: "{{ states.sensor.airly.state.split(' ')[2] }}"
    airly_humidity:
      unit_of_measurement: "%"
      value_template: "{{ states.sensor.airly.state.split(' ')[3] }}"
    airly_temperature:
      unit_of_measurement: "°C"
      value_template: "{{ states.sensor.airly.state.split(' ')[4] }}"
    airly_quality:
      value_template: "{{ states.sensor.airly.state.split(' ')[5] }}"
1 Like

Whoa! Thanks, works like a charm. BTW, have You tried to create value_template as a JSON structure and receive its’ fields from templated sensors? Could be more elegant way than spliting via spaces.

Yea. I was using that method with v1 of the Airly API. But since switching to v2 I just found some ready config. If you end up switching to a value template, please share.

Have You v1 Airly API recipe lying somewhere around?

Just looked around. Sorry, I don’t.

Airly integration via AppDaemon App Airly integration [AppDaemon]

Guys I’m a newbie here and I know it’s a kind of general question, but is there a way to remove unavailable entities from HA?
I’m asking here, because I want to remove Airly component entities. I removed the whole Airly component, but it turned out that some elements are still there and what’s more annoying are requesting data from airly service what quite fast consumes a number of allowed requests per day (100). I would like to completely remove Airly component from HA. Thanks in advance.

Why do you have so many entities? Do you use an official version or deprecated custom version of the Airly component?

Official one taken from HA UI.

Official one doesn’t create PM10 and PM2.5 entities.

Remove Airly from Configuration -> Integrations, remove entities from Entity Registry, remove old Airly component from custom_components folder and restart HA.
There is PR with a change that helps with too many requests per day but it’s waiting for the review. You can fill up the issue about this on GitHub.

I am currently using THIS available Airly integration in Home Assistant. In the sensor.airly_caqi entity I have the attributes (Level, Advice, Description) and the values ​​of these attributes (eg: low, do you smell it?, Well … it’s been better) in English. Is it possible for them to be displayed in Polish? Additional information: Dokumentacja | Programista Airly

Airly - low

Hi, is it possible to show Air quality index level instead of PM2.5?