Author Topic: Help Meteobridge users required to test template script  (Read 3356 times)

0 Members and 1 Guest are viewing this topic.

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Help Meteobridge users required to test template script
« on: February 21, 2017, 02:32:34 AM »
Hello

due to the frequent regular requests of using meteobridge with the HOMEWEATHERSTATION template I am looking for some beta testers to test out a script . one file called meteobridgeupload.php

the template does support MBrealtime.txt generated by Ken True Saratoga template however I have had many requests to generate a PHP script for those not using the template but use meteobridge based hardware.

I have created a simple variant of Ken True's script using the GET method and being able to implement it into the existing template without much additional coding . it basically looks this and creates a file called MBrealtimeupload.txt


$data = array(
   "timestamp" => $date->format('U'),
   "updated" => date("G:i:s"),
   "outsideTemp" => $_GET['th0temp-act'],
   "outsideHumidity" => $_GET['th0hum-act'],
   "dewpoint" => $_GET['th0dew-act'],
   "windDir" => $_GET['wind0dir-act'],
   "windSpeed" => $_GET['wind0wind-act=kn'],
   "windGust" => $_GET['wind0wind-act=kn'],
   "windSpeedAvg" => $_GET['wind0avgwind-act=kn'],
   "rainrate" => $_GET['rain0rate-act'],
   "raintoday" => $_GET['rain0total-daysum'],
   "rainmonth" => $_GET['rain0total-monthsum'],
   "rainyear" => $_GET['rain0total-yearsum'],
   "radiation" => $_GET['sol0rad-act:0'],
   "UV" => $_GET['uv0index-act'],
   "indoorTemp" => $_GET['thb0temp-act'],
   "indoorHumidity" => $_GET['thb0hum-act'],
   "barometer" => $_GET['thb0seapress-act'],
   "month"=> date("F"),
   "year"=> date("Y"),
   "day"=> date("l"),
   "heatindex" => $_GET['th0heatindex-act'],
   "windchill" => $_GET['wind0chill-act'],   
   
   );

etc........

the downside for me is I do not own a meteobridge product and the chances of obtaining one here in turkey is nigh on impossible due to import regulations, tax,administration fees and so on , if ordered one i would pay almost 50% more on top and no guarantee it would be approved .importing stuff like this and any unfamiliar electronic products is very bureaucratic and time consuming to resolve.

so if you are interested in helping me test out this script please get in touch via pm or email it is a simple script and from my basic tests it generates the file but where I need help is getting the meteobridge to send the data to a web server using the procedure based on Kens pages and the wiki but with help i think i could understand better if these options works .

all I would need is a file generated one time to test with .  please get in touch via pm or email i can send along the file.  brian

yoururl.com/path/meteobridgeupload.php?outsideTemp=[th0temp-act]&dewpoint=[th0dew-act]&outsideHumidity=[th0hum-act]&indoorTemp=[thb0temp-act]&indoorHumidity=[thb0hum-act]&pressure=[thb0seapress-act]wind=[wind0avgwind-act=kn]&gust=[wind0wind-act=kn]&winddidrection=[wind0dir-act]&solarradiation=[sol0rad-act:0]&raintoday=[rain0total-daysum]&monthrain=[rain0total-monthsum]&yearrain=[rain0total-yearsum]&rainrate=[rain0rate-act]&UV=[uv0index-act]&heatindex=[th0heatindex-act]&windchill=[wind0chill-act]


Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #1 on: February 21, 2017, 05:06:45 AM »
Hi Brian,
theoretically I can help you if you send me the script, looking at your code however there is one thing I dont understand.

You are using this command in MB:

yoururl.com/path/meteobridgeupload.php?outsideTemp=[th0temp-act]&dewpoint=[th0dew-act]&outsideHumidity=[th0hum-act]&indoorTemp=[thb0temp-act]&indoorHumidity=[thb0hum-act]&pressure=[thb0seapress-act]wind=[wind0avgwind-act=kn]&gust=[wind0wind-act=kn]&winddidrection=[wind0dir-act]&solarradiation=[sol0rad-act:0]&raintoday=[rain0total-daysum]&monthrain=[rain0total-monthsum]&yearrain=[rain0total-yearsum]&rainrate=[rain0rate-act]&UV=[uv0index-act]&heatindex=[th0heatindex-act]&windchill=[wind0chill-act]

in which case, the output from MB would ideally look something like this:

yoururl.com/path/meteobridgeupload.php?outsideTemp=15&dewpoint=14 .... etc. The tags are replaced with values by MB and passed to the URL

Then however, in your GET commands you are loading the actual tags,

"outsideTemp" => $_GET['th0temp-act'],
"outsideHumidity" => $_GET['th0hum-act'],

which in this case wont work, because there are no such variables in the URL, they would be:

"outsideTemp" => $_GET['outsideTemp'],
"outsideHumidity" => $_GET['outsideHumidity'],

etc.

But maybe Im just missing something

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #2 on: February 21, 2017, 05:52:52 AM »


if you want you can actually test it from the url http://boutiquehotelitaly.com/devpws/meteobridgeupload.php

it outputs   http://boutiquehotelitaly.com/devpws/MBrealtimeupload.json  if I can get it to do this successfully then it is almost identical to the ws1001.json and would need no significant change to make the template use it realtime and use the current WS1001 mysql scripts for dbase. but not having a meteobridge I'm only taking stabs at it . but I'm sure its not far off..

{"timestamp":"1487673736","updated":"13:42:16","outsideTemp":null,"outsideHumidity":null,"dewpoint":null,"windDir":null,"windSpeed":null,"windGust":null,"windSpeedAvg":null,"rainrate":null,"raintoday":null,"rainmonth":null,"rainyear":null,"radiation":null,"UV":null,"indoorTemp":null,"indoorHumidity":null,"barometer":null,"month":"February","year":"2017","day":"Tuesday","heatindex":null,"windchill":null}



the bit i have no access to is generating this from the meteobridge

http://yoururl.com/path/meteobridgeupload.php?outsideTemp=[th0temp-act]&dewpoint=[th0dew-act]&outsideHumidity=[th0hum-act]&indoorTemp=[thb0temp-act]&indoorHumidity=[thb0hum-act]&pressure=[thb0seapress-act]wind=[wind0avgwind-act=kn]&gust=[wind0wind-act=kn]&winddidrection=[wind0dir-act]&solarradiation=[sol0rad-act:0]&raintoday=[rain0total-daysum]&monthrain=[rain0total-monthsum]&yearrain=[rain0total-yearsum]&rainrate=[rain0rate-act]&UV=[uv0index-act]&heatindex=[th0heatindex-act]&windchill=[wind0chill-act]


i have change the code as your idea above so it now looks like this

        "outsideHumidity" => $_GET['outsideHumidity'],
   "dewpoint" => $_GET['dewpoint'],
   "windDir" => $_GET['windDir'],
   "windSpeed" => $_GET['windSpeed'],
   "windGust" => $_GET['windGust'],
   "windSpeedAvg" => $_GET['windSpeedAvg'],
   "rainrate" => $_GET['rainrate'],
   "raintoday" => $_GET['raintoday'],

etc...


test it at http://boutiquehotelitaly.com/devpws/meteobridgeupload.php

see results at http://boutiquehotelitaly.com/devpws/MBrealtimeupload.json




Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #3 on: February 21, 2017, 06:11:45 AM »
OK, tested and this is the output:

{"timestamp":"1487675469","updated":"14:11:09","outsideTemp":"9.2","outsideHumidity":"99.0","dewpoint":"9.1","windDir":null,"windSpeed":null,"windGust":null,"windSpeedAvg":null,"rainrate":"0.0","raintoday":"0.6","rainmonth":null,"rainyear":null,"radiation":null,"UV":"[uv0index-act]","indoorTemp":"20.3","indoorHumidity":"16.0","barometer":null,"month":"February","year":"2017","day":"Tuesday","heatindex":"9.2","windchill":"7.9"}

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #4 on: February 21, 2017, 06:13:28 AM »
Brian I use a similar thing in my template, one more thing you should add is some kind of a password, otherwise anyone can set an http request to the user´s update script and then update their page with their data.

There should be some kind of "pass=12345" in the MB string and then in your PHP script, first check if the GET password is same as the one specified by the user somewhere in your template and only then proceed with the JSON

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #5 on: February 21, 2017, 06:15:17 AM »
This is the string I use in Meteotemplate:

/update/update.php?t=[th0temp-avg5]&h=[th0hum-avg5]&p=[thb0seapress-avg5]&d=[th0dew-avg5]&w=[wind0wind-avg5]&g=[wind0wind-max5]&b=[wind0dir-avg5]&rr=[rain0rate-act]&r=[rain0total-sumday]&tmax=[th0temp-max5]&tmin=[th0temp-min5]&s=[sol0rad-max5]&year=[YYYY]&month=[MM]&day=[DD]&hour=[hh]&minute=[mm]&seconds=[ss]&password=12345

and then the temperature is GET['t'], etc.

but if the password is not equal to password specified in the template, it dies

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #6 on: February 21, 2017, 06:18:06 AM »
As you can see from the output, some commands do not work, this one for example:

wind0avgwind-act=kn

this is because the "avgwind" tag is supposed to be supplied with some kind of a time period (see the example for Meteotemplate, which is for last 5 minutes). If you want to use the current you only use wind0wind-act, but average always has to be from several numbers.

Check which parameters work and which not, and I think you will see how the MB tags work

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Help Meteobridge users required to test template script
« Reply #7 on: February 21, 2017, 06:19:50 AM »
Hello Brian,
The MB users of your template here in the Netherlands/Belgium, almost all use the "Saratoga file", even if they do not have a Saratoga template.
It has the same layout as Cumulus and you are using the same code to process it in your scripts.

So why do you want to change something which is already working OK?

Example two sites not using Saratoga but still using a MB with your weather34/ template and using HTTP uploads:
http://www.alainvc.org/weather34/realtime.txt  => http://www.alainvc.org/weather34/
http://www.weerstation-herent.be/realtime2.txt => http://www.weerstation-herent.be/pws/
There are others also testing your template with MB using the same scripts/files.

This is the "template" file for MB, " identical" to a Saratoga version http://www.weerstation-herent.be/mb_brian_http_start.txt
The script used to accept the data is also the same as other scripts used already:
Code: [Select]
<?php ini_set ('display_errors''On');  error_reporting(E_ALL);
#
$filename       "./realtime2.txt";
#
if( isset($_GET['d']) ) {
$string=$_GET['d'];
$ret=file_put_contents ($filename$stringLOCK_EX);
if (!$ret) { echo 'file not saved';} else {echo "<p>Success</p>\n"; }
}

Also available a .zip with all scripts, a readme.txt and a jpg explaining MB http and ftp uploads and how to do the setup for weather34..
Posted that a long time ago in English and converted that to Dutch for users here: http://www.weerstation-herent.be/mb_brian.zip
Can convert it back to English also if needed.

Wim

« Last Edit: February 21, 2017, 06:22:28 AM by wvdkuil »

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #8 on: February 21, 2017, 06:23:20 AM »
Wim Im just curious, does the Saratoga script not use any sort of authentication? Because like this, someone could simply set up a request for this script and send nonsense to anyone´s site

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Help Meteobridge users required to test template script
« Reply #9 on: February 21, 2017, 06:26:04 AM »
Wim Im just curious, does the Saratoga script not use any sort of authentication? Because like this, someone could simply set up a request for this script and send nonsense to anyone´s site
It is deemed unnecessary in the postings about realtime http last year. Uploading every 10 seconds a correct file removes unwanted uploads quickly/

I agree with you 100% but i had to take the password checking out of it.
I will make it optional in a next version.

Wim

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #10 on: February 21, 2017, 06:26:30 AM »
As you can see from the output, some commands do not work, this one for example:

wind0avgwind-act=kn

this is because the "avgwind" tag is supposed to be supplied with some kind of a time period (see the example for Meteotemplate, which is for last 5 minutes). If you want to use the current you only use wind0wind-act, but average always has to be from several numbers.

Check which parameters work and which not, and I think you will see how the MB tags work

is this an optional setting from the hardware as Im guessing kmh and mph ,m/s kts are in use ?

and i see barometer is null because i put pressure in the url

i changed/removed the kn from wind .



could you try this please I've added the url

http://boutiquehotelitaly.com/devpws/meteobridgeupload.php?outsideTemp=[th0temp-act]&dewpoint=[th0dew-act]&outsideHumidity=[th0hum-act]&indoorTemp=[thb0temp-act]&indoorHumidity=[thb0hum-act]&barometer=[thb0seapress-act]wind=[wind0avgwind-act]&gust=[wind0wind-act]&winddidrection=[wind0dir-act]&solarradiation=[sol0rad-act:0]&raintoday=[rain0total-daysum]&monthrain=[rain0total-monthsum]&yearrain=[rain0total-yearsum]&rainrate=[rain0rate-act]&UV=[uv0index-act]&heatindex=[th0heatindex-act]&windchill=[wind0chill-act]

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #11 on: February 21, 2017, 06:40:26 AM »
Brian I recommend you use Wim´s script,

you still have errors in your string, for example you are missing the & symbols, look:

....barometer=[thb0seapress-act]wind=[wind0avgwind-act]...

This is missing:

barometer=[thb0seapress-act]&wind=[wind0avgwind-act]&

etc

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #12 on: February 21, 2017, 06:41:14 AM »
Wim Im just curious, does the Saratoga script not use any sort of authentication? Because like this, someone could simply set up a request for this script and send nonsense to anyone´s site
It is deemed unnecessary in the postings about realtime http last year. Uploading every 10 seconds a correct file removes unwanted uploads quickly/

I agree with you 100% but i had to take the password checking out of it.
I will make it optional in a next version.

Wim

Yes, I guess you are right, in case of Meteotemplate this is obviously different becauese it is saving the sent input to the database

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #13 on: February 21, 2017, 06:42:52 AM »
Wim Im just curious, does the Saratoga script not use any sort of authentication? Because like this, someone could simply set up a request for this script and send nonsense to anyone´s site
It is deemed unnecessary in the postings about realtime http last year. Uploading every 10 seconds a correct file removes unwanted uploads quickly/

I agree with you 100% but i had to take the password checking out of it.
I will make it optional in a next version.

Wim

Yes, I guess you are right, in case of Meteotemplate this is obviously different becauese it is saving the sent input to the database

http://boutiquehotelitaly.com/devpws/meteobridgeupload.php?outsideTemp=[th0temp-act]&dewpoint=[th0dew-act]&outsideHumidity=[th0hum-act]&indoorTemp=[thb0temp-act]&indoorHumidity=[thb0hum-act]&barometer=[thb0seapress-act]&wind=[wind0avgwind-act]&gust=[wind0wind-act]&winddidrection=[wind0dir-act]&solarradiation=[sol0rad-act:0]&raintoday=[rain0total-daysum]&monthrain=[rain0total-monthsum]&yearrain=[rain0total-yearsum]&rainrate=[rain0rate-act]&UV=[uv0index-act]&heatindex=[th0heatindex-act]&windchill=[wind0chill-act]
Modify message

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #14 on: February 21, 2017, 06:46:32 AM »
http://boutiquehotelitaly.com/devpws/meteobridgeupload.php?outsideTemp=[th0temp-act]&dewpoint=[th0dew-act]&outsideHumidity=[th0hum-act]&indoorTemp=[thb0temp-act]&indoorHumidity=[thb0hum-act]&barometer=[thb0seapress-act]&wind=[wind0avgwind-act]&gust=[wind0wind-act]&winddidrection=[wind0dir-act]&solarradiation=[sol0rad-act:0]&raintoday=[rain0total-daysum]&monthrain=[rain0total-monthsum]&yearrain=[rain0total-yearsum]&rainrate=[rain0rate-act]&UV=[uv0index-act]&heatindex=[th0heatindex-act]&windchill=[wind0chill-act]


Modified url i think almost there the outputs falls straight into using the template as it is identical to the WS1001 output . thanks for the help i will look at password or just recommend to dump this file in a secret folder somewhere as the template only needs to know where the son file resides..

great help appreciate it

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #15 on: February 21, 2017, 06:46:48 AM »
{"timestamp":"1487677567","updated":"14:46:07","outsideTemp":"9.6","outsideHumidity":"99.0","dewpoint":"9.5","windDir":null,"windSpeed":null,"windGust":null,"windSpeedAvg":null,"rainrate":"0.0","raintoday":"0.6","rainmonth":null,"rainyear":null,"radiation":null,"UV":"[uv0index-act]","indoorTemp":"20.1","indoorHumidity":"16.0","barometer":"1008.9","month":"February","year":"2017","day":"Tuesday","heatindex":"9.6","windchill":"9.6"}

and the time is also incorrect, because it should be 12:46

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #16 on: February 21, 2017, 06:48:25 AM »
{"timestamp":"1487677567","updated":"14:46:07","outsideTemp":"9.6","outsideHumidity":"99.0","dewpoint":"9.5","windDir":null,"windSpeed":null,"windGust":null,"windSpeedAvg":null,"rainrate":"0.0","raintoday":"0.6","rainmonth":null,"rainyear":null,"radiation":null,"UV":"[uv0index-act]","indoorTemp":"20.1","indoorHumidity":"16.0","barometer":"1008.9","month":"February","year":"2017","day":"Tuesday","heatindex":"9.6","windchill":"9.6"}

and the time is also incorrect, because it should be 12:46

thats ok thats the time here in istanbul awesome  stuff so you not UV ?  guess ill have to come up with something for those not using it .

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #17 on: February 21, 2017, 06:48:36 AM »
Brian read my posts above, I told you that this:

wind0avgwind-act

for example will not work, you are using the tag for aggregated data and want one single value (current one). See my Meteotemplate string, which also uses this tag, but it uses it in the correct way with 5min average.

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #18 on: February 21, 2017, 06:49:13 AM »
Brian read my posts above, I told you that this:

wind0avgwind-act

for example will not work, you are using the tag for aggregated data and want one single value (current one). See my Meteotemplate string, which also uses this tag, but it uses it in the correct way with 5min average.

sorry sir

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #19 on: February 21, 2017, 06:49:44 AM »
{"timestamp":"1487677567","updated":"14:46:07","outsideTemp":"9.6","outsideHumidity":"99.0","dewpoint":"9.5","windDir":null,"windSpeed":null,"windGust":null,"windSpeedAvg":null,"rainrate":"0.0","raintoday":"0.6","rainmonth":null,"rainyear":null,"radiation":null,"UV":"[uv0index-act]","indoorTemp":"20.1","indoorHumidity":"16.0","barometer":"1008.9","month":"February","year":"2017","day":"Tuesday","heatindex":"9.6","windchill":"9.6"}

and the time is also incorrect, because it should be 12:46

thats ok thats the time here in istanbul awesome  stuff so you not UV ?  guess ill have to come up with something for those not using it .

Yes, I do not have UV, also no solar sensor. You can specify in the tag what the tag should output when no data is available - and this should be done for the other parameters too, otherwise if some sensor is not reporting it might send total nonsense

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #20 on: February 21, 2017, 06:50:59 AM »
The syntax is like this:

sensor-selector=converter.decimals:replacement

So the "replacement", which is specified at the end after a doublecolon, is what the tag will be replaced with when the data is N/A (sensor does not exist, not report etc.

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #21 on: February 21, 2017, 06:52:24 AM »
let me digest all the posts and ill see what it comes out like I've just seen sims post above so ill take a look at that

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #22 on: February 21, 2017, 07:08:58 AM »
ok Jachym

lets try this one if you see anything in the url and code but i can't see anymore anomalies unless my eyes are deceiving me, I'm sure if I had one i would resolve quickly .

i guess all the metrics and non metric are all user selectable on the hardware meteobridge ?

http://boutiquehotelitaly.com/devpws/meteobridgeupload.php?outsideTemp=[th0temp-act]&dewpoint=[th0dew-act]&outsideHumidity=[th0hum-act]&indoorTemp=[thb0temp-act]&indoorHumidity=[thb0hum-act]&barometer=[thb0seapress-act]&windSpeed=[wind0avgwind-act]&windGust=[wind0wind-act]&windDir=[wind0dir-act]&radiation=[sol0rad-act]&raintoday=[rain0total-daysum]&rainmonth=[rain0total-monthsum]&rainyear=[rain0total-yearsum]&rainrate=[rain0rate-act]&UV=[uv0index-act]&heatindex=[th0heatindex-act]&windchill=[wind0chill-act]

wim im digesting your stuff i will be in touch but if i get this right it will make life a lot easier and not have to re edit the template .

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Help Meteobridge users required to test template script
« Reply #23 on: February 21, 2017, 07:47:28 AM »
{"timestamp":"1487681232","updated":"15:47:12","outsideTemp":"10.5","outsideHumidity":"97.0","dewpoint":"10.0","windDir":"0.0","windSpeed":"1.0","windGust":"2.7","windSpeedAvg":null,"rainrate":"0.0","raintoday":"0.6","rainmonth":"10.8","rainyear":"18.0","radiation":"[sol0rad-act]","UV":"[uv0index-act]","indoorTemp":"19.9","indoorHumidity":"16.0","barometer":"1008.4","month":"February","year":"2017","day":"Tuesday","heatindex":"10.5","windchill":"9.3"}

Offline weather34

  • Forecaster
  • *****
  • Posts: 1068
    • https://weather34.com/homeweatherstation
Re: Help Meteobridge users required to test template script
« Reply #24 on: February 21, 2017, 08:24:39 AM »
Hello Brian,
The MB users of your template here in the Netherlands/Belgium, almost all use the "Saratoga file", even if they do not have a Saratoga template.
It has the same layout as Cumulus and you are using the same code to process it in your scripts.

So why do you want to change something which is already working OK?

Example two sites not using Saratoga but still using a MB with your weather34/ template and using HTTP uploads:
http://www.alainvc.org/weather34/realtime.txt  => http://www.alainvc.org/weather34/
http://www.weerstation-herent.be/realtime2.txt => http://www.weerstation-herent.be/pws/
There are others also testing your template with MB using the same scripts/files.

This is the "template" file for MB, " identical" to a Saratoga version http://www.weerstation-herent.be/mb_brian_http_start.txt
The script used to accept the data is also the same as other scripts used already:
Code: [Select]
<?php ini_set ('display_errors''On');  error_reporting(E_ALL);
#
$filename       "./realtime2.txt";
#
if( isset($_GET['d']) ) {
$string=$_GET['d'];
$ret=file_put_contents ($filename$stringLOCK_EX);
if (!$ret) { echo 'file not saved';} else {echo "<p>Success</p>\n"; }
}

Also available a .zip with all scripts, a readme.txt and a jpg explaining MB http and ftp uploads and how to do the setup for weather34..
Posted that a long time ago in English and converted that to Dutch for users here: http://www.weerstation-herent.be/mb_brian.zip
Can convert it back to English also if needed.

Wim

hi wim

awesome stuff that out put from realtime2.txt is perfect it just fits straight into template

i uploaded just renamed it mb.php if I am reading write all is required in the mb.php is what you have already added if( isset($_GET['d']) etc...

http://boutiquehotelitaly.com/devpws/mb.php?d=[DD]/[MM]/[YYYY] [hh]:[mm]:[ss] [th0temp-act] [th0hum-act] [th0dew-act] [wind0avgwind-act] [wind0wind-act] [wind0dir-act] [rain0rate-act] [rain0total-daysum] [thb0seapress-act] [wind0dir-act] [wind0wind-act=bft.0] m/s C hPa mm -- [thb0seapress-val60:--] [rain0total-monthsum] [rain0total-yearsum] [rain0total-ydaysum] [thb0temp-act] [thb0hum-act] [wind0chill-act] [th0temp-val60:--] [th0temp-dmax] [th0temp-dmaxtime] [th0temp-dmin] [th0temp-dmintime] [wind0avgwind-dmax] [wind0avgwind-dmaxtime] [wind0wind-dmax] [wind0wind-dmaxtime] [thb0seapress-dmax] [thb0seapress-dmaxtime] [thb0seapress-dmin] [thb0seapress-dmintime] [mbsystem-swversion:--] [mbsystem-buildnum:--] [wind0wind-max10] -- -- [uv0index-act:--] -- [sol0rad-act:--] [wind0dir-avg10:--] [rain0total-sum60] -- [mbsystem-daynightflag:--] -- [wind0dir-avg10:--] -- m -- [mbsystem-daylength:--] -- -- [uv0index-dmax:--] [th0hum-dmax] [th0hum-dmaxtime] [th0hum-dmin] [th0hum-dmintime] [th0dew-dmax] [th0dew-dmaxtime] [th0dew-dmin] [th0dew-dmintime]

is it possible to try above to see if generates the realtime.txt ( i renamed it MBrealtimeupload.txt not to confuse with cumulus generated filemname)

the url output file would be http://boutiquehotelitaly.com/devpws/MBrealtimeupload.txt

 

anything