Page 1 of 1
Distinguish between multiple stations. **solved**
Posted: Mon Mar 07, 2022 10:00 pm
by pehon
Hello!
I would like to get my weather station date on behalf of a XML request:
Code: Select all
# curl -s http://xx:xx@mb.myurl/cgi-bin/livedataxml.cgi |grep "TH" | sort
<TH date="20220307192915" id="th0" temp="-0.5" hum="69" dew="-5.5" lowbat="0" />
<TH date="20220307192924" id="th2" temp="0.2" hum="68" dew="-5.0" lowbat="0" />
<TH date="20220307192926" id="th0" temp="0.8" hum="69" dew="-4.2" lowbat="0" />
<THB date="20220307192915" id="thb0" temp="-0.5" hum="69" dew="-5.5" press="941.7" seapress="1020.3" fc="-1" lowbat="0" />
<THB date="20220307192918" id="thb0" temp="27.2" hum="30" dew="8.1" press="942.2" seapress="1020.9" fc="-1" lowbat="0" />
Hmm, there are two times "th" and "thb0", but that are actually different stations. How do i distinguish between them?
I have two Davis IIS connected to a Meteostick and a tempest weather station.
Line1: Tempest (without pressure?)
Line2: Davis IIS
Line3: Davis IIS
Line4: Tempest Weatherflow
Line5: Meteostick USB (because of temp="27.2")
For my it looks like the automatic sensor naming is doing something bad. Why not just display them as added (or like it was working perfectly with Meteohub)?
Thanks,
Peter
Re: Distinguish between multiple stations
Posted: Tue Mar 08, 2022 1:22 am
by admin
Thanks for spotting this. The live data thing was designed before multiple station support was added.
I will think a bit how to solve this. Just adding a new name-value pair like 'station="1"' might be a way out. Would this help?
Re: Distinguish between multiple stations
Posted: Tue Mar 08, 2022 10:20 am
by pehon
In my case that would help. But think about other users using livedataxml.cgi, they could get errors while parsing.
I would add an additional cgi without any magic renaming, e.g. livedataxml_raw.cgi or livedataxml_with_station.cgi. But take care, that no sensor will ever be renamed, even if you remove or add new stations.
Re: Distinguish between multiple stations
Posted: Tue Mar 15, 2022 9:50 pm
by pehon
Will there will be a solution for this issue in one of the next meteobridge releases?
And, is MQTT and InfluxDB in the roadmap?
Re: Distinguish between multiple stations
Posted: Thu Mar 17, 2022 1:57 pm
by admin
Latest release does have this:
adds an option to "livedataxml.cgi" to print out "station=X" as an additional XML parameter of each sensor. This indicates which station a sensor belongs to and can be usefull when driving multiple weather stations with Meteobridge. This option is enabled by adding the URL parameter "includestation" when calling "livedataxml.cgi". Example below shows XML output when called with "includestation" option.
Code: Select all
<TH date="20220313214052" id="th0" station="0" temp="7.5" hum="38" dew="-5.9" lowbat="0" />
<T date="20220313214010" id="t8" station="0" temp="3.9" lowbat="0" />
<SOIL date="20220313214010" id="th10" station="0" temp="3.9" hum="255" lowbat="0" />
<SOIL date="20220313214010" id="th11" station="0" temp="0.0" hum="200" lowbat="0" />
<LEAF date="20220313214010" id="th15" station="0" temp="3.9" hum="255" lowbat="0" />
<LEAF date="20220313214010" id="th16" station="0" temp="0.0" hum="0" lowbat="0" />
<UV date="20220313214010" id="uv0" station="0" index="0.0" lowbat="0" />
<SOL date="20220313214010" id="sol0" station="0" rad="0" lowbat="0" />
<WIND date="20220313214102" id="wind0" station="0" dir="347" gust="0.0" wind="0.0" chill="7.5" lowbat="0" />
<RAIN date="20220313214010" id="rain0" station="0" rate="0.0" total="0.0" delta="0.0" lowbat="0" />
<THB date="20220313214010" id="thb0" station="0" temp="30.8" hum="20" dew="5.2" press="1017.8" seapress="1021.1" fc="2" lowbat="1" />
<DATA date="20220313214100" id="data10" station="9" val="19.00" lowbat="0" />
<DATA date="20220313214101" id="data11" station="9" val="11.39" lowbat="0" />
<DATA date="20220313214101" id="data12" station="9" val="2.00" lowbat="0" />
<DATA date="20220313214101" id="data13" station="9" val="56.00" lowbat="0" />
<DATA date="20220313214101" id="data15" station="9" val="64.00" lowbat="0" />
<DATA date="20220313214101" id="data16" station="9" val="2.00" lowbat="0" />
Re: Distinguish between multiple stations
Posted: Thu Mar 17, 2022 2:29 pm
by admin
pehon wrote: ↑Tue Mar 15, 2022 9:50 pm
And, is MQTT and InfluxDB in the roadmap?
nope.
Re: Distinguish between multiple stations
Posted: Thu Mar 17, 2022 10:07 pm
by pehon
admin wrote: ↑Thu Mar 17, 2022 1:57 pm
Latest release does have this:
gorgeous, works like a charm
Code: Select all
# curl -s http://x:y@myurl/cgi-bin/livedataxml.cgi?includestation |grep TH
<TH date="20220317195920" id="th0" station="0" temp="9.2" hum="81" dew="6.1" lowbat="0" />
<TH date="20220317195907" id="th2" station="0" temp="8.4" hum="82" dew="5.5" lowbat="0" />
<THB date="20220317195906" id="thb0" station="0" temp="27.8" hum="30" dew="8.6" press="951.1" seapress="1027.8" fc="-1" lowbat="0" />
<TH date="20220317195922" id="th0" station="1" temp="8.0" hum="86" dew="5.8" lowbat="0" />
<THB date="20220317195922" id="thb0" station="1" temp="8.0" hum="86" dew="5.8" press="950.4" seapress="1027.0" fc="-1" lowbat="0" />
#