New Luchtmeetnet open api, anyone ? [SOLVED] Topic is solved

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
MadMedic
Posts: 31
Joined: Wednesday 26 October 2016 14:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Huizen, the Netherlands
Contact:

New Luchtmeetnet open api, anyone ? [SOLVED]

Post by MadMedic »

A while ago Erik posted a msg in the python group concerning RIVM airquality values,
Since then this site has moved its business to the new luchtmeetnet site, which has an open api.

ErikAtSpijk wrote: Monday 02 April 2018 21:30 Edwin, the RIVM website seems to stop, the website luchtmeetnet.nl seems to be the new site.

Perhaps anyone here on this forum is already busy with making a domoticz compatible script for the luchtmeetnet site at https://www.luchtmeetnet.nl ?

On this postman url https://api-docs.luchtmeetnet.nl/view/1 ... ion=latest they have already posted the open api howto's
But for me it is too hard to make a script out of it. It must be possible to get values like:
  • NO2 (stikstof),
  • Pm10 (fijnstof)
  • Pm25 (fijnstof)
  • LKI (LuchtKwaliteitsIndex)
I can make an api call with no problem:
https://api.luchtmeetnet.nl/open_api/co ... =52.299216

Shouldn't be that hard to make a script out of it,
if you have the right stuff, which I don't :|

But for some codetigers here, this must be a piece of cake ? ;)
Last edited by MadMedic on Saturday 27 June 2020 22:54, edited 1 time in total.
.
"Life is too short for bad coffee"
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: New Luchtmeetnet open api, anyone ?

Post by waaren »

MadMedic wrote: Wednesday 24 June 2020 12:33 I can make an api call with no problem:
https://api.luchtmeetnet.nl/open_api/co ... =52.299216

Shouldn't be that hard to make a script out of it,
If you don't want to invent the wheel again...

https://www.domoticz.com/forum/viewtopi ... 72&t=22080
There seems to be a python plugin somewhere as well.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: New Luchtmeetnet open api, anyone ?

Post by EddyG »

Just did a request for my location for NO2.
I already get the results for tomorrow.

Code: Select all

    {
      "formula": "NO2",
      "value": 14.0,
      "timestamp_measured": "2020-06-25T14:00:00+00:00"
    },
    {
      "formula": "NO2",
      "value": 18.0,
      "timestamp_measured": "2020-06-25T15:00:00+00:00"
    }
Do they measure or that a guess? What I am missing is the unit of the values.
When I ask for CO2 I get the same value results but for NO2.
When I ask for NO (which they have on the site) I get a error response.
User avatar
MadMedic
Posts: 31
Joined: Wednesday 26 October 2016 14:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Huizen, the Netherlands
Contact:

Re: New Luchtmeetnet open api, anyone ?

Post by MadMedic »

waaren wrote: Wednesday 24 June 2020 15:25 If you don't want to invent the wheel again...

https://www.domoticz.com/forum/viewtopi ... 72&t=22080
There seems to be a python plugin somewhere as well.
Ah, I had been searching this forum several times on 'Luchtmeetnet',
but didn't get any other results then scripts about the now outdated RIVM site.
Good to know you guys are on the job already.
I should have known ;-)
.
"Life is too short for bad coffee"
User avatar
MadMedic
Posts: 31
Joined: Wednesday 26 October 2016 14:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Huizen, the Netherlands
Contact:

Re: New Luchtmeetnet open api, anyone ?

Post by MadMedic »

ey Waaren,

I tried your suggestion, the dzvents script you mentioned.
It works, except for a persistent error in the log which I don't understand:

Code: Select all

2020-06-25 12:46:31.788 Error: dzVents: Error: (3.0.2) Waqi: An error occurred when calling event handler Waqi air quality
2020-06-25 12:46:31.788 Error: dzVents: Error: (3.0.2) Waqi: ...z/scripts/dzVents/generated_scripts/Waqi air quality.lua:136: attempt to index a nil value (field '?') 
line 136 is this one:

Code: Select all

else
                    for setDevice, idx in pairs(sensors[type]) do
                        setSensor(idx,rt.data.iaqi[type:lower()].v)
                    end
                end
One of the problems is with this script is there isn't a station nearby, with this waqi source.
So I have to fetch data from stations as far as 30 km away, which doesn't seem very usefull.

The same thing is happening with the mentioned python plugin from Xorfor using data from OpenAQ.
Far too little stations in NL, and therefore in my neck-of-the-woods, to give me an accurate reading


I'd rather use the more up-to-date luchtmeetnet openapi source, since it has far more stations in NL

So the question remains:
Is anyone busy with a script that uses the luchtmeetnet source (see first msg in this thread)
or willing to struggle with this one ?
.
"Life is too short for bad coffee"
User avatar
MadMedic
Posts: 31
Joined: Wednesday 26 October 2016 14:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Huizen, the Netherlands
Contact:

Re: New Luchtmeetnet open api, anyone ?

Post by MadMedic »

EddyG wrote: Wednesday 24 June 2020 20:21 Just did a request for my location for NO2.
I already get the results for tomorrow.

Do they measure or that a guess? What I am missing is the unit of the values.
When I ask for CO2 I get the same value results but for NO2.
When I ask for NO (which they have on the site) I get a error response.
If you take a look at the following site https://www.luchtmeetnet.nl/mijn-locatie
you may notice that they give an up-to-date reading ánd a forecast reading for the next day
I too noticed that in the browser api call it seems that it only shows NO2,
but that might be a browsercache problem.
.
"Life is too short for bad coffee"
User avatar
MadMedic
Posts: 31
Joined: Wednesday 26 October 2016 14:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Huizen, the Netherlands
Contact:

Re: New Luchtmeetnet open api, anyone ?

Post by MadMedic »

MadMedic wrote: Thursday 25 June 2020 12:53 ey Waaren,

I tried your suggestion, the dzvents script you mentioned.
It works, except for a persistent error in the log which I don't understand:
Worked back from your orginal script. Dont know where I went wrong, but it works now without errors.
From this thread you mentioned https://www.domoticz.com/forum/viewtopi ... 72&t=22080
And I see this aqi script uses luchtmeetnet data too, so all is good

So, putting a lock on this... thnx for the help.
.
"Life is too short for bad coffee"
Post Reply

Who is online

Users browsing this forum: gizmocuz, Google [Bot] and 1 guest