Author Topic: MB Pro extra sensor data upload to Meteotemplate incomplete - workaround  (Read 2835 times)

0 Members and 1 Guest are viewing this topic.

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
The inbuilt Weather-Netupload for meteotemplate is still faulty/incomplete - still only 4 Soil-Moisture and only 1 PM2.5 and no lightning sensor values posted.

In the live data and history of MB Pro these sensor data are available, but they are probably missing in the upload string (call of the meteotemplate api.php)

That's what is sent by MB-Pro:

 [ You are not allowed to view attachments ]

and this it what should be sent (I had to create my own http call as nothing is moving at this front here even though a respective post was sent already 10-Aug-2020 in the MB forum):
I know that Boris was busy creating the fantastic new multi-station feature for Meteobridge, but this being +/- completed and an update released, now the repair could start.

 [ You are not allowed to view attachments ]
** I just noticed that meteotemplate chose the German "Bodenfeuchtigkeit" in the API picture - that's soil moisture in English  :-P **

@anybody else using meteotemplate with Meteobridge and want to have more than 1 PM2.5, more than 4 Soil Moisture sensors and at least one of the lightning values sent and stored in the meteotemplate database: (of course you need to activate the entries in the extra sensor table for them to be stored).

http://YOUR-SITE/yourpath-to-the-template-directory/template/api.php?U=[epoch.1:]&T=[th0temp-lastval.1:]&TMX=[th0temp-max5:]&TMN=[th0temp-min5:]&H=[th0hum-lastval.1:]&P=[thb0seapress-lastval:1]&W=[wind0avgwind-lastval=kmh:1]&G=[wind0wind-lastval=kmh:1]&B=[wind0dir-lastval:1]&R=[rain0total-daysum:--]&RR=[rain0rate-lastval:1]&S=[sol0rad-lastval:2]&UV=[uv0index-lastval:1]&TIN=[thb0temp-lastval.1:]&HIN=[thb0hum-lastval.1:]&T1=[th1temp-lastval.1:]&H1=[th1hum-lastval.1:]&SM1=[th20hum-lastval.0:]&SM2=[th21hum-lastval.0:]&SM3=[th22hum-lastval.0:]&SM4=[th23hum-lastval.0:]&SM5=[th24hum-lastval.0:]&L=[lgt0energy-lastval.0:]&PP1=[air0pm-lastval:2]&PP2=[air1pm-lastval:2]&PASS=yourpassword

To be clear: instead of using the faulty/incomplete Weather Net entry for Meteotemplate, I have created my own http call in the service section which provides also the missing sensors (see pictures)

 [ You are not allowed to view attachments ]
 [ You are not allowed to view attachments ]
Here all the extra sensors in the database - including lightning (as so far only one value can be stored for lightning, I have chosen the occurrence [called: energy in MB Pro]).
« Last Edit: September 18, 2020, 07:54:41 AM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline docbee

  • Moderator
  • Forecaster
  • *****
  • Posts: 853
    • smartbedded
Re: MB Pro extra sensor data upload to Meteotemplate incomplete - workaround
« Reply #1 on: September 19, 2020, 06:08:32 PM »
Did Yachim release a new upload protocol? If so I can implement in Meteobridge. Haven't heard from Yachim quite a while, I hope he is well.
founder of smartbedded.com - home of meteohub, meteoplug, meteobridge, meteostick

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
MB Pro extra sensor data upload to Meteotemplate incomplete - workaround
« Reply #2 on: September 20, 2020, 03:54:06 AM »
Yachim has still the same protocol - that's what I'm using.
He only needs to extend his table definition for the extra sensors with the soil moisture and the lightning (SM only 4 entries, lightning only one so far) for the values also to be stored in the DB, but the API already accepts these sensor values; you just have to send PPn:value, SMn:value, L:value.

I talked/wrote to him recently and he plans to extend the table definition as there are more people now who want to see all their extra sensors. In that process SM5-8 will have to get a new column each, and some LD, LT to be added to L, so he can store all three values.
And he better be prepared for the other multichannel extra sensors (T/H 5-8, WaterLeakage (1-4), PM10 [WH45], Soil temp, Water temp [WH34],
Right now you only need to send (if existing) PP1 - PP4, SM1 - SM8, and L (where I chose the occurence per day ("energy") as it has the imho the highest information value if you have to choose one of the 3 lightning values). I will send him the details (need of extra columns).

But for what is already possible now as for values, PP2-4, SM5-8, and L are missing in your definition. CO2 will come soon (WH45) but the field is already there.
http://www.meteotemplate.com/web/wiki/wikiAPI.php
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline docbee

  • Moderator
  • Forecaster
  • *****
  • Posts: 853
    • smartbedded
Re: MB Pro extra sensor data upload to Meteotemplate incomplete - workaround
« Reply #3 on: September 20, 2020, 05:47:55 AM »
I added the requested fields in the just released update. But for now mapping the tons of potential soil sensors to the IDs of Meteotemplate is a bit of a challenge. Therefore, I think the advanced user having tons of Ecowitt sensors all over the place might still need to make his very special individual upload definition. Meteobridge allows that, so no problem for the enthusiast.
founder of smartbedded.com - home of meteohub, meteoplug, meteobridge, meteostick

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
Re: MB Pro extra sensor data upload to Meteotemplate incomplete - workaround
« Reply #4 on: September 20, 2020, 07:17:37 AM »
Quote

I added the requested fields in the just released update. But for now mapping the tons of potential soil sensors to the IDs of Meteotemplate is a bit of a challenge.
=D> - will check/verify

Quote
Therefore, I think the advanced user having tons of Ecowitt sensors all over the place might still need to make his very special individual upload definition. Meteobridge allows that, so no problem for the enthusiast.
That's how and why I published the api-string - can be modified, updated, .... if needed for new sensors
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
Re: MB Pro extra sensor data upload to Meteotemplate incomplete - workaround
« Reply #5 on: September 21, 2020, 03:01:58 AM »
as for the SM sensors all looks ok - but the particulate matter (PM2.5) are weird.
Only one sent instead of two - and the value of sensor PM2.5 #1 is the data of sensor #2  :roll:
(i.e. the PP1 should have the data of "Air" and PP2 should have the data of "Air#1").
Now PP1 has Air#1 and PP2 is not sent (with a value). See attachments.
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
thx, I have 2 airlinks.

how do add 2*pm1, 2*pm2.5, and 2*pm10,

your example is only for 2*pm2.5?

thx

https://www.sint-katelijne-waver-meteo.be/template/indexDesktop.php

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
a) pretty old post - much happend ever since ...
b) I meanwhile use my proprietary API string to Meteotemplate successfully.
It contains 3 x PM2.5, 1 x PM10 and 1 x CO2 - and all I want to send to Meteotemplate.

http://mydomain/my_webroot/template/api.php?U=[epoch.1:]&T=[th0temp-lastval.1:]&TMX=[th0temp-max5:]&TMN=[th0temp-min5:]&H=[th0hum-lastval.1:]&
P=[thb0seapress-lastval:1]&W=[wind0avgwind-lastval=kmh:1]&G=[wind0wind-lastval=kmh:1]......&L=[lgt0total-act.0:]&PP1=[air0!0pm-lastval:2]&
PP2=[air0!1pm-lastval:2]&PP3=[air0!4pm-lastval:2]&PP4=[air0!5-lastval:2]&..............&PASS=xxxxxxxxxx

But at the end of the day it all depends on the MT end and which database fields you use - you can repurpose existing ones and in Meteobridge you just use its name (e.g. SM1).
Of course the unit should match. And/or you can extend the MT database by the columns you need - and create your own short-cut names if what is available is not sufficient.
This needs the execution of a respective SQL command at your server side.
I did in fact both. I started with repurpose for my two 2 PM2.5 sensors, and when it became more, especially for my lightning detector, I extended the database schema (added columns).
 My lightning detector provides three observations - total, distance, time stamp whereas Metetemplate only has one field ("L"). So I created two more columns LT and LD and Meteobridge sends the respective data. The MT API program assigns the values to the existing database fields whose name is provided.
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
I tried to change the mapping inside meteobridge, doesn't work, it overwrites the airlink1 which is default, how can do a http call?

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
- you will have to switch off the MB default Meteotemplate posting in the weather networks tab
- in the Services -->events tab you create a http event

New --> service type "http request" --> servicevent type "periodical" and add service event

It should look like this:
 [ You are not allowed to view attachments ]

The string has to contain all variables you want to send - it has to start with the time stamp U=[epoch.1], as in the string in the post before.
The names of the identifyers like U, H, T, TMX, TMN .... you find in Meteotemplate (Settings, control panel, database "edit data" and/or "edit Extra data extra sensors" if you have extra sensors).

For Meteobridge to provide the data you have to provide an expression of the type
sensor_selector-converter.decimals:replacement example T=[th0temp-lastval.1:] provides the outdoor temperature, the last value read by MB from your station, one place behind the decimal point (e.g. 23.4)
see in the Meteobridge WiKi https://meteobridge.com/wiki/index.php/Templates

you can use my string and fill in your missing sensors or remove the ones you don't use (PASS= will have to be your MT password)

..../template/api.php?U=[epoch.1:]&T=[th0temp-lastval.1:]&TMX=[th0temp-max5:]&TMN=[th0temp-min5:]&H=[th0hum-lastval.1:]&P=[thb0seapress-lastval:1]&W=[wind0avgwind-lastval=kmh:1]&G=[wind0wind-lastval=kmh:1]&B=[wind0dir-lastval:1]&R=[rain0total-daysum:--]&RR=[rain0rate-lastval:1]&S=[sol0rad-lastval:2]&UV=[uv0index-lastval:1]&TIN=[thb0temp-lastval.1:]&HIN=[thb0hum-lastval.1:]&T1=[th1temp-lastval.1:]&H1=[th1hum-lastval.1:]&T2=[th2temp-lastval.1:]&H2=[th2hum-lastval.1:]&T3=[th3temp-lastval.1:]&H3=[th3hum-lastval.1:]&T4=[th4temp-lastval.1:]&H4=[th4hum-lastval.1:]&SM1=[th20hum-lastval.0:]&SM2=[th21hum-lastval.0:]&SM3=[th22hum-lastval.0:]&SM4=[th23hum-lastval.0:]&SM5=[th24hum-lastval.0:]&L=[lgt0!0total-dmax.0:]&LD=[lgt0!0dist-lastval.0:77]&LT=[lgt0!0total-nonzerotime=epoch:]&PP1=[air0!0pm-lastval:2]&PP2=[air0!1pm-lastval:2]&PP3=[air0!4pm-lastval:2]&PP4=[air0!5-lastval:2]&CO2_1=[data4num-lastval:2]&TS1=[th5temp-lastval.1:]&TS2=[th6temp-lastval.1:]&TS3=[th7temp-lastval.1:]&T5=[th5temp-lastval.1:]&T6=[th6temp-lastval.1:]&H6=[th6hum-lastval.1:]&T7=[th7temp-lastval.1:]&H7=[th7hum-lastval.1:]&T8=[th0temp-lastval.1:]&H8=[th0hum-lastval.1:]&PASS=xxxxxxxx

In order to make MT save the values, you have to set this up in SetUp --> database --> extra sensors

But be aware of what you do  8-) - I have done already same mapping in my string - just taking it 1:1 could create unexpected results.
On the other hand the string should be quite self-explanatory.
« Last Edit: May 15, 2022, 01:57:01 PM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
jut doesn't work....
i'm doing something wrong.

the second airlink isn't mapped.

it's visible in the raw sensor data,

when I update the api.php with your examples I do not get sensible values in, I only see in the apisetup.php someting like air2!0pm-lastval:2,air2!1pm-lastval:2, air2!2pm-lastval:2]

thanks for your quick reply though, this will be a hard nutt to crack for me, please bare with me...
any help would be nice;
https://www.sint-katelijne-waver-meteo.be/template/indexDesktop.php

thx






Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
you have to look into meteotemplateLive.txt  in ../template
There you can see what arrives at Meteotemplate,
if only [xxxxxxxx] arrives, then the chosen sensor/selector has no data (i.e. you need to choose another sensor/selector).

The [xxxxxx] appears then, because in the e.g. [th0temp-lastval.1:] there is nothing behind the ":"
If you had put the text "empty" (without "") there, e.g. [th0temp-lastval.1:empty], the text "empty" would appear.
What stands behind the ":" is what will be printed/exported when no data is available.
If there is nothing behind the ":" and no value is found in the database, then the selection expression [xxxxxx-yyyyy.n:] will be printed/exported.

You can make a test regarding the "mapping" - or better regarding the right choice of sensors/selectors:

take the API string and make an export out of it .
Take the file \\METEOBRIDGE\data\templates\standard-iso.exp as an example.
Make a copy of it, copy the API string into the 4th line, remove all "&L="  etc. so that only [xxxxxxxxxxx], [xxxxxxxxx], .....
is left.
In the line above (starting with $#) put the names of the sensors, separated by "," (without ""), so you can recognize the values later, i.e. know, which value is at what position
Save the file under a new name but with the ending .exp into \\METEOBRIDGE\data\templates
Create an event under Services --> events (event type Data Export, periodical) choose "Data export: after each new day",  "current day" for Time Frame, minutes for resolution and your freshly created template as Template, save, and then press "test" to start the export.

The result (export) will be created in \\METEOBRIDGE\data\export with the name you gave the template (make sure it ends with .exp, otherwise you cannot choose it). e.g. meteotemplate-test-20220515-min.txt, assuming you named the new template file meteotemplate-test.exp

Now you can see what the selectors (e.g. air0!1pm) have provided. You have to choose the selector name as it shows in the raw sensor data respectively in the min/max history.

If you are not sure what the exact name of your sensor is (some are only shown there with their descriptive name i.e. Air instead of air0!pm), check in History --> edit hourly data under sensor
(select the current month and date and see which of the possible sensor names produces the results you are looking for - that's the one you are looking for).

Once you have found your proper sensor names, insert them again into the API string.

regarding the sensor naming:
if you have only one station connected, for outdoor temperature you will have only one sensor: th0temp or th0!0temp (the same here). If you have two stations, you will have two outdoor temperature sensors: th0!0temp (=th0temp) and th1!0temp etc.
If some of your sensor values you want to send to Meteotemplate come from a second station, you have to choose the sensor belonging to that station (this may be different from my API string).
Primary station: ...0!....
Station 1: ....1!....
Station 2: ....2!.... (station 2 is here your 3rd station !! - as the counting starts with zero)

attention: air1!0pm is different from air0!1pm !!!! (can be easily confused)
« Last Edit: May 16, 2022, 12:44:24 AM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
very good write up Gyvate  =D>

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
jut doesn't work....
.....
when I update the api.php with your examples I do not get sensible values in, I only see in the apisetup.php someting like air2!0pm-lastval:2,air2!1pm-lastval:2, air2!2pm-lastval:2]
.....
air2!0pm-lastval:2 you won't see from my API string - maybe air0!0pm-lastval: (that's the air quality sensor #1 [counting starts with zero !] of the primary station (station #0) or air0!1pm (air sensor#2 of primary)  or air0!2pm (air sensor #3 of primary) ... - you need to understand the syntax !!! of the sensor names and of the sensor-selection expressions: sensor-selector.decimal:replacement   8-)

quote from the WiKi (reading recommended - e.g. setup --> primary station --> mapping (https://meteobridge.com/wiki/index.php/Select_Station)

Physical sensor names are composed of

    the sensor category (t, th, thb, wind, rain, uv, sol, air, ...)
    station number (0 = primary station)
    exclamation mark "!" as delimiter
    sensor number (0 = primary sensor of the specific station)
    sensor type (temp, hum, dew, ...)

Therefore, "th1!0temp" is the primary temp outdoor sensor of station #1.

take your time - in my country we say - "no master just fell down from the sky" - or, in English: "no one is born a master"  :-)

I assume (I haven't seen your system though) that your second airlink is air0!2pm (selection expression: [air0!2pm-lastval.1:] ), provided it comes from the primary station. In your raw sensor data it may just show as Air#1.

maybe you attach a screencopy of your raw sensor data and your min/max history  8-)

and - maybe just start with a very simple export - see attachment (you have to rename the file from .txt to .exp - the forum software doesn't allow attachments with the ending .exp)
use the export instructions from Reply #11 - nothing to edit yet - you've got already a ready-made little export template

the export template:
- # as a first character means that the line is a commentary and is ignored by the MB processor
- what stands behind $# is just a text line creating the headers of the selector values created in the following line (for better reading)
- now comes the export instruction line:
[YYYY]-[MM]-[DD] [hh]:[mm],[air0!0pm],[air0!3pm],[air0!3pm],[air0!3pm]
the first five selectors with the characters in between will create an entry: year-month-day hour:minute (e.g. 2022-05-16 00:00),
the entry [air0!0pm] inside the export file is an instruction for Meteobridge to read from its database the values of the chosen resolution (here minutes [Reply #11] inside the chosen time frame (here current day) and write them into a file named template-name-date.txt (e.g. air-sensors-20220516.txt) and place it into the \\METEOBRIDGE\data\export directory.
If after the first selector a second one comes, separated by a comma, it means to the processor: write that comma and place the value of the 2nd selector behind it etc. until the end of the line

the complete export lines should look like (if you do the export today) - values just ficticious

date-time, Air Quality  [ug/m3], Air Quality 2 [ug/m3], Air Quality 3 [ug/m3], Air Quality 4 [ug/m3]
2022-05-16 00:00, 4, 6, 4, 2
2022-05-16 00:01, 4, 6, 4, 3
......

run it - see what it produces (in \\METEOBRIDGE\data\export) and understand what it does  \:D/

once your export provides the wanted results, transfer the expressions (what's inside the [ ] including the [ ]  ;)) to the API string
« Last Edit: May 16, 2022, 01:54:26 AM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
on  the MB side: i think its ok

standard-iso.exp

# Standard CSV template with data in metric units
#
$# date, time, air(µg/m³)
[YYYY]-[MM]-[DD],[hh]:[mm],[[air1!0pm-lastval.1],[[air1!1pm-lastval.1],[[air1!2pm-lastval.1],[[air1!0pm-lastval.1],[[air1!1pm-lastval.1],[[air1!2pm-lastval.1]

then i get : in the lastexport.exp

2022-05-17,21:00,[17.7,[16.3,[10.7,[17.7,[16.3,[10.7

which correspondens to airlink 1, 1 pm......airlink 2,... etc

when I copy the [[air1!0pm-lastval.1],[[air1!1pm-lastval.1],[[air1!2pm-lastval.1],[[air1!0pm-lastval.1],[[air1!1pm-lastval.1],[[air1!2pm-lastval.1]

inside the update/api.php it doesnt work.

grrz

Alex






Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
yes, because you have put too many brackets "[" .... and MB just did what you asked it to do (but probably not what you wanted it to do  :roll:)

and that's why your export output shows brackets - the API doesn't understand brackets !!! - only identifiers [L, T, H, ...] and values as real numbers [1.0, 2.4, ....].  ]

One set of brackets is for the definition and MB will replace it by the sensor value, the second bracket will just be written as "[".  ](*,)

=>
you must NOT write
[[air1!0pm-lastval.1],[[air1!1pm-lastval.1],[[air1!2pm-lastval.1],[[air1!0pm-lastval.1],[[air1!1pm-lastval.1],[[air1!2pm-lastval.1]
(because then you get [17.7,[16.3, ... and the API doesn't understand "[17.7", only "17.7".
but
[air1!0pm-lastval.1],[air1!1pm-lastval.1],[air1!2pm-lastval.1],[air1!0pm-lastval.1],[air1!1pm-lastval.1],[[air1!2pm-lastval.1]
in order to get
17.7,16.3,10.7,17.7,16.3,10.7
(I guess you are aware that you have created each sensor value twice in your export definition)

you have to enter into the API string
PP1=[air1!0pm-lastval.1]&PP2=[air1!1pm-lastval.1]&PP3=[air1!2pm-lastval.1]
 :idea:
« Last Edit: May 17, 2022, 04:18:42 PM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
somehow i need [

i choose
# Standard CSV template with data in metric units
#
$# date, time, air(µg/m³)
[YYYY]-[MM]-[DD],[hh]:[mm],[air1!0pm-lastval.1],[air1!1pm-lastval.1],[air1!2pm-lastval.1],[air2!0pm-lastval.1],[air2!1pm-lastval.1],[air2!2pm-lastval.1]

i get

2022-05-18,00:00,[air1!0pm-lastval.1],[air1!1pm-lastval.1],[air1!2pm-lastval.1],[air2!0pm-lastval.1],[air2!1pm-lastval.1],[air2!2pm-lastval.1]

when i choose

# Standard CSV template with data in metric units
#
$# date, time, air(µg/m³)
[YYYY]-[MM]-[DD],[hh]:[mm],[[air1!0pm-lastval.1],[[air1!1pm-lastval.1],[[air1!2pm-lastval.1],[[air2!0pm-lastval.1],[[air2!1pm-lastval.1],[[air2!2pm-lastval.1]

see the double [

i get values with [

2022-05-18,00:10,[15.7,[15.1,[10.8,[54.9,[40.3,[26.3

you see my issue?

I did every possible combination, the latest is the best I got with values,

sorry my friend,

 8-)


Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
what about using
[YYYY]-[MM]-[DD],[hh]:[mm],[air1!0pm-lastval.1:],[air1!1pm-lastval.1:],[air1!2pm-lastval.1:],[air2!0pm-lastval.1:],[air2!1pm-lastval.1:],[air2!2pm-lastval.1:]
instead ?
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
then i get

2022-05-18,00:20,,,,,,

using Meteobridge 5.4 (May 7 2022, build 14745), FW 1.4

next i will try 5.3?

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
same in 5.3...

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
14745 works with me and "my" syntax. It produces the proper export and the proper API values.
And the ":" is a necessary part of the expression for a sensor value inside the [  ].

Maybe you could try replacing lastval by act

[YYYY]-[MM]-[DD],[hh]:[mm],[air1!0pm-act.1:0],[air1!1pm-act.1:0],[air1!2pm-act.1:0],[air2!0pm-act.1:0],[air2!1pm-act.1:0],[air2!2pm-act.1:0]
in this syntax a "0" will be put if the expression has no data

did you export minute data for the current day or yesterday ?
You should have got 25 lines at 00:25 with the proper time frame (current day)
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
then i get

2022-05-18,00:20,,,,,,


Seems like air1 and air2 are not defined
Is there a list of defined/available sensors ( I mean only those known by your meteobridge configuration )

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
in your last example i get

2022-05-18,00:55,0,0,0,0,0,0

last reading some minutes ago.

in the mapping It shows:
Physical Sensor      Logical Sensor      Meaning   
  air1!0pm        air0pm        air quality (10 microns or default)
  air1!1pm        air1pm        air quality (2.5 microns)
  air1!2pm        air2pm        air quality (1 micron)


the air2!0pm etc... are in white, without logical sensor

if i map the air2!0pm to a sensor i can only choose the above logical sensors meaning the air1!0pm for example will be overwritten,

my apologies,


Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3298
coming back to @davidefa:
air1!0pm and air2!0pm mean you have a primary station (air0!0pm), a 2nd station (air1!0pm) and a 3rd station (air2!0pm).
How many stations do you have connected. If only one, the primary station, then the result you got
date, time, ,,,,, was correct !!
If you have only one (=primary) station, the expression should be:
[YYYY]-[MM]-[DD],[hh]:[mm],[air0!0pm-lastval.1:],[air0!1pm-lastval.1:],[air0!2pm-lastval.1:],[air0!3pm-lastval.1:],[air0!4pm-lastval.1:],[air0!5pm-lastval.1:]
If you have two stations (primary = station 0 and station 1), and 3 sensors are from station 0 and 3 from station 1, then the expression should be
[YYYY]-[MM]-[DD],[hh]:[mm],[air0!0pm-lastval.1:],[air0!1pm-lastval.1:],[air0!2pm-lastval.1:],[air1!0pm-lastval.1:],[air1!1pm-lastval.1:],[air1!2pm-lastval.1:]

Beware of the syntax:
sensor station separator sensor-number

in order to avoid missing data in the test, your time frame should be "yesterday", resolution "minute" or "hour"
also include some sensors in the export which are there anyway to verify the proper syntax e.g. [th0!0temp-lastval.1:],[th0!0hum-lastval.1:]
« Last Edit: May 17, 2022, 07:19:42 PM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline alexvanuxem

  • Member
  • *
  • Posts: 24
yes indeed i have 2 airlinks
one is set to primary station:
and a second ::

I attached screenshots in word of the sensors and mapping,

thank you guys! [ You are not allowed to view attachments ]