pawkakol1 / worlds-air-quality-index

HACS World's Air Quality Index integration from waqi.info
43 stars 12 forks source link

PM2.5, CO and O3 stoped working #46

Closed rickstaa closed 10 months ago

rickstaa commented 10 months ago

I just stumbled upon a problem: the Particulate matter (PM2.5), Carbon monoxide (CO), and Ozone (O3) sensors seem to have stopped working over the past few months. The culprit might be an API tweak on WAQI's end. I'm more than willing to roll up my sleeves and investigate, but given my greenhorn status with HA integrations, I thought it would be good to check if you're already aware of these issues.

How to reproduce

  1. Kick-off HA in a Docker container using docker-compose:
version: "3.8"

services:
  homeassistant:
    image: "ghcr.io/home-assistant/home-assistant:stable"
    container_name: homeassistant
    volumes:
      # - /mnt/NAS/video:/media/NAS/video # Mount your NAS video folder.
      - /opt/homeassistant/config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    network_mode: host
  1. Install the the worlds-air-quality-index plugin.
  2. Configure the integration with a station that contains the PM2.5, CO, and O3 values (like this one).
  3. Navigate to the HA entities tab and confirm the absence of these values under the World's Air Quality Index integration.
  4. Double-check that these values are supported by the station -> Station Link.

image

luberk8 commented 10 months ago

Having the same issue

pawkakol1 commented 10 months ago

I will take a look on it today

pawkakol1 commented 10 months ago

I verified it using Postman, and I got below data, an I also visit WAQI web site - there is no O3 nor PM2.5 in current data list ("iaqi") - they are in forecast only
{ "status": "ok", "data": { "aqi": 10, "idx": 7937, "attributions": [ { "url": "http://www.luchtmeetnet.nl/", "name": "RIVM - Rijksinstituut voor Volksgezondheid en Milieum, Landelijk Meetnet Luchtkwaliteit", "logo": "Netherland-RIVM.png" }, { "url": "https://waqi.info/", "name": "World Air Quality Index Project" } ], "city": { "geo": [ 52.370508, 4.642319 ], "name": "Schipholweg, Haarlem", "url": "https://aqicn.org/city/netherland/haarlem/schipholweg", "location": "" }, "dominentpol": "pm10", "iaqi": { "h": { "v": 90 }, "no2": { "v": 20.4 }, "p": { "v": 990.7 }, "pm10": { "v": 10 }, "t": { "v": 11.6 }, "w": { "v": 0.1 }, "wg": { "v": 1 } }, "time": { "s": "2023-10-27 18:00:00", "tz": "+02:00", "v": 1698429600, "iso": "2023-10-27T18:00:00+02:00" }, "forecast": { "daily": { "o3": [ { "avg": 8, "day": "2023-10-27", "max": 20, "min": 1 }, { "avg": 18, "day": "2023-10-28", "max": 28, "min": 14 }, { "avg": 24, "day": "2023-10-29", "max": 27, "min": 18 }, { "avg": 11, "day": "2023-10-30", "max": 21, "min": 1 }, { "avg": 1, "day": "2023-10-31", "max": 1, "min": 1 } ], "pm10": [ { "avg": 9, "day": "2023-10-27", "max": 14, "min": 5 }, { "avg": 9, "day": "2023-10-28", "max": 13, "min": 5 }, { "avg": 7, "day": "2023-10-29", "max": 8, "min": 3 }, { "avg": 13, "day": "2023-10-30", "max": 17, "min": 8 }, { "avg": 18, "day": "2023-10-31", "max": 19, "min": 18 } ], "pm25": [ { "avg": 32, "day": "2023-10-27", "max": 54, "min": 14 }, { "avg": 30, "day": "2023-10-28", "max": 45, "min": 16 }, { "avg": 16, "day": "2023-10-29", "max": 21, "min": 9 }, { "avg": 38, "day": "2023-10-30", "max": 55, "min": 19 }, { "avg": 57, "day": "2023-10-31", "max": 59, "min": 57 } ] } }, "debug": { "sync": "2023-10-28T02:29:51+09:00" } } }

image

rickstaa commented 10 months ago

I verified it using Postman, and I got below data, an I also visit WAQI web site - there is no O3 nor PM2.5 in current data list ("iaqi") - they are in forecast only { "status": "ok", "data": { "aqi": 10, "idx": 7937, "attributions": [ { "url": "http://www.luchtmeetnet.nl/", "name": "RIVM - Rijksinstituut voor Volksgezondheid en Milieum, Landelijk Meetnet Luchtkwaliteit", "logo": "Netherland-RIVM.png" }, { "url": "https://waqi.info/", "name": "World Air Quality Index Project" } ], "city": { "geo": [ 52.370508, 4.642319 ], "name": "Schipholweg, Haarlem", "url": "https://aqicn.org/city/netherland/haarlem/schipholweg", "location": "" }, "dominentpol": "pm10", "iaqi": { "h": { "v": 90 }, "no2": { "v": 20.4 }, "p": { "v": 990.7 }, "pm10": { "v": 10 }, "t": { "v": 11.6 }, "w": { "v": 0.1 }, "wg": { "v": 1 } }, "time": { "s": "2023-10-27 18:00:00", "tz": "+02:00", "v": 1698429600, "iso": "2023-10-27T18:00:00+02:00" }, "forecast": { "daily": { "o3": [ { "avg": 8, "day": "2023-10-27", "max": 20, "min": 1 }, { "avg": 18, "day": "2023-10-28", "max": 28, "min": 14 }, { "avg": 24, "day": "2023-10-29", "max": 27, "min": 18 }, { "avg": 11, "day": "2023-10-30", "max": 21, "min": 1 }, { "avg": 1, "day": "2023-10-31", "max": 1, "min": 1 } ], "pm10": [ { "avg": 9, "day": "2023-10-27", "max": 14, "min": 5 }, { "avg": 9, "day": "2023-10-28", "max": 13, "min": 5 }, { "avg": 7, "day": "2023-10-29", "max": 8, "min": 3 }, { "avg": 13, "day": "2023-10-30", "max": 17, "min": 8 }, { "avg": 18, "day": "2023-10-31", "max": 19, "min": 18 } ], "pm25": [ { "avg": 32, "day": "2023-10-27", "max": 54, "min": 14 }, { "avg": 30, "day": "2023-10-28", "max": 45, "min": 16 }, { "avg": 16, "day": "2023-10-29", "max": 21, "min": 9 }, { "avg": 38, "day": "2023-10-30", "max": 55, "min": 19 }, { "avg": 57, "day": "2023-10-31", "max": 59, "min": 57 } ] } }, "debug": { "sync": "2023-10-28T02:29:51+09:00" } } }

image

Thank you for bringing this to my attention. It appears that the station has updated its sensors. If I understand correctly, your tool is designed to showcase values under the iaqi category and consolidate them into a forecast variable when they are projected. Your explanation clarifies things, and upon reviewing my setup, the forecast variable no longer exists. 🤔

rickstaa commented 10 months ago

@pawkakol1 should I create a new issue for the forecast variable?

pawkakol1 commented 10 months ago

No, I didn't notice your post about the forecast

pawkakol1 commented 10 months ago

@rickstaa in the README description there is below sentence:

If the station supports forecast of some pollution sensor, but it doesn't support actual value of this sensor, then the forecast will be omitted.

But in next version there will be sensor with UNAVAILABLE current state, and read forecast like below: image

rickstaa commented 10 months ago

@rickstaa in the README description there is below sentence:

If the station supports forecast of some pollution sensor, but it doesn't support actual value of this sensor, then the forecast will be omitted.

But in next version there will be sensor with UNAVAILABLE current state, and read forecast like below: image

Amazing thanks for the explanation. Looking forward to the next version 🚀.

pawkakol1 commented 10 months ago

Done in version 1.0.4

rickstaa commented 10 months ago

Great 🎉!