HTTP event question **solved**

This section covers the Meteobridge PRO units exclusively

Moderator: Mattk

Post Reply
mpriest
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: Fri Feb 01, 2019 10:06 pm

HTTP event question **solved**

Post by mpriest » Fri Feb 01, 2019 10:24 pm

Hello ,

I am using this http event url:
http://www.webcamwassenaar.nl/wxdata/re ... d]kn&gust=[wind0wind-max6=kn.0:--]kn&richting=[wind0dir]

With this php:
<?php
$U = $_GET['epoch'];
$wind = $_GET['wind'];
$gust = $_GET['gust'];
$richting = $_GET['richting'];
$values = array($U,$wind, $gust, $richting);
$result = json_encode($values);
file_put_contents("datawaswind.txt",$result);
?>

The response in the resulting txt file is :
[null,"[wind0wind]kn","1kn","[wind0dir]"]

What's wrong ? who knows?

User avatar
ConligWX
Gold Boarder
Gold Boarder
Posts: 215
Joined: Wed Nov 14, 2018 12:48 pm
Location: Conlig, Co. Down, UK
Contact:

Re: HTTP event question

Post by ConligWX » Sat Feb 02, 2019 1:38 am

the correct way of calling a sensor is:

sensor-selector=converter.decimals:replacement

"converter", "decimals" and "replacement" can be omitted, "sensor" and "type"(selector) are mandatory.

While "sensor" tells what sensor and what piece of information of the sensor to use, "selector" decides data from what time period should be taken into account and "converter" does convert data into measurement units the user likes most. "Decimals" decides about precision the result should be shown in and "replacement" gives the string to be returned when there is no data for defined sensor available.

so
[wind0dir] should be something like: [wind0dir-act]


https://www.meteobridge.com/wiki/index.php/Templates

Look at "Selectors"

Post Reply