wl.comV2-api problems

hello i have a PAII in operation, the template gives me the usual error “Problem 59: No sensor found check settings and data” despite the fact that i updated the ZIP file and that I entered it in my easysetup API keys ? thnx BR

Please post a link to your website

Hi bianco66050,

Welcome to the forum.

When I check the downloaded data from PurpleAir, there is only an error-message

{
“api_version” : “V1.0.11-0.0.49”,
“time_stamp” : 1703159297,
“error” : “ApiKeyInvalidError”,
“description” : “The provided api_key was not valid.”
}

Please check your easyweather settings.

  • Maybe there is a space or a point before or after the value you entered ?
  • Sometimes one forgets to press the green “Save” key when entering only one value in Easyweathersetup.

If all seems OK to you, please sent a mail or PM with your easyweather-setup password. I can than, using my API_key, test if there is another problem.

Succes,

Wim

Seems to be working now :slightly_smiling_face:, but the name of your sensor is very long :slightly_frowning_face:. I think this would work:

In AQ_purpleair_c_block.php, after line 108

$city           = $parsed_json['sensor']['name'];

add new line 109

$city			= str_replace('@',' @',$city);

?? “PWS_graph_xx.php” ??
not the same as for example if i do a test with the WL Cloud V2 API ? here SGZ-FMCK OURY SUD Home Weather Station (DWL_v2api version)
where it is the “TEMP”/“RAIN” and “WIND” blocks which are not/no longer up to date as are the “extras_TEMP/HR Soil” ? :(-
thnx

+1 thnx actually it’s more readable :)-

At FAMECK OURY SUD Home Weather Station (DWL version)
Fatal error : Uncaught TypeError: Unsupported operand types: int - string in /www/valdefench57sgz.franceserv.com/pwsWD/PWS_graph_xx.php:518 Stack trace: #0 /www/valdefench57sgz.franceserv.com/pwsWD/_test.php(17): include() #1 {main} thrown in /www/valdefench57sgz.franceserv.com/pwsWD/PWS_graph_xx.php on line 518

I don’t think you are getting the data from APIv2 :confused:

hello for the first answer sorry but it’s Chinese for me…
for the second and the “test” with the API v.2 I indicated the API key and secret in my easysetup by following the instructions of the test tool Find your weathercloud station
i get a return code with my 3 devices including
2x stations product_number 6555
and 1x WeatherLink Live product_number 6100EU
all 3 are correctly listed with station_id okay :)-
so here also I don’t understand why not getting data from API v2 ??
Have a good day

Hi bianco66050,

When I visit your primary wl.com website, I see no imidiate problems.
You are using recent and correct data from api.weatherlink.com

All blocks are recent, also those with data from other sources.
The pop-ups :" Carte pollution" fail as the link is a http one. That is not allowed for a https website.

Mixed Content: 
The page at 'https://valdefench57sgz.franceserv.com/pwsWD/_test.php?test=image_popup.php&nr=aq_map&script=AQ_davis_c_block.php&theme=light&lang=fr-fr&units=metric' was loaded over HTTPS, 
but requested an insecure frame 'http://valdefench57sgz.franceserv.com/pwsWD/fct_windy_popup.php?script=AQ'. 
This request has been blocked; the content must be served over HTTPS.

For your other test site I see no problems either. Data is recent, only the wl.com-AQ block is not showing. Probably multiple settings for extra devices and the main data source.
The pop-ups have the same mixed http->https problem as your main site.


Can you make a screenshot and draw arrows or something to indicate at which website somthing is not functioning correctly or about what part you have questions?


If there are errors, sent an email or a PM with your easyweathersetup password.

That way I can check why something is not functioning as it should.
Just guessing what could be the problem takes too much time.

Best regards,
Wim

That seems to be why your WU graphs do not work at FAMECK OURY SUD Home Weather Station (DWL version). Just guessing now: what did you enter for

in easyweathersetup?

I received the easyweather-passwords by email with a list of problems questions.

  • block_temperature = no data Humidity?
    block_wind, block_rain and block solar_uv no data at all
    → The wlcom-apiV2 data contains multiple weather-stations / add-on devices.
    → The PWS_livedata.php script uses the first value found for a sensor
    → Sadly the first station in the wlcom-apiV2 file is partly empty
    -----> Solution: Adapted the livedata script to discard empty values
    -----> Test version of updated script attached

  • Missing drop-down selectors in temp wind a.s.o. graphs
    → Caused by invalid WU start-date setting in easdsyweather-setup
    -----> Solution: Corrected with a valid setting

  • the AQ Davis sensor is not updating
    → as said before it was a double station-setting for both main-data and AQ sensor
    -----> Solution: emptied the extra setting

  • block_soil info and extra_TH_HR no data although Davis sensors exists
    → current PWS_livedata.php (2012_lts) does not support those extra sensors
    -----> Solution: none

Happy holidays to all,
Wim

Test version zip removed, newer version a few posts down.

@Wim, thank you for your update

the [1st small blocks for the top row txt] which is different on the 2 sites ? what is the script that controls the display ?
for [soil-moist_temp and extra_temp_hum] = this is not the same PWS_livedata.php in common for V1 and V2 ?
from the moment when on the first site (V1) the data is correctly listed …

for V1 = the [AQ Davis] script continues to be “offline” ;
for V2 = after replacing the PWS_livedata it seems to be functional now with the exception of the rainfall (rain = 0.0 while the graph is okay) …

thank you again and have a wonderful holiday day :wink:

There is not a single script which fills the data, but it starts with advisory_c_small.php.

Most important data comes from the alarm scripts.
Also the lightning-scripts can supply a message.
Temp/humidity values are checked for road conditions
Aurora messages can be shown
And some forecast scripts can supply a text forecast which can be used.
If no important message is shown, the standard message will be used.

The current live-data script handles all different weather-data sources. Be it clientraw, wl .com or whatever.
But for every weather-data source there is different code.
The code for wl .com V1 and V2 are totally different as the data ids totally different.

The current code of the live-data script for wl.comv2API does not support those extra sensors. There was no user available with those sensors.

It will take some time to add the extra code-lines to process those sensors.
You can check the script, lines 1044 → 1047 , comments only

# extra humidity fields
#        for ($n = 1; $n <= 10 ; $n++) {}
# moisture fields 
#        for ($n = 1; $n <= 8 ; $n++) {}

As it is only a test-site for you I see no reason to spent my free-time to add code-lines nobody will use for a production website.

.
I did not check that website as that is your production site, I adapted it also. Should work now.
.

Yes, the first station in your wlcomv2API data shows a 0 value for rain.
The scripts only skip NULL or “empty” values.
A 0 (zero) for rain is a real value.

I did not develop wl.comv2API.
Normally users have one DAVIS-weather-station and one DAVIS-air-quality sensor.
You have a very complex weather-station with 12 different “sensors”

Your primary web-site works OK, and I will support that one and try to help you.
But not a test-site, my spare time is to important for me.

Wim

:+1: apart from the problem of the soil sensors, if my WK Live summary records a rainfall/day (for the two stations) I certainly have a problem understanding the functioning of the template here to the extent that we choose the v2 API? the corresponding block should not be displayed as a null value, right?
ps/ for the multiplicity of sensors/stations yes but it is in my comparison participation at the request of suppliers of agronomic stations (and here for example I compare an Agro from Davis vs./ a MeteoAG from Barani Instruments :)-
Good evening and Cheers

New test version PWS_livedata.php for empty (null) items

PWS_livedata.php.zip (17.5 KB)

1 Like

I agree with that, although I myself and others tried to explain. So again:

Your DWL_v2api file contains multiple sensors and items, for which I, the script author, have no idea what sensors/devices that are.

Maybe you use multiple ?stations with extra ? sensors all in 1 file. ? ? ?

The first large data chunk in that file, looks like a station/ISS, but it shows “empty” wind/temp data such as [hum] =>
I tried to help you, so I adapted the live-data script to discard “null” data.
The first real value for wind/temp/hum measurement is now used.

But that station also shows a zero value for rain [rainfall_daily_in] => 0
That is not an empty value. That is a “real” value.

What do you want me to do with that, discard 0 values also?


I checked websites of other PWS_Dashboard stations using DWL_v2api version. Last count there are 21 website using DWL_v2api of which 8 stations show rain for today. All of them have rain for December/ this year.
None of them have your problem and they are using the standard live-data script.


Conclusion: Your problem is a local problem caused by your setup.
Your first webnsite is using the “old” DWL-data-download which shows one station with complete and correct data.


If really want to move your production website from the old DWL-data to DWL_v2api data you yourself should clean your wl.com setup.
But if you want or need all that data, you yourself have to study that data and tell me what parts of your large DWL_v2api should be used.

You should give me a list of real parts in the large file. You could use the lsid’ (that is the first field of each sensor. They seem to be unique.
Maybe these four 369681,231665,231666,362372 form a “normal” station?

[sensors] => Array
        (  [0] => Array
                (   [lsid] => 231666
                    [data] => Array

If you supply me with real information, I can try to adjust the script.

Wim

@pwsdashboard
I understand your perplexity regarding my configuration and i have no doubt that users do not need to have a large number of sensors (as i have already been criticized elsewhere… but it is not the debate here) … my setup has not changed: primary station + 2nd VP2 all managed by a WeatherLink Live 6100EU
http://valdefench57sgz.franceserv.com/weatherlink/load_wl2.php
http://seremange-meteolive.franceserv.com/weatherlink/load_wl2.php
Weather Conditions - WeatherLink Live SEREMANGE ERZANGE FR57

i reassure you with the API v1 it works correctly as you can see for my first template (that of the primary station with all the sensors/auxiliary stations)

but the switch with API v2 is stuck (again for example with your new “livedata.php”)
with the exception of the non-functionality of the extra/soil blocks and after checking with your “tool_test” to respond to your last request i think that with lsid’ = 369681 the template should return all the “normal” data as we can. 'consider in/and for customary use :)-

Thank you and good day
Regards

Your lsid’ = 369681 is missing essential information, the live-data need more data items then contained in this sensor…

We also need sensor
231665 for the pressure values
231666 for the inside temp/hum values

Optional
362372 for AQ values, although that block can fetch the values itself
231671 for soil temp and moisture

Missing in your DWL_v2api data?
Extra temp/hum sensors you have them on your “old” DWL-data website.
I did not find those sensors in your data. To process to sensors I need the names used for those sensors.



Other solutions possible:
As you are also using your Metebridge for a weather34/Aurora website, did you consider to upload those “extra sensor” data by using the extra-data upload?
Described/download at https://pwsdashboard.com/
Extra sensor (f.i. soil) files for some weather-programs can be downloaded here

One can also use a small php script to convert other data-files to “extra-data” format which is then processed by the livedata script.
There are two examples (cvt.php and cvt2.php) in the full download.
And a dozen or so users have adapted those to their own very special situation.


Regards,
wim

re_you have my key/api v2 key accessible in my easysetup of which my password was provided to you in PM :)-
just for information when i configured the template and for “Extra sensor (f.i. soil)”! I didn’t configure anything because I simply noticed that everything had been automatically retrieved on my first template site …
otherwise to meet your expectations here all the sensors of my Primary station api/v2

      • [station_id] => 9582
      • [lsid] => 33887