Weather34 TEMPLATE
Moderator: Mattk
-
- Platinum Boarder
- Posts: 1693
- Joined: Tue Mar 28, 2017 6:57 am
Re: Weather34 TEMPLATE
hmm Turkish beer is not good its all out of a tin or bottle ...German , English or European beer from the barrel is bliss and not about quantity but quality.. ..
thanks it was another one of my oversights for non metric forgot to check ..sorry for the inconvenience ..Brian
thanks it was another one of my oversights for non metric forgot to check ..sorry for the inconvenience ..Brian
Simple Update February 2023 for Weather34 Aurora MKII
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
- prestwickwx
- Platinum Boarder
- Posts: 510
- Joined: Sat Aug 23, 2014 3:28 pm
- Location: Myrtle Beach, SC USA
- Contact:
Re: Weather34 TEMPLATE
Brian,
All fixed. Ah yes - German Beer - the best.
. Spent good times there years ago.
Chuck
All fixed. Ah yes - German Beer - the best.

Chuck
- prestwickwx
- Platinum Boarder
- Posts: 510
- Joined: Sat Aug 23, 2014 3:28 pm
- Location: Myrtle Beach, SC USA
- Contact:
Re: Weather34 TEMPLATE
Hi Brian,
One more minor issue. The Air Quality module seems to be getting the wrong word for AQI >50. I looked at the file and Language, but did not see anything. Also, reads correct in the Portrait view Module.
Best wishes,
Chuck
One more minor issue. The Air Quality module seems to be getting the wrong word for AQI >50. I looked at the file and Language, but did not see anything. Also, reads correct in the Portrait view Module.
Best wishes,
Chuck
-
- Junior Boarder
- Posts: 21
- Joined: Thu Dec 26, 2019 3:54 am
- Location: Tacoma, WA. USA
- Contact:
Re: Weather34 TEMPLATE
Brian,
I like the addition of the AQI module which supports PM2.5 monitors using slot 175 of the Meteobridge API.
However, it looks like the module is displaying the particle count, and not the AQI value.
I also have to map air0!0pm to air0pm for it to work at all.
The Meteobridge mapping seems to indicate that air0pm is PM10, and air1pm is PM2.5.....
Not sure that really makes any difference as long as it is working.
Any chance that the module might also be released in the larger size (similar to the Davis module) so that air quality can be displayed on a smartphone?
Air Quality on the US West Coast has been horrible, I am in the Pacific Northwest.
We have seen outdoor PM2.5 AQI values exceeding 300!! It would be convenient to have AQI in a 'portable' form.
Ron B.
I like the addition of the AQI module which supports PM2.5 monitors using slot 175 of the Meteobridge API.
However, it looks like the module is displaying the particle count, and not the AQI value.
I also have to map air0!0pm to air0pm for it to work at all.
The Meteobridge mapping seems to indicate that air0pm is PM10, and air1pm is PM2.5.....
Not sure that really makes any difference as long as it is working.
Any chance that the module might also be released in the larger size (similar to the Davis module) so that air quality can be displayed on a smartphone?
Air Quality on the US West Coast has been horrible, I am in the Pacific Northwest.
We have seen outdoor PM2.5 AQI values exceeding 300!! It would be convenient to have AQI in a 'portable' form.
Ron B.
Last edited by RABrand on Fri Oct 09, 2020 4:27 pm, edited 1 time in total.
-
- Platinum Boarder
- Posts: 1693
- Joined: Tue Mar 28, 2017 6:57 am
Re: Weather34 TEMPLATE
Good Morning
ok reworked Air Quality modules and removed the PM 2.5 default word , just replaced with AQI as I have no idea what particle matter is being used for primary so this is relatively easy to compile without having another option to setup.
Yes I have just added a large module to the MB assigned aq sensor to appear in mobile view the setup option now has the additional file
weather34-airquality-mod-mb.php so there are now three large modules supporting Air quality
weather34-airquality-mod.php is the original purple air/luftdaten module
weather34-airqualitydavis-mod.php is the Davis airlink module
weather34-airquality-mod-mb.php is the meteobridge assigned to use position 175 in the API..
@Chuck fixed another one of stupid silly oversights ..
the update 09-10-2020 contains
(*Update for 9th October 06:50)
* Adds newer option to use Air Quality in mobile view ref Ron B.
* Air Quality description anomaly fix ref Chuck
* Adds new large Air Quality for Air Quality MB assigned sensor
* Rework Air Quality layouts to match each other
* Wind Indicator non metric (mph) fix ref Chuck
* Adds setup option + new small module for meteobridge assigned Air Quality
screenshots of Air Quality options...have a cool and a relaxing weekend ...
ok reworked Air Quality modules and removed the PM 2.5 default word , just replaced with AQI as I have no idea what particle matter is being used for primary so this is relatively easy to compile without having another option to setup.
Yes I have just added a large module to the MB assigned aq sensor to appear in mobile view the setup option now has the additional file
weather34-airquality-mod-mb.php so there are now three large modules supporting Air quality
weather34-airquality-mod.php is the original purple air/luftdaten module
weather34-airqualitydavis-mod.php is the Davis airlink module
weather34-airquality-mod-mb.php is the meteobridge assigned to use position 175 in the API..
@Chuck fixed another one of stupid silly oversights ..
the update 09-10-2020 contains
(*Update for 9th October 06:50)
* Adds newer option to use Air Quality in mobile view ref Ron B.
* Air Quality description anomaly fix ref Chuck
* Adds new large Air Quality for Air Quality MB assigned sensor
* Rework Air Quality layouts to match each other
* Wind Indicator non metric (mph) fix ref Chuck
* Adds setup option + new small module for meteobridge assigned Air Quality
screenshots of Air Quality options...have a cool and a relaxing weekend ...
Simple Update February 2023 for Weather34 Aurora MKII
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
- prestwickwx
- Platinum Boarder
- Posts: 510
- Joined: Sat Aug 23, 2014 3:28 pm
- Location: Myrtle Beach, SC USA
- Contact:
Re: Weather34 TEMPLATE
Brian,
Working fine.
Best wishes,
Chuck
Working fine.

Best wishes,
Chuck
-
- Junior Boarder
- Posts: 21
- Joined: Thu Dec 26, 2019 3:54 am
- Location: Tacoma, WA. USA
- Contact:
Re: Weather34 TEMPLATE
Yes, it works nicely, and is (I think) displaying particle count... Not AQI.
I think I confused the issue when I brought up PM2.5 and PM10....
It seems as though the Meteobridge API position 175 always contains the PM2.5 particle count from an Ecowitt PM2.5 unit. (What I have)
To convert the particle count in slot 175 to the actual Air Quality Index (AQI) requires conversion....
I am not familiar with php code, but I believe the code below performs the conversion from particle count to AQI??
I took this snippet from one of the modules 'weather34-airquality.php'.
I cannot express how appreciative I am of the effort, time, and quick responses you provide to this project!
Thanks!
Ron B.
https://hillsdale-98404.com
I think I confused the issue when I brought up PM2.5 and PM10....
It seems as though the Meteobridge API position 175 always contains the PM2.5 particle count from an Ecowitt PM2.5 unit. (What I have)
To convert the particle count in slot 175 to the actual Air Quality Index (AQI) requires conversion....
I am not familiar with php code, but I believe the code below performs the conversion from particle count to AQI??
I took this snippet from one of the modules 'weather34-airquality.php'.
Code: Select all
// PURPLE AIR additional conversion script included by Andrew Billits 24 April 2018
function pm25_to_aqi($pm25)
{
if ($pm25 > 500.5) {
$aqi = 500;
} elseif ($pm25 > 350.5 && $pm25 <= 500.5) {
$aqi = map($pm25, 350.5, 500.5, 400, 500);
} elseif ($pm25 > 250.5 && $pm25 <= 350.5) {
$aqi = map($pm25, 250.5, 350.5, 300, 400);
} elseif ($pm25 > 150.5 && $pm25 <= 250.5) {
$aqi = map($pm25, 150.5, 250.5, 200, 300);
} elseif ($pm25 > 55.5 && $pm25 <= 150.5) {
$aqi = map($pm25, 55.5, 150.5, 150, 200);
} elseif ($pm25 > 35.5 && $pm25 <= 55.5) {
$aqi = map($pm25, 35.5, 55.5, 100, 150);
} elseif ($pm25 > 12 && $pm25 <= 35.5) {
$aqi = map($pm25, 12, 35.5, 50, 100);
} elseif ($pm25 > 0 && $pm25 <= 12) {
$aqi = map($pm25, 0, 12, 0, 50);
}
return $aqi;
}
function map($value, $fromLow, $fromHigh, $toLow, $toHigh)
{
$fromRange = $fromHigh - $fromLow;
$toRange = $toHigh - $toLow;
$scaleFactor = $toRange / $fromRange;
// Re-zero the value within the from range
$tmpValue = $value - $fromLow;
// Rescale the value to the to range
$tmpValue *= $scaleFactor;
// Re-zero back to the to range
return $tmpValue + $toLow;
}
Thanks!
Ron B.
https://hillsdale-98404.com
Last edited by RABrand on Fri Oct 09, 2020 6:44 pm, edited 1 time in total.
-
- Platinum Boarder
- Posts: 1693
- Joined: Tue Mar 28, 2017 6:57 am
Re: Weather34 TEMPLATE
Hello yes
ive been running it with my new Davis Unit I set up yesterday as the Davis is only outputting PM values as it is designed so I added that script to now reflects a relative value to my other unit and also a relative value to a local municipality unit installed 7km away .so something for next week
as I will also compile charts for day,month,year now its in front of me but I need to build a waterproof seal to the power input..
if you cant wait and feel confident of editing the 2 new files simply add/replace
weather34-airquality-mb.php
weather34-airquality-mod-mb.php
simply replace this
with

as I will also compile charts for day,month,year now its in front of me but I need to build a waterproof seal to the power input..
if you cant wait and feel confident of editing the 2 new files simply add/replace
weather34-airquality-mb.php
weather34-airquality-mod-mb.php
simply replace this
Code: Select all
<?php include('livedata.php');
date_default_timezone_set($TZ);
####################################################################################################
# CREATED FOR HOMEWEATHERSTATION MB SMART TEMPLATE #
# https://weather34.com/homeweatherstation/index.html #
# #
# Revised: October 2020 Air Qulaity #
# #
# https://www.weather34.com #
####################################################################################################
$w34aqi = $meteobridgeapi[175];
?>
Code: Select all
<?php include('livedata.php');
date_default_timezone_set($TZ);
####################################################################################################
# CREATED FOR HOMEWEATHERSTATION MB SMART TEMPLATE #
# https://weather34.com/homeweatherstation/index.html #
# #
# Revised: October 2020 #
# #
# https://www.weather34.com #
####################################################################################################
// AIR QUALITY based on original additional conversion script by Andrew Billits 24 April 2018
function pm25_to_aqi($pm25)
{
if ($pm25 > 500.5) {
$aqi = 500;
} elseif ($pm25 > 350.5 && $pm25 <= 500.5) {
$aqi = map($pm25, 350.5, 500.5, 400, 500);
} elseif ($pm25 > 250.5 && $pm25 <= 350.5) {
$aqi = map($pm25, 250.5, 350.5, 300, 400);
} elseif ($pm25 > 150.5 && $pm25 <= 250.5) {
$aqi = map($pm25, 150.5, 250.5, 200, 300);
} elseif ($pm25 > 55.5 && $pm25 <= 150.5) {
$aqi = map($pm25, 55.5, 150.5, 150, 200);
} elseif ($pm25 > 35.5 && $pm25 <= 55.5) {
$aqi = map($pm25, 35.5, 55.5, 100, 150);
} elseif ($pm25 > 12 && $pm25 <= 35.5) {
$aqi = map($pm25, 12, 35.5, 50, 100);
} elseif ($pm25 > 0 && $pm25 <= 12) {
$aqi = map($pm25, 0, 12, 0, 50);
}
return $aqi;
}
function map($value, $fromLow, $fromHigh, $toLow, $toHigh)
{
$fromRange = $fromHigh - $fromLow;
$toRange = $toHigh - $toLow;
$scaleFactor = $toRange / $fromRange;
// Re-zero the value within the from range
$tmpValue = $value - $fromLow;
// Rescale the value to the to range
$tmpValue *= $scaleFactor;
// Re-zero back to the to range
return $tmpValue + $toLow;
}
$w34aqi = number_format(pm25_to_aqi($meteobridgeapi[175]), 1);
//$w34aqi = $meteobridgeapi[175];
?>
Simple Update February 2023 for Weather34 Aurora MKII
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
-
- Junior Boarder
- Posts: 21
- Joined: Thu Dec 26, 2019 3:54 am
- Location: Tacoma, WA. USA
- Contact:
Re: Weather34 TEMPLATE
Thanks Brian!!
As I said, I am NOT a php programmer, but have done some assembly and coding with various forms of BASIC.
I shouldn't have any trouble trying out your fix... Your speedy reply is amazingly quick!
I looked at my post, and realized I had left the 'map' function out of the snippet.
By the time corrected it and re-posted, you had already replied with the fix!
I am looking forward to the 'official' update...
Thanks again for your exceptional effort!
Have a great weekend,
Ron B.
https://hillsdale-98404.com
As I said, I am NOT a php programmer, but have done some assembly and coding with various forms of BASIC.
I shouldn't have any trouble trying out your fix... Your speedy reply is amazingly quick!
I looked at my post, and realized I had left the 'map' function out of the snippet.
By the time corrected it and re-posted, you had already replied with the fix!
I am looking forward to the 'official' update...
Thanks again for your exceptional effort!
Have a great weekend,
Ron B.
https://hillsdale-98404.com
Last edited by RABrand on Fri Oct 09, 2020 9:19 pm, edited 1 time in total.
-
- Junior Boarder
- Posts: 21
- Joined: Thu Dec 26, 2019 3:54 am
- Location: Tacoma, WA. USA
- Contact:
Re: Weather34 TEMPLATE
I made the edits (after doing a backup!), and it works great!
Thanks again....

Ron B.
https://hillsdale-98404.com
Thanks again....

Ron B.
https://hillsdale-98404.com
-
- Gold Boarder
- Posts: 182
- Joined: Sat Mar 07, 2020 11:54 pm
- Location: Buedelsdorf, SH Germany
- Contact:
Luftdaten-Sensor don't work..
Hello, Brian,
Today I started using the Air-Quality Sensor from "Luftdaten.info" i.
particulate matter sensor SDS011
Sensor ID: 50525 (show on card)
Last update: 09.10.2020, 19:55:43
Fine dust 10 µm: 4.43 µg/m³
Fine dust 2.5 µm: 2.10 µg/m³
So it works and also sends data to the sensor network of "Luftdaten.info..
Only on your template it will not work. What i have do wrong? Latest Update is installed (Oct 9, 2020)
In some other Templates (Leuuven, older W34 NANO SD-Template) it works fine with similar setup.
Have succesfully integrated the sensor to my MeteoBridge (additional Station #1), but with the airquality-mb-module it also don't work..
Thanks for your advice,
best regards
Today I started using the Air-Quality Sensor from "Luftdaten.info" i.
particulate matter sensor SDS011
Sensor ID: 50525 (show on card)
Last update: 09.10.2020, 19:55:43
Fine dust 10 µm: 4.43 µg/m³
Fine dust 2.5 µm: 2.10 µg/m³
So it works and also sends data to the sensor network of "Luftdaten.info..
Only on your template it will not work. What i have do wrong? Latest Update is installed (Oct 9, 2020)
In some other Templates (Leuuven, older W34 NANO SD-Template) it works fine with similar setup.
Have succesfully integrated the sensor to my MeteoBridge (additional Station #1), but with the airquality-mb-module it also don't work..

Thanks for your advice,
best regards
-
- Platinum Boarder
- Posts: 1693
- Joined: Tue Mar 28, 2017 6:57 am
Re: Weather34 TEMPLATE
Good morning
I just tested the luftdaten stuff with your ID 50525 in my demo and everything is fine. NO changes have been made to LUFTDATEN scripts for months however that said I don't use luftdaten but numerous users do but I have not seen any reports or issues raised for months last I recall was a API url change.
could be something as simple as a hidden space on the end of the ID in the setup , commonly happens when copy and paste is used .seen it numerous times with things like API keys etc ..
your data returned in the API call made this morning for demo stored in the file jsondata/luftdaten.txt
see also and live example https://www.ilfracombeweather.net/console/index.php that is using luftdaten for Air Quality
screenshot of data your data
I just tested the luftdaten stuff with your ID 50525 in my demo and everything is fine. NO changes have been made to LUFTDATEN scripts for months however that said I don't use luftdaten but numerous users do but I have not seen any reports or issues raised for months last I recall was a API url change.
could be something as simple as a hidden space on the end of the ID in the setup , commonly happens when copy and paste is used .seen it numerous times with things like API keys etc ..
your data returned in the API call made this morning for demo stored in the file jsondata/luftdaten.txt
Code: Select all
[{"sensordatavalues":[{"value":"2.10","value_type":"P1","id":4715340293},{"value":"0.57","value_type":"P2","id":4715340317}],"location":{"longitude":"9.66316223145","altitude":"13.2","country":"DE","latitude":"54.32018412738","exact_location":1,"id":36474,"indoor":0},"timestamp":"2020-10-10 05:17:33","sensor":{"sensor_type":{"manufacturer":"Nova Fitness","name":"SDS011","id":14},"pin":"1","id":[b]50525[/b]},"sampling_rate":null,"id":2183545621},{"sensordatavalues":[{"value":"1.63","value_type":"P1","id":4715292269},{"value":"0.90","value_type":"P2","id":4715292270}],"location":{"longitude":"9.66316223145","altitude":"13.2","country":"DE","latitude":"54.32018412738","exact_location":1,"id":36474,"indoor":0},"timestamp":"2020-10-10 05:15:08","sensor":{"sensor_type":{"manufacturer":"Nova Fitness","name":"SDS011","id":14},"pin":"1","id":50525},"sampling_rate":null,"id":2183523534}]
screenshot of data your data
Simple Update February 2023 for Weather34 Aurora MKII
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
-
- Gold Boarder
- Posts: 182
- Joined: Sat Mar 07, 2020 11:54 pm
- Location: Buedelsdorf, SH Germany
- Contact:
Re: Weather34 TEMPLATE
Good Morning Brian,
I do not have the file "luftdaten.txt" in my json directory in the template on my server. I have also looked 10x in the setup, no spaces in the ID... What can I do now? Should I maybe download the last update again and have it installed, maybe something went wrong?
I'm a bit helpless
, it seems as if a file in the template-folder is missing for execution?
i can retrieve the json-data from the sensor itself in my local network:
unfortunately also after the Update from 10.10.2020 it don't works for me 
Best regards
Michael
I do not have the file "luftdaten.txt" in my json directory in the template on my server. I have also looked 10x in the setup, no spaces in the ID... What can I do now? Should I maybe download the last update again and have it installed, maybe something went wrong?
I'm a bit helpless

i can retrieve the json-data from the sensor itself in my local network:
Code: Select all
{"software_version": "NRZ-2020-129", "age":"73", "sensordatavalues":[{"value_type":"SDS_P1","value":"5.90"},{"value_type":"SDS_P2","value":"1.15"},{"value_type":"BME280_temperature","value":"7.89"},{"value_type":"BME280_pressure","value":"101340.47"},{"value_type":"BME280_humidity","value":"84.90"},{"value_type":"samples","value":"4330474"},{"value_type":"min_micro","value":"33"},{"value_type":"max_micro","value":"20073"},{"value_type":"signal","value":"-83"}]}

Best regards
Michael
-
- Platinum Boarder
- Posts: 1693
- Joined: Tue Mar 28, 2017 6:57 am
Re: Weather34 TEMPLATE
think your answered your own question ..file doesnt exists .. either create an empty file called luftdaten.txt or check server config for creating a file that doesnt exist. stationcron.php is the primary file for calling external api data. todays update does nothing for luftdaten data it just fixes an alignment in german sunrise,set .. you need to create the file luftdaten.txt and wait for the stationcron.php to run then you will be ok.
another example of luftdaten working fine http://ringwoodweather.ddns.net/Weather34/index.php note he has multiple air quality sensors but the aqi icon produces a luftdaten screen..
another example of luftdaten working fine http://ringwoodweather.ddns.net/Weather34/index.php note he has multiple air quality sensors but the aqi icon produces a luftdaten screen..
Simple Update February 2023 for Weather34 Aurora MKII
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
https://www.mediafire.com/file/jk4lj3mq ... 2.zip/file
Weather34 Master Download Aurora MKII
https://download.meteobridge.com/files/Weather34.zip
-
- Gold Boarder
- Posts: 182
- Joined: Sat Mar 07, 2020 11:54 pm
- Location: Buedelsdorf, SH Germany
- Contact:
Re: Weather34 TEMPLATE
Brian,
Now I copied an empty "luftdaten.txt" into the jsondata directory on my server. I'm curious if it will work after the next call of stationcron.
I will report it, thank you for your advice!
regards
Mike
Now I copied an empty "luftdaten.txt" into the jsondata directory on my server. I'm curious if it will work after the next call of stationcron.

I will report it, thank you for your advice!
regards
Mike