Add support for HOMEWEATHERSTATION template

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

stormchaser88
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: Fri Mar 24, 2017 10:37 am

Add support for HOMEWEATHERSTATION template

Post by stormchaser88 » Fri Mar 24, 2017 10:41 am

Hello

this my first post , is it possible to add support for the HOMEWEATHERSTATION template by brian underdown ?

User avatar
Ian.
Junior Boarder
Junior Boarder
Posts: 27
Joined: Tue Dec 20, 2016 12:01 am
Location: Chatteris, Cambridgeshire, UK
Contact:

Re: Add support for HOMEWEATHERSTATION template

Post by Ian. » Fri Mar 24, 2017 12:51 pm

I use a Saratoga template http://saratoga-weather.org/wxtemplates/install.php and this generates a MBrealtime.txt file which HomeWeatherStation can work with.

Thats how mines configured.

Ian
CWOP - DW3371
PWS - ICAMBRID16
https://www.chatteris.biz
Image

stormchaser88
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: Fri Mar 24, 2017 10:37 am

Re: Add support for HOMEWEATHERSTATION template

Post by stormchaser88 » Sat Mar 25, 2017 11:25 am

I seen that but on Wxforum they also use direct method ,could this not be added into Meteobridge..?

BchWdLks
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Sat Mar 25, 2017 7:41 pm

Re: Add support for HOMEWEATHERSTATION template

Post by BchWdLks » Sat Mar 25, 2017 8:19 pm

stormchaser88 wrote:Hello

this my first post , is it possible to add support for the HOMEWEATHERSTATION template by brian underdown ?
The work to use HOMEWEATHERSTATION has already been done. You can set it up as Meteobridge service in a few minutes:
  • 1. Login to Meteobridge and go to the "services" tab
  • 2. Add a new “HTTP Request” of the “Periodical” type.
  • 3. The 'template' is (THIS IS ALL ONE LINE !!!) “http://(Your HOMEWEATHERSTATION url)/mb.php?d=[DD]/[MM]/[YYYY]%20[hh]:[mm]:[ss]%20[th0temp-act]%20[th0hum-act]%20[th0dew-act]%20[wind0avgwind-act]%20[wind0wind-act]%20[wind0dir-act]%20[rain0rate-act]%20[rain0total-daysum]%20[thb0seapress-act]%20[wind0dir-act]%20[wind0wind-act=bft.0]%20m/s%20C%20hPa%20mm%20--%20[thb0seapress-val60:--]%20[rain0total-monthsum]%20[rain0total-yearsum]%20[rain0total-ydaysum]%20[thb0temp-act]%20[thb0hum-act]%20[wind0chill-act]%20[th0temp-val60:--]%20[th0temp-dmax]%20[th0temp-dmaxtime]%20[th0temp-dmin]%20[th0temp-dmintime]%20[wind0avgwind-dmax]%20[wind0avgwind-dmaxtime]%20[wind0wind-dmax]%20[wind0wind-dmaxtime]%20[thb0seapress-dmax]%20[thb0seapress-dmaxtime]%20[thb0seapress-dmin]%20[thb0seapress-dmintime]%20[mbsystem-swversion:--]%20[mbsystem-buildnum:--]%20[wind0wind-max10]%20--%20--%20[uv0index-act:--]%20--%20[sol0rad-act:--]%20[wind0dir-avg10:--]%20[rain0total-sum60]%20--%20[mbsystem-daynightflag:--]%20--%20[wind0dir-avg10:--]%20--%20m%20--%20[mbsystem-daylength:--]%20--%20--%20[uv0index-dmax:--]%20[th0hum-dmax]%20[th0hum-dmaxtime]%20[th0hum-dmin]%20[th0hum-dmintime]%20[th0dew-dmax]%20[th0dew-dmaxtime]%20[th0dew-dmin]%20[th0dew-dmintime]" (THIS IS ALL ONE LINE !!!)
  • 4. Click the SAVE button at the Bottom of the ‘Services’ tab – it might not be visible on the screen and can be very easy to miss. You might have to scroll to the bottom to find it.
  • 5. Click the TEST button and if your settings are correct, you will have a MBrealtimeupload.txt in your "HOMEWEATHERSTATION " directory. Make sure that the setting "Software Type & Path to Data file" on the HOMEWEATHERSTATION easy setup screen is correct."
  • 6. On my web server, after it was created the 1st time, I had to adjust the permissions of the MBrealtimeupload.txt so that Meteobridge could write over it with each update.

stormchaser88
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: Fri Mar 24, 2017 10:37 am

Re: Add support for HOMEWEATHERSTATION template

Post by stormchaser88 » Sun Mar 26, 2017 8:02 am

Hi thanks what I was asking if this could be added into meteobridge instead of having to paste all that code into .

Like select homeweatherstation or something I am using that method now just thought it would easier to have the option .

Yes I had to delete the file you mentioned and it created a another straight away think it was file permission problem.

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 5025
Joined: Mon Oct 01, 2007 10:51 pm

Re: Add support for HOMEWEATHERSTATION template

Post by admin » Mon Mar 27, 2017 8:54 pm

I offered Brian support by making it a standard weather network upload feature, but he did not take my offer so far. I am still happy to include, but will need some more info like: fastest upload interval, return code on success, default values where not covered by the colon-mechanism, etc

wsnoordbergum
Senior Boarder
Senior Boarder
Posts: 56
Joined: Wed Jan 14, 2015 12:33 pm

Re: Add support for HOMEWEATHERSTATION template

Post by wsnoordbergum » Mon Mar 27, 2017 10:03 pm

I also use the http upload.
I have adapted the MBrealtime.php script
Uploadinterval is set every 10 seconds.
I use the same uploadpath as I use for my leuven template.
This has to be set in the script.
I do not use the % between the values but spaces.
It is quite easy to use the http upload.
It is important that the correct sequence is used.
This is what I have:

http://www.yoursite.com/MBrealtimeGet.p ... [MM]/[YYYY] [hh]:[mm]:[ss] [th0temp-act:0] [th0hum-act:0] [th0dew-act:0] [wind0avgwind-act] [wind0wind-act] [wind0dir-act:0] [rain0rate-act:0] [rain0total-daysum:0] [thb0seapress-act:0] [wind0dir-act:0] [wind0wind-act=bft.0:0] m/s C hPA mm -- [thb0seapress-delta60:--] [rain0total-monthsum:--] [rain0total-yearsum:--] [rain0total-ydaysum:--] 20.0 55.0 [wind0chill-act:--] [th0temp-delta60:--] [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] [th0hum-dmaxtime] [th0hum-dmin] [th0hum-dmintime]

The values 20.0 and 55.0 are the values for inside temp and humidity, since I use meteostick I set them at these values.
The php scripts puts the data in the correct file and path.

The newest version of homeweatherstation does not use the cronjobs anymore.

Cheers wsNoordbergum

weatherist34
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: Tue Mar 28, 2017 6:57 am

Re: Add support for HOMEWEATHERSTATION template

Post by weatherist34 » Tue Mar 28, 2017 7:21 am

good morning

have been pointed here to this forum so here goes .

firstly I have gone back through my emails to look for any correspondence in reference to adding to meteobridge i couldnt find any , only reference I am aware of is from the wxforum which i responded albeit a week or so later as I missed that post.

I do not own a meteobridge and possibilities of getting one is difficult not due to cost of affording one, simply here in Istanbul , Turkey getting items like this require additional paperwork clearance,import duty costs,clearance costs and administration costs probably would amount to as much as the unit would costs and considerable time to and throwing to the customs office. It would not be even possible if I was visiting europe to bring one back as personal luggage simply items like this are scrutinised and would be seen as suspicious due to the current political climate and other matters that we live amongst today.

So the template uses a very very simple method of receiving data from a meteobridge , this was created by Wim of Leuven template fame and there has been no part on my side to do anything specific to cater for meteobridge apart from add the the simple mb.php file.Wim simply worked out what was required from the meteobridge without any need to change template structure which it all worked first time when I tried and now added it in as option using the easyweathersetup.php .

Image

Intervals there is no restriction as the template looks for the file MBrealtimeupload.txt which created by the mb.php everytime it is polled or pinged which ever way you want to term it it basically calls that file mb.php at whatever interval you set the upload from meteobridge to. the template updates the visual output based on the user setting by default the lowest interval is 16 seconds however most davis users go down to 2-3 seconds for things like wind speed and rain rate. each output like temperature,wind,barometer etc can be fined tuned in the template itself it does not require anything from meteobridge other than the upload

this is exactly what the template uses


http://yoururl.com/pws/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]


and the output captured in the MBrealtimeupload.txt is

21/02/2017 15:42:01 10.7 97.0 10.2 0.0 0.0 286.0 0.0 9.0 1018.2 286.0 0 m/s C hPa mm -- 1018.7 15.6 36.8 0.2 18.8 64.0 10.7 10.4 11.3 20170221112104 10.0 20170221125453 1.3 20170221001115 4.0 20170221005341 1019.5 20170221120516 1017.4 20170221043516 3.2 3629 0.0 -- -- -- -- 51.0 286.0 0.2 -- D -- 286.0 -- m -- 10:27 -- -- -- 97.0 20170221020538 95.0 20170221000005 10.8 20170221112104 9.5 20170221125453

I know there may be many more data values available to send but the template only uses the data values above any others added would not be used or may screw up the useage of meteobridge via this method .

so above is exactly what is used , if you would like access to my development server page to test i can provide that via email however you would only be pinging/polling the mb.php file .
the server is setup to accept meteobridge using the method above.

If you can email me at postmasterATweather34.com i would be glad to help out.

brian
Last edited by weatherist34 on Sun Apr 02, 2017 2:00 pm, edited 1 time in total.

weatherist34
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: Tue Mar 28, 2017 6:57 am

Re: Add support for HOMEWEATHERSTATION template

Post by weatherist34 » Fri Mar 31, 2017 7:37 am

hello

is there any movement on this ,I have prepared a new easysetup option in the template to use the feature when it is available if there is please get in touch via email .

this forum is full of spam posts and I am bit sceptical of using it .

brian

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 5025
Joined: Mon Oct 01, 2007 10:51 pm

Re: Add support for HOMEWEATHERSTATION template

Post by admin » Sun Apr 02, 2017 12:08 pm

I did send a pm as you requested.

weatherist34
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: Tue Mar 28, 2017 6:57 am

Re: Add support for HOMEWEATHERSTATION template

Post by weatherist34 » Sun Apr 02, 2017 1:56 pm

admin wrote:I did send a pm as you requested.
ok i got it , i have forwarded on to Wim as he has a far more better understanding of meteobridge than I . i have explained in post above.

the interval 5-10 seconds is fine as the template reads the final data received from the MBrealtimeupload.txt file generated by mb.php very simple script
<?php ini_set ('display_errors', 'On'); error_reporting(E_ALL);
// courtesy of Wim Van der Kuil //
$filename = "MBrealtimeupload.txt";
if( isset($_GET['d']) ) {
$string=$_GET['d'];
file_put_contents($filename, $string);
}
;?>

this file mb.php is capturing the data uploaded and output to MBrealtimeupload.txt

default values if data is null or zero the nothing is displayed

password not needed and not used by any of the other methods to capture data generated by , weather-display,cumulus,ws1001,davis weather link, weewx

all data captured is then converted to same output so we can easily use all the different software generated files from above .

i hope this is of help .

only thing I would change in the upload script is can we use [th0temp-val10:--] as opposed to [th0temp-val60:--] for temperature realtime 10 minute trend movement , again not having a meteobridge I cant test this idea.

we would simply calculate the different against current temperature to the temperature 10 minutes ago

brian

User avatar
wvdkuil
Platinum Boarder
Platinum Boarder
Posts: 328
Joined: Sun Jul 24, 2011 8:00 pm
Location: Belgium
Contact:

Re: Add support for HOMEWEATHERSTATION template

Post by wvdkuil » Thu Apr 06, 2017 2:01 pm

I am confused about what we want to accomplish.

A template installation, such as this one, or Saratoga or Leuven, is different from a "Standard Network" such as Awekas or WU.
Jachyms MeteoTemplate also functions as a weather-program, as it only accepts the realtime data and calculate all other values (min/max a.s.o.) on the webserver.

Upload and processing
=> For a "Standard Network" and for Jachym MeteoTemplate uploads are processed immediately on arrival at the server, stored in a database a.s.o.
=> For the other 3 templates mentioned above, the data is stored in a text file and only processed when there is a visitor to the user-website

Upload location:
=> For a "Standard Network" the upload location is one "big server" uand is the same for all members. Script name and variables are the same, different userid / passwords are used to recognize different users
=> For all templates the upload-location is different for every member => it is the private website of the template user and the name of the accepting http upload script can be different and the folder is also different in most cases.

Lets assume that a new release of the templates needs a new "template file".
If it is implemented as a "Standard Network", how would it be possible to support multiple versions?
Boris has to adept the "Standard Network"-template.
After a user restarts its MB, a new "Standard Network"-template would be used even if the target website is running the previous release.

The only problem I have found with the more then 70 Meteobridge users of the Leuven-Template is the length of the string after the ? in the URL for the HTTP upload. And therefor I totally agree with @stormchaser88 post
Hi thanks what I was asking if this could be added into meteobridge instead of having to paste all that code into .
Compare the two methods of uploading with MB:
FTP uploads with MB are as simple and straight forward as possible.
1. Set frequency => using the dropdown.
2. Template url => type the location of the file: http://www.mywebsite.com/myfile_to_proc ... upload.txt and hit the button if it is changed
3. Path: => type the location to store the file httpsddocs/myfolder/myfilename.txt

One specifies the location on its server and the "template file" to process.
The "template file" can be stored in any location/folder/server.
Changing the "template file" is easy and with one press of a button, the new, customized "template file" is operational.

HTTP uploads are far more difficult for first-time users as the location and the "template file" are combined into one string.
That very long string needs two extra steps which are difficult / cumbersome
1. The first part must be changed with the website / script-name to process the data
2. and then the complete string must be copied as one long string into a "short" field in the Meteobridge setup screen.

Solution I propose:
If Boris could split the HTTP push services URL in two parts, about the same as for FTP, every http upload would be as simple as
1. Set frequency => using the dropdown
2. Template url => type the location of the file: http://www.mywebsite.com/myfile_to_proc ... upload.txt and hit the button if it is changed
3. Process => type the script-name to accept the http request: http://www.mywebsite.com/myscript.php?
4. Success: type whatever string needed.

Also including password processing would be far easier, only change
3. Process (or whatever name) => http://www.mywebsite.com/myscript.php?mypass=12345&

Implementing this in a next release of MB would also NOT affect current users as after the upgrade
=> the "Template url" field would be empty
=> and the original long combined string with location and "template file" would be in the "Process' field.

Wim

stewart45
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: Tue Dec 16, 2014 6:43 pm

Re: Add support for HOMEWEATHERSTATION template

Post by stewart45 » Thu Apr 27, 2017 6:56 pm

Is there any time frame as to when this might be added

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 5025
Joined: Mon Oct 01, 2007 10:51 pm

Re: Add support for HOMEWEATHERSTATION template

Post by admin » Sun May 28, 2017 11:19 pm

Support will be added to the next update coming soon.

New feature will be in the Meteobridge weather network section, as we did for the Meteotemplate. Upload template will expect to find a mb.php script at the user-defined server URL and it will report data via a HTTP GET request. mb.php takes filled template given via URL parameter "d" and stores this into a realtime.txt file on the server.

Template used to generate this file can be adapted independent from future Meteobridge releases and is located at:
http://content.meteobridge.com/template ... n.template

weatherist34
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: Tue Mar 28, 2017 6:57 am

MYSQL Added for HOMEWEATHERSTATION template

Post by weatherist34 » Fri Oct 06, 2017 10:16 am

admin wrote:
Sun May 28, 2017 11:19 pm
Support will be added to the next update coming soon.

New feature will be in the Meteobridge weather network section, as we did for the Meteotemplate. Upload template will expect to find a mb.php script at the user-defined server URL and it will report data via a HTTP GET request. mb.php takes filled template given via URL parameter "d" and stores this into a realtime.txt file on the server.

Template used to generate this file can be adapted independent from future Meteobridge releases and is located at:
http://content.meteobridge.com/template ... n.template
added database support

good morning you can now download the MYSQL version which is kind exclusive to the meteobridge API users . i have included a set up guide in the download .

basically the meteobridge is doing everything from inserting in to database , creating chart files for year, month and daily maintenance which prevents the database becoming excessive in size i.e millions of rows which in time will drag your server to a slow performance , MYSQL is efficient but also realise there is a cpu PERFORMANCE HIT especially noticeable on low cost shared hosting environments. doing daily maintenance or weekly maintenance keeps everything running efficiently. remember I hate slow performing websites
so I always try to find a way to avoid adding something new and then only to find its a performance hit..

so example.. 10 visitors to your site all simultaneously calling millions of rows from your database result equals big slow down !!

in the download if you read the set up guide mbx5mysqlsetup.pdf you will see how i set it all up with any use of cron jobs and added a small maintenace script to run at end of each day at 00:00 . in the setup guide there are images to help . snippet below. as always available at https://weather34.com/homeweatherstation and is running at https://weather34.com

1.enter your phpmyadmin screen via cPanel
or whichever method you use to access.
2.create a database called weatherstation
3.select / highlight database called weatherstation
4.now import the weatherstation.sql file
provided in the download .



if all was done correctly you should see some sample values *note it contains sample
data this has to be removed before you connect
your meteobridge to the database.

now empty the database using the operations tab
and TRUNCATE .


Part 2.
meteobridge setup , meteobridge is going to
do all the work for us . *note we do not need any
cron job services or setup of cron job we are going to
simulate and let meteobridge do everything.

these files are in the folder /mdbfiles
stationcron.php
1.select services tab shown above
2.GOTO new select service and choose
HTTP REQUEST
3.GOTO select event type and choose
PERIODICALLY
4.set the stationcron.php url to run
every 15 minutes.

addtoyear.php
1.GOTO new select service and choose
HTTP REQUEST
3.GOTO select event type and choose
Specific Time
4.set the addtoyear.php url to run
every 23:45.

empty.php
1.GOTO new select service and choose
HTTP REQUEST
3.GOTO select event type and choose
Specific Time
4.set the empty.php url to run
every 00:00.

you can manually test these but please empty
the tables via (TRUNCATE) method afterwards.

easyweathersetup.php

open easyweathersetup.php add in the following

1.add database username
2.add database password
3.database name weatherstation

then check other settings.

and save.

Post Reply