Author Topic: Support of "Leuven" Air Quality scripts  (Read 9682 times)

0 Members and 1 Guest are viewing this topic.

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" Air Quality scripts
« Reply #50 on: May 20, 2020, 08:12:22 AM »
Hi There,

Before we can start, do you have the user sensor file coming to your /luftdaten/data directory on your server?

it will look like "luft_24data_esp8266-14900835.arr"

Regards,
Dave.

Hello, yes I have that exactly but I temporarily disabled it because im using WIM's script that directly reads data from luft servers


Regards

-Mike-

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #51 on: May 20, 2020, 08:40:03 AM »
Hi Mike,

First task is to read that sensor file, I modified Wim's "Saratoga" script to read the sensor file.

Then wrote a script to run as a cron to load the data into an SQL database.

There are several graph/chart packages that can be used to display SQL data, I like JPGraphs, but you could use HighCharts.

I can help with reading the sensor file  and the SQL load script, but explaining graph packages would take forever. There is a lot on the forum about using these packages.

If you would like to go down the route of getting the data into an SQL database, let me know?

Cheers,

Dave

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" Air Quality scripts
« Reply #52 on: May 23, 2020, 08:43:50 AM »
Well not bad i INSTEAD USE its gaffana graphs, however the monthly and yearly graphs are not available so still need to redirect to MADAVI site for it, but at least I got daily graphs

Offline Sperber

  • Member
  • *
  • Posts: 2
Re: Support of "Leuven" Air Quality scripts
« Reply #53 on: August 21, 2020, 12:51:06 PM »
Hi Wim,
i like your skript for purpleair,
and i have a little problem..

https://wetter.priesterath.net/purpleair/_test2.php

I would like only the page with all the data first. Otherwise I always have to click on more.
I just can't do it.  :roll:

Thx Sperber


Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #54 on: August 21, 2020, 01:08:40 PM »
Hi Wim,
i like your skript for purpleair,
and i have a little problem..

https://wetter.priesterath.net/purpleair/_test2.php

I would like only the page with all the data first. Otherwise I always have to click on more.
I just can't do it.  :roll:

Thx Sperber
Most people only want a low (small)  block on their page. So default the condensed data is used with a button to extend.

Script ws_purpleair2.php  lines 360-361 now use the $aq_condensed_html
Code: [Select]
if (isset ($purple_html) && $purple_html == true)
     {  echo $pageHTML_0.$aq_condensed_html.$pageHTML_9; }
Change that so that all information is shown
Code: [Select]
if (isset ($purple_html) && $purple_html == true)
     {  echo $pageHTML_0.$aq_fullpage_html.$pageHTML_9; }

That should do it.

Wim

Offline Sperber

  • Member
  • *
  • Posts: 2
Re: Support of "Leuven" Air Quality scripts
« Reply #55 on: August 21, 2020, 01:47:32 PM »
Thanks, that was quick.
It's going to be a special project.
Since all the air data measuring devices differ too much for me, I will present 3 manufacturers on one page.

Your script is the first for Purple Air.

IQAir AirVisual Pro from Switzerland and https://www.air-q.com/ from Germany are added.
I'm waiting for the delivery.

All are placed in the same location.

Maybe you can help me with the page ?!

Thanks Sperber

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: Support of "Leuven" Air Quality scripts
« Reply #56 on: August 23, 2020, 09:06:00 PM »
Hello Wim ...
Long time since the beteljuice last annoyed you  :grin:

Woken up by the last few posts I fancied a change, and thought I'd have a quick look under the bonnet and see what you've done with the AQ stuff.

So I've messed about tweaked a bit and Here are the results

Done very little really, just light cosmetics.  :roll:

BTW - You seem to have very good air ATM - Last 24h avg    4 µg/m3
I judge my air by how bad the birds are coughing !
Imagine what you will KNOW tomorrow !

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #57 on: August 24, 2020, 02:56:07 AM »
@the beteljuice

 [tup]

Offline big2000

  • Member
  • *
  • Posts: 6
    • meteotaranto.org
Re: Support of "Leuven" Air Quality scripts
« Reply #58 on: September 11, 2020, 11:42:06 AM »
Hi Wim!

Thanks for the script!

It is working "kinda good" :roll:

Having a little problem with saratoga-template...
Do you know why nothing is shown in /wxAqLuft.php while using ws_luftdaten2.php ???

_test2.php and ws_luftdaten2.php are actually working but wxAqLuft.php is not showing anything... :???: (i already changed wxAqLuft.php to show ws_luftdaten2.php but nothing...)?

www.meteotaranto.org/wxAqLuft.php

Thank you,

Silvio. :grin:

« Last Edit: September 11, 2020, 11:46:09 AM by big2000 »

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #59 on: September 11, 2020, 12:35:33 PM »
Hi Wim!

Thanks for the script!

It is working "kinda good" :roll:

Having a little problem with saratoga-template...
Do you know why nothing is shown in /wxAqLuft.php while using ws_luftdaten2.php ???

_test2.php and ws_luftdaten2.php are actually working but wxAqLuft.php is not showing anything... :???: (i already changed wxAqLuft.php to show ws_luftdaten2.php but nothing...)?

www.meteotaranto.org/wxAqLuft.php

Thank you,

Silvio. :grin:
Fairly difficult to debug. On top of that, add  the continuous change and blocking of luftdaten maps and madavi graphs which also needs some work.

So it is easier for you to make a new page to the menu starting with the wxnewpage.php
You can then add the working http://www.meteotaranto.org/luftdaten/ws_luftdaten2.php  in an iframe
And add any other interesting and still working information you may need.

Wim

Offline big2000

  • Member
  • *
  • Posts: 6
    • meteotaranto.org
Re: Support of "Leuven" Air Quality scripts
« Reply #60 on: September 11, 2020, 05:47:04 PM »
Hi Wim!

Thanks for the script!

It is working "kinda good" :roll:

Having a little problem with saratoga-template...
Do you know why nothing is shown in /wxAqLuft.php while using ws_luftdaten2.php ???

_test2.php and ws_luftdaten2.php are actually working but wxAqLuft.php is not showing anything... :???: (i already changed wxAqLuft.php to show ws_luftdaten2.php but nothing...)?

www.meteotaranto.org/wxAqLuft.php

Thank you,

Silvio. :grin:
Fairly difficult to debug. On top of that, add  the continuous change and blocking of luftdaten maps and madavi graphs which also needs some work.

So it is easier for you to make a new page to the menu starting with the wxnewpage.php
You can then add the working http://www.meteotaranto.org/luftdaten/ws_luftdaten2.php  in an iframe
And add any other interesting and still working information you may need.

Wim

Thank you Wim.

I'll try what you said once i'm back home.

Will let you know if it works!

Thank you! :grin:

Silvio

Offline big2000

  • Member
  • *
  • Posts: 6
    • meteotaranto.org
Re: Support of "Leuven" Air Quality scripts
« Reply #61 on: September 12, 2020, 06:26:56 AM »
Dear Wim,

while i'm trying to make work about what you said, i'm now using ws_luftdaten1.php

Good. Now the "big" question:

Is there a way to create a new IQA for like Italy??  :-k :-k

Silvio.
 :grin:

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #62 on: September 12, 2020, 06:37:08 AM »
Dear Wim,
. . .
Is there a way to create a new IQA for like Italy??  :-k :-k
. . .

If you want to use the Italian language
  • Copy ws_luft_langEN.php  and name it ws_luft_langEN.php
  • Change all English text at the right of the =  to Italian texts.
    Do not change any texts at the lef of the = !
Then the texts would all be in Italian.

Wim

Offline big2000

  • Member
  • *
  • Posts: 6
    • meteotaranto.org
Re: Support of "Leuven" Air Quality scripts
« Reply #63 on: September 12, 2020, 06:44:17 AM »
Dear Wim,
. . .
Is there a way to create a new IQA for like Italy??  :-k :-k
. . .

If you want to use the Italian language
  • Copy ws_luft_langEN.php  and name it ws_luft_langEN.php
  • Change all English text at the right of the =  to Italian texts.
    Do not change any texts at the lef of the = !
Then the texts would all be in Italian.

Wim

Dear Wim,

i guess we didn't understand each other :oops:

I'm talking about creating a new IQA Index with the Italian values...

Like the US/NL etc...
 [ You are not allowed to view attachments ]

Thank you :grin:

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #64 on: September 12, 2020, 06:59:49 AM »
Dear Wim,
. . .
Is there a way to create a new IQA for like Italy??  :-k :-k
. . .

If you want to use the Italian language
  • Copy ws_luft_langEN.php  and name it ws_luft_langEN.php
  • Change all English text at the right of the =  to Italian texts.
    Do not change any texts at the lef of the = !
Then the texts would all be in Italian.

Wim

Dear Wim,

i guess we didn't understand each other :oops:

I'm talking about creating a new IQA Index with the Italian values...

Like the US/NL etc...
 [ You are not allowed to view attachments ]

Thank you :grin:
I was not  aware of an Italian AQ-index.

As you can understand adding a totally new index (not the words but the levels) will costs a lot of hours of my spare time.

Sadly the AQ scripts seems not to be used that much  and neither are they appreciated that much.

I should better spent my free time enhancing scripts which are used and valued more.

Wim

Offline big2000

  • Member
  • *
  • Posts: 6
    • meteotaranto.org
Re: Support of "Leuven" Air Quality scripts
« Reply #65 on: September 12, 2020, 07:40:01 AM »
Dear Wim,
. . .
Is there a way to create a new IQA for like Italy??  :-k :-k
. . .

If you want to use the Italian language
  • Copy ws_luft_langEN.php  and name it ws_luft_langEN.php
  • Change all English text at the right of the =  to Italian texts.
    Do not change any texts at the lef of the = !
Then the texts would all be in Italian.

Wim

Dear Wim,

i guess we didn't understand each other :oops:

I'm talking about creating a new IQA Index with the Italian values...

Like the US/NL etc...
 [ You are not allowed to view attachments ]

Thank you :grin:
I was not  aware of an Italian AQ-index.

As you can understand adding a totally new index (not the words but the levels) will costs a lot of hours of my spare time.

Sadly the AQ scripts seems not to be used that much  and neither are they appreciated that much.

I should better spent my free time enhancing scripts which are used and valued more.

Wim

Dear Wim,

i totally understand what you are saying.

I kinda knew that it wasn't an "easy-to-do" thing but i asked anyway...

Thank you for your support!  :grin:

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: Support of "Leuven" Air Quality scripts
« Reply #66 on: April 21, 2021, 03:50:32 AM »
Hi Wim,
I switched my website to phph 8.0.3 yesterday.
Everything is (seems) ok.
I decided to check one of the error files on my site and I saw this error appearing since yesterday :
Code: [Select]
2021/04/20 16:31:00 [error] 16737#0: *7634892 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined array key "accuracy" in /var/www/vhosts/matar.be/httpdocs/weather/sensorpurple3.php on line 133" while reading response header from upstream, client: 81.242.122.10, server: matar.be, request: "POST /weather/sensorpurple3.php HTTP/1.1", upstream: "fastcgi://unix:///var/www/vhosts/system/matar.be/php-fpm.sock:", host: "www.matar.be"

Because I don't know php very well, have you an idea how to solve this?

Thank you
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #67 on: April 21, 2021, 04:31:11 AM »
Hi Wim,
I switched my website to phph 8.0.3 yesterday.
Everything is (seems) ok.
I decided to check one of the error files on my site and I saw this error appearing since yesterday :
Code: [Select]
2021/04/20 16:31:00 [error] 16737#0: *7634892 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined array key "accuracy" in /var/www/vhosts/matar.be/httpdocs/weather/sensorpurple3.php on line 133" while reading response header from upstream, client: 81.242.122.10, server: matar.be, request: "POST /weather/sensorpurple3.php HTTP/1.1", upstream: "fastcgi://unix:///var/www/vhosts/system/matar.be/php-fpm.sock:", host: "www.matar.be"

Because I don't know php very well, have you an idea how to solve this?

Thank you
Seems that one of the seldom used fields is not uploaded anymore by the sensor, missing?
No idea since when, I have to check some other sensors.
PHP-8 does not like missing items and generated a message, in the past it was a null value.

Luckily your settings saved  the last posted message in a cache file, so that made debugging very easy.
Change line 133  in weather/sensorpurple3.php from
Code: [Select]
        $accuracy       = (float) $this_mes['accuracy'];to
Code: [Select]
        $accuracy       = -1;
Wim
« Last Edit: April 21, 2021, 04:44:31 AM by wvdkuil »

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: Support of "Leuven" Air Quality scripts
« Reply #68 on: April 21, 2021, 04:43:40 AM »
Wim,
thank you for your quick response.

Made the correction.
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline PeeGee

  • Member
  • *
  • Posts: 5
Re: Support of "Leuven" Air Quality scripts
« Reply #69 on: July 12, 2021, 03:49:41 AM »

Hi Wim,

Is it also possible to use the AQI script, of course after some adjustments, for the Davis Airlink sensor?

Greetings,
Peter.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #70 on: July 19, 2021, 09:22:17 AM »

Hi Wim,

Is it also possible to use the AQI script, of course after some adjustments, for the Davis Airlink sensor?

Greetings,
Peter.

Sorry, no.
I stopped enhancing all "donation-ware" scripts.
But the Airlink sensor is supported in the free PWS_Dashboard scripts.

Wim

Offline forestedge

  • Member
  • *
  • Posts: 8
    • Newforestweather
Re: Support of "Leuven" Air Quality scripts
« Reply #71 on: January 21, 2022, 12:45:29 PM »
Hi Wim

I have been using the excellent standalone luftdaten scripts without any problems until 1st Jan this year when they stopped updating. I discovered the sensor link url had changed from http://api.luftdaten.info/v1/sensor/####/ to https://data.sensor.community/airrohr/v1/sensor/####/

I updated the ws_luftdaten1.php and _test1.php scripts and the sensor readings updated again ok.
https://www.tottonweather.co.uk/luftdaten/ws_luftdaten1.php

However the ws_luftdaten2.php and _test2 scripts do not update and I cannot see any link in them to change.
https://www.tottonweather.co.uk/luftdaten/ws_luftdaten2.php
I then discovered the luft_24data_esp8266-6535739.arr file had not updated since 1 Jan despite no changes to the sensor config by myself on the custom api. Sensor has been rebooted and running on latest firmware.

The PWS luftdaten popup on https://www.tottonweather.co.uk/homeweather-station/ still updates ok.

Any help appreciated.

Thanks
Roger


Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #72 on: January 21, 2022, 01:01:37 PM »
. . .
However the ws_luftdaten2.php and _test2 scripts do not update and I cannot see any link in them to change.
https://www.tottonweather.co.uk/luftdaten/ws_luftdaten2.php
I then discovered the luft_24data_esp8266-6535739.arr file had not updated since 1 Jan despite no changes to the sensor config by myself on the custom api. Sensor has been rebooted and running on latest firmware.
. . .

The luftdaten2 receive script sensorluft2.php accepts a HTTP post from your sensor.

Your website is using https and probably re-directs all incoming http requests?

Please check your Luftdaten sensor setup.
If it still uses http to access your server
=> the access is redirected by your webserver and the sensor data is lost
==> according to the http-to-https standards the http payload is  "untrusted"

So the sensorluft2.php gets an access with empty data and discards it.

Wim

Offline forestedge

  • Member
  • *
  • Posts: 8
    • Newforestweather
Re: Support of "Leuven" Air Quality scripts
« Reply #73 on: January 23, 2022, 12:42:23 PM »

Quote
Your website is using https and probably re-directs all incoming http requests?

Yes there has been a redirect for over a year when I went to https so why did it not reject before [ You are not allowed to view attachments ] ?
I have tried changing the custom api to https as screenshot attached but no change. The password box continues to show "password" so don't know if it is retaining it.

Seems odd that the luftdaten api had to be updated at the same time. From the airrohr forum a post said there was a redirect for 2 years which presumably expired.


Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #74 on: April 16, 2022, 03:18:40 AM »
Good morning wim
I'm trying to get the _test2.php script to work
but I get the error Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /web/htdocs/www.pomeziameteo.it/home/luftdaten/ws_luftdaten2.php on line 106
I have configured this in my detector

also tried to put the .htaccess file as you recommended but nothing
do you have any idea where am i wrong?  :oops:
Thank you