Keep It Simple St*p*d - 2023 version discussion and download

Original topic Keep It Simple St*p*d - discussion and download

I was trying to find a solution for "to much information and rubbish in a far to small space" The PWS_Dashboard is not always easy readable, even with the &KISS and &round option switched on.

And, on the other hand, I am to old to read the small print of a decent console also.
They cram to much sensors, different colours, graphs in a 7" screen
I just got a WH2320-console from the kids to add to my working area so I can read the weather-values, but even that one looks chaotic to me.

Solution:
I use a spare (= old) iPad with the most valuable items in a boring layout.
Just the station weather-values with todays high-lows.


The original topic is locked. Therefor I add the download for the “simple” scripts current version in this new topic.
For all information and some very nice screenshots, browse the old topic.
All new questions, post them here.

P.S. The “old downloads” seemed not to work as it should . But I was notified with an e-mail.
@ALL Use the forum, do not use PM or e-mail for problems, sometimes a wait time occurs when I am not at home.


simple_2023-01-31.zip (10 KB)

I use the Davis Air monitor and pwsWD displays the data on my site : https://travelingrvwx.com/pwsWD/index.php

Simple does not seem to picking up the needed parameters to "enable’ the frame lines : https://travelingrvwx.com/pwsWD/simple.php

I don’t understand why pwsWD is able to display the AQI data but it isn’t working in Simple.

I do not understand the question

I don't understand why pwsWD is able to display the AQI data but it isn't working in Simple.

Hi,
I will try to explain

simple.php displays all “original”-weather-station values.

Those are the values you can see in the debug console . . /PWS_module_test.php => middle row-right-button “Live data values”
The values are retrieved with the . . ./_data.php?ajax script. That is the same script as used by other add-ons

There are multiple blocks on the complete PWS_Dashboard, such as forecasts, sun/moon which do not use the data received from the weather-station.
The Davis-Air monitor is not an integrated part of your WeatherFlow-station. Therefor the AQ-block loads that data from another source.

As you can see on the screenshot in the first post, AQ data from the main-weather-station is displayed.

Wim

1 Like

So my problem stems from using the Weatherflow api which limits me to the live data from the station only.

Could I change pwsWD to use a different data source and have the AQI data available? I believe I could use WD as the source but not sure what I would lose. I know there was a reason I decided to use the WF-api for data collection but I don’t remember what it was.

Dan

@ALL
With the WeatherFlow-API

When using a non-Weatherprogram-API such as WeatherFlow, WU, ambient, WL.com there is no “weather-program” runnnig 24/7 combining different devices into 1 “upload/download” stream.

The PWS_dashboard can use the different extra devices by treating them seperate. But the code is only for PWS_Dashboard itself, not for simple.php and the _data users.

There is a second possibility, using the “extra-sensors”-upload. https://pwsdashboard.com/documentation2012/36_extra_sensors.pdf

@NorCal Dan
As your “problem” occurs with others also, I will take a fresh look at this and try to make a second source of data without using a weather-program.
But it needs some spare time, probably this weekend / next week.

Wim

Appreciate you taking time to give this a look.

What I find confusing is I have 2 instances of WD running, one for the Vantage VP2 and the other for the Tempest station, and both instances of WD “know” the AQI values since it plots on the graph, but I cannot figure out a way to include that data. Hopefully you can find a solution.

The communication between WD and a template such as PWS_Dashboard is governed by the contents of the upload-file.
For PWS_Dashboard there are 2 upload-files possible either clientraw.txt of the wd-api-file.

Both do not have those extra information.

But you could “ask” WD to upload an extra file with those values your are missing from the standard file.
That is described here: https://pwsdashboard.com/documentation2012/36_extra_sensors.pdf
The “extra_wd.txt” file is in the download and contains in lines 59-62 four PM25_crnt sensors

|pm25_crnt1|text|--|!
|pm25_crnt2|text|--|!
|pm25_crnt3|text|--|!
|pm25_crnt4|text|--|!
#
|lightning|light|%lighteningcountmidnight%|!
|lightningtime|wdtd|%lighteningcountlasttime%|!

I myself can not run WD so you have to find the correct WD names %xxxx% for the PM 2.5 value of your PM2.5 sensor.
Delete all lines you do not need.
When you succeed uploading that file with WD post that here, I can check if it is correct.

Wim

I did that some time ago, so that I could add extra values directly to xxx_livedata.php, and then it is easy to use them in the Dashboard and in Simple.

The "extra_wd.txt" file is in the download and contains in lines 59-62 four PM25_crnt sensors
|pm25_crnt1|text|--|!
|pm25_crnt2|text|--|!
|pm25_crnt3|text|--|!
|pm25_crnt4|text|--|!

I myself can not run WD so you have to find the correct WD names %xxxx% for the PM 2.5 value of your PM2.5 sensor.

Only the PM 2.5 values?

WD tagslist.txt has a number of AQ values (lines 1358-1444), but the last 4 look promising for a Davis sensor:

%purpleair2_5davis%..............Value of 2.5 micron particle measure from Davis air sensor
%purpleair1_0davis%..............Value of 1.0 micron particle measure from Davis air sensor
%purpleair10_0davis%.............Value of 10.0 micron particle measure from Davis air sensor
%purpleairaqidavis%...............AQI reading from Davis Air sensor

Owners of different sensors may want to find/use other more appropriate tags.

https://travelingrvwx.com/pwsWD/airqualitydavis.txt

Found this file already being created by WD. Not sure if it contains the needed data so if you could take a look Wim I would appreciate it and let me know.

Dan

That would mean an “extra source of data” with a new structure/naming for AQ-data. Not based on any current standard structure.
For that file I have to write a script to process that data, test the script and maintain it even if the structure is changed by WD.
And that for only 1 user and even not for that users main or second website.

There are two solutions posted above.
First one: Use the already “pws-standard” extra data set and let WD upload that file.
Multiple dashboard users are already using that file, so there is knowledgable help from others also.

Second one: The same data in its original structure is already [color=blue][u][b]in your json folder[/b][/u][/color]. That data is used for the AQ-Davis block.
There is already a script . . ./pwsWD/cvt.php which can be used to convert a new file-format to the standard extra-data file format.
Multiple users have adapted that script to add their own “un-supported extra-sensors” to the weather-data.
Probably already also for a Davis-AQ sensor, who knows.

What I can do, if free-time is available, adapt the cvt.php to read your jsondata/wlcomv2API130329.json file and generate the lines in the extra-data format needed to get the Davis-AQ data from the json file into your station-weather-data

This would be a more general solution as more users could benefit if they have a separate Davis-AQ sensor but are using another weather-data source.

Wim

Ok, it’s working now. See: https://travelingrvwx.com/pwsWD/extra_wd.txt and https://travelingrvwx.com/pwsWD/index.php?frame=Simple&theme=user&lang=en-us&units=us

Well it’s reading something but I have no idea where the numbers are coming from…I will work on this more later, tired of looking at it today…

I set Simple to display 4 wide but it’s ignoring me for some reason.

For others to understand what the values are, could you please post the file your Wd is using?
That is the file with the %xxxxx% keys.

Thanks,
Wim

# weatherdisplay extra tags
#actTime|unix|1:38:36 2/4/2023|!   # to be added
# 

|pm25_crnt1|aqi1|%purpleair2_5davis%|!
|pm25_crnt2|aqi2|%purpleair1_0davis%|!
|pm25_crnt3|aqi3|%purpleair10_0davis%|!
|pm25_crnt4|aqi4|%purpleairaqidavis%|!
#

I modified simple.php to get the correct readings in the boxes: TravelingRVWx

#| ---------------- large value + header text----------------|---left value+arrow or text--|----- right value+arrow or text --  |
#|  weather item  |  header text   | extra | unit-easyweather| low/left item | arrow/text  | right /high item   | arrow/text    |                           
#
 | pm25_crnt1     | 2.5 micron     | -     | aqhi_type       | pm25_a_aqi1   | average     | pm25_crnt1         | um<sup>3</sup>|
 | pm25_crnt2     | 1.0 micron     | -     | aqhi_type       | pm25_a_aqi2   | average     | pm25_crnt2         | um<sup>3</sup>|
 | pm25_crnt3     | 10.0 micron    | -     | aqhi_type       | pm25_a_aqi3   | average     | pm25_crnt3         | um<sup>3</sup>|
 | pm25_crnt4     | AQI reading    | -     | aqhi_type       | pm25_a_aqi4   | average     | pm25_crnt4         | um<sup>4</sup>| 

# | co2            | co2            | ppm   |                 | co2_24h       | average     | pm25_24avgco2      | pm25 AQI

Original simple.php code: ERROR 404 - PAGE NOT FOUND

#| ---------------- large value + header text----------------|---left value+arrow or text--|----- right value+arrow or text --  |
#|  weather item  |  header text   | extra | unit-easyweather| low/left item | arrow/text  | right /high item   | arrow/text    |                           
#
 | pm25_c_aqi1    | AQ sensor 1    | -     | aqhi_type       | pm25_a_aqi1   | average     | pm25_crnt1         | um<sup>3</sup>|
 | pm25_c_aqi2    | AQ sensor 2    | -     | aqhi_type       | pm25_a_aqi2   | average     | pm25_crnt2         | um<sup>3</sup>|
 | pm25_c_aqi3    | AQ sensor 3    | -     | aqhi_type       | pm25_a_aqi3   | average     | pm25_crnt3         | um<sup>3</sup>|
 | pm25_c_aqi4    | AQ sensor 4    | -     | aqhi_type       | pm25_a_aqi4   | average     | pm25_crnt4         | um<sup>4</sup>|

 | co2            | co2            | ppm   |                 | co2_24h       | average     | pm25_24avgco2      | pm25 AQI      |

Dan

Reference https://travelingrvwx.com/pwsWD/simple_orig.php (your original code) displays my sensor value (lower right corner of the boxes) as the um3 value. But then it modifies/changes that um3 value that is displayed in the box as the current reading.

Could you explain why the numbers are being modified?

Dan

I really have no idea what you are doing.

The extra-data should only upload “station-sensor” data if you have extra sensors not supported by your normal upload.
All other data can also be uploaded and used in simple, but you should use non-existent names for that data.

Each station-AQ-sensor (there are up to 4 possible) has two allowable data-items: pm25_crnt1 (to 4) and pm25_24avg1 (to 4)
That is the PM2.5 uom for current measurement and the 24-hour average of the measurements
The dashboard script wil generate two new items pm25_c_aqi1 and pm25_a_aqi1 which contain the calculated AQ-index (EPA, EEA a.o.) according to the settings

You have to add for each AQ sensor exactly two lines in the extra-data file which should look like this in your situation
|pm25_crnt1|text|%purpleair2_5davis%|!
|pm25_24avg1 |text|% WD 24 hr uom pm2-5 ??? %|!

Other sensor data-items PM1, PM10 are not used at all
The AQ-index is calculated by the scripts as PWS_dashboard supports multiple AQ-indexes.

===
Now if you want to add blocks with your own data, give them whatever sensor-name you want, but never an already used name in the current PWS_dashboard range.

|my_davis_pm10_c|text|%purpleair10_0davis%|!
|my_davis_pm25_c|text|%purpleair2_5davis%|!
|my_davis_pm1_c|text|%purpleair1_0davis%|!
|my_davis_AQI|text|%purpleairaqidavis%|! // for what PM is this calculated ??

As long as WeatherDisplay only has 1 AQ-index you use up to 2blocks in simple
Normally one would use 1, with the AQ-index for 24-hour average with the current at left and and 24-hr uom at right.
But using two is also possible displaying both current and 24hr AQ-indexes.

Hope this clarifies the workings.

Recapitulation:
You can have three values in every simple block
You can add as many weather-items to the weather-array using extra-data or other add-on scripts such as cvt.php
The _data-php will normally use the weather-array values as-is.
For AQ there will by also added the AQ-index value based on pm2.5 current and average values when the standard sensor names are used.

Apparently I have not done a good job explaining what I am experiencing when attempting to implement simple.php to include my Davis air sensor readings.

Each [b]station[/b]-AQ-sensor (there are up to 4 possible) has two allowable data-items: pm25_crnt1 (to 4) and pm25_24avg1 (to 4)

This are the tags available on my station from WD and my Davis air sensor:

%purpleair2_5davis%..............Value of 2.5 micron particle measure from Davis air sensor
%purpleair1_0davis%..............Value of 1.0 micron particle measure from Davis air sensor
%purpleair10_0davis%.............Value of 10.0 micron particle measure from Davis air sensor
%purpleairaqidavis%...............AQI reading from Davis Air sensor

As stated on the Davis site: The air quality sensor measures particulates (PM) in the air by size: PM1, PM2.5, and PM10.
All I want to do is have simple.php display the readings from the air sensor just like any other sensor on my station.

Now if you want to add blocks with your own data, give them whatever sensor-name you want, but never an already used name in the current PWS_dashboard range.

I will keep reading this again and again until it sinks in to my brain. I believe the answer I need is in this part of your reply but it still escapes me at the moment.

For those following this thread here is what I have done so far. WD has been configured to “grab” the data from the Davis air sensor and assign those values in separate tags. I create a plain text file of those tags and have WD converting the tags to the actual values and ftp that “extra” file to my webserver. I configured pwsWD to “read” the extra file in easyweathersetup.

I believe Wim has provided the answer in his last reply (if I can figure out what he is telling me). I suspect not many users are using simple.php and the Davis air sensor, so rather than hijack this thread I am going to abandon my ramblings here while I continue to work on my setup.

Hello,
I downloaded the simple_2023-01-31 and installed it on my web server, unfortunately I only get a white page when I open it. (https://www.wetter-kreuth.at/simple.php) I have the PHP 8.2 version.
I am grateful for any help.

Best regards

Hi,

The simple and _data scripts “2023-01-31 version” form the first post are identical to the current version of the scripts (2023-02-15) of the main PWS_Dashboard scripts.
No need to download the “2023-01-31 version” if your website is up-to-date using PWS_updates.php.

===
You can always test any script using _test.php
https://www.wetter-kreuth.at/_test.php?test=simple.php

These are the errors:

Fatal error: Uncaught TypeError: Unsupported operand types: string - int in /home/.sites/404/site1806/web/AQ_shared.php:111
Stack trace:
#0 /home/.sites/404/site1806/web/_data.php(61): pm25_to_aqi('--')
#1 /home/.sites/404/site1806/web/simple.php(102): include('/home/.sites/40...')
#2 /home/.sites/404/site1806/web/_test.php(17): include('/home/.sites/40...')
#3 {main}
  thrown in /home/.sites/404/site1806/web/AQ_shared.php on line 111

Can you explain what you are trying to accomplish?

Thanks,
Wim

Hallo, thanks for the tip with the script test. just updated the data. I can search for something with error messages. Thanks very much.

Your extra upload file
https://www.wetter-kreuth.at/PWS_listfile.php?file=daten/extra.txt&type=txt
contains these (un-used) sensors with invalid data --

PWS_extra_data.php (59) processing: |pm25_crnt1|text|--|!
PWS_extra_data.php (59) processing: |pm25_crnt2|text|--|!
PWS_extra_data.php (59) processing: |pm25_crnt3|text|--|!
PWS_extra_data.php (59) processing: |pm25_crnt4|text|--|!

Either remove all those lines you do not have any sensors for
or set those lines to comment if you want to use those in the future.

Wim