Meteotemplate API

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

Moderator: Mattk

Post Reply
K7RMK
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Thu Oct 03, 2019 9:22 pm

Meteotemplate API

Post by K7RMK »

I have been running Meteotemplate for a few days and thought I would write down my findings with the Meteotemplate Weather Network and some issues with how it sends data for some of the extra sensor data via the API.


I discovered Meteobridge is sending leaf wetness to Meteotemplate as soil moisture.
In Meteobridge, I have the following mappings:
  • th0!20hum - soil0hum - soil moisture #0
  • th0!40hum - leaf0hum - leaf wetness #0
  • th0!41hum - leaf1hum - leaf wetness #1
The way they are sent to the Meteotemplate API:
  • th0!20hum - soil0hum - soil moisture #0 —> SM1
  • th0!40hum - leaf0hum - leaf wetness #0 —> SM2
  • th0!41hum - leaf1hum - leaf wetness #1 —> SM3
The way they should be sent to the Meteotemplate API:
  • th0!20hum - soil0hum - soil moisture #0 —> SM1
  • th0!40hum - leaf0hum - leaf wetness #0 —> LW1
  • th0!41hum - leaf1hum - leaf wetness #1 —> LW2

When a sensor goes offline, it can be problematic if there are multiple sensors of the same type.
For example, if I have 4 soil moisture sensors in Meteobridge being sent to Meteotemplate as follows:
  • th0!20hum - soil0hum - soil moisture #0 —> SM1
  • th0!21hum - soil1hum - soil moisture #1 —> SM2
  • th0!22hum - soil2hum - soil moisture #2 —> SM3
  • th0!23hum - soil3hum - soil moisture #3 —> SM4
And the second sensor goes offline for a bit, this is how Meteobridge sends the data to Meteotemplate:
  • th0!20hum - soil0hum - soil moisture #0 —> SM1
  • th0!21hum - soil1hum - soil moisture #1
  • th0!22hum - soil2hum - soil moisture #2 —> SM2
  • th0!23hum - soil3hum - soil moisture #3 —> SM3
The number mappings should never shift. Even if the weather station was only setup with soil moisture #2 (3 in real life due to Meteobridge starting at 0), it should always map to SM3.


The Meteotemplate API parameters for air quality are PP1,PP2,PP3,… Meteobridge maps to PP0.


I personally have the following sensors and would love to see Meteobridge send this data to Meteotemplate:
  • t0!0temp - soil0temp - soil temperature #0 —> TS1
  • lgt0!0total - lgt0total - number of lightning strikes —> L
K7RMK
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Thu Oct 03, 2019 9:22 pm

Re: Meteotemplate API

Post by K7RMK »

I ended up making my own link and running it as an HTTP event instead of using the built-in Meteotemplate weather network. This is what I came up with:

Code: Select all

meteotemplate/api.php?
PASS=PASSWORD&
U=[epoch:]

#if#{*[th0temp-hold:]=*}#then##else#&T=[th0temp-act.1]#fi#
#if#{*[th0temp-hold:]=*}#then##else#&TMX=[th0temp-max5.1]#fi#
#if#{*[th0temp-hold:]=*}#then##else#&TMN=[th0temp-min5.1]#fi#
#if#{*[th0hum-hold:]=*}#then##else#&H=[th0hum-act.0]#fi#
#if#{*[thb0seapress-hold:]=*}#then##else#&P=[thb0seapress-act.1]#fi#
#if#{*[wind0avgwind-hold:]=*}#then##else#&W=[wind0avgwind-act=kmh.1]#fi#
#if#{*[wind0wind-hold:]=*}#then##else#&G=[wind0wind-max1=kmh.1]#fi#
#if#{*[wind0dir-hold:]=*}#then##else#&B=[wind0dir-act.0]#fi#
#if#{*[rain0total-hold:]=*}#then##else#&R=[rain0total-daysum.1]#fi#
#if#{*[rain0rate-hold:]=*}#then##else#&RR=[rain0rate-act.1]#fi#
#if#{*[sol0rad-hold:]=*}#then##else#&S=[sol0rad-act.1]#fi#

#if#{*[uv0index-hold:]=*}#then##else#&UV=[uv0index-act.0]#fi#

#if#{*[thb0temp-hold:]=*}#then##else#&TIN=[thb0temp-act.1]#fi#
#if#{*[th1temp-hold:]=*}#then##else#&T1=[th1temp-act.1]#fi#
#if#{*[th2temp-hold:]=*}#then##else#&T2=[th2temp-act.1]#fi#
#if#{*[th3temp-hold:]=*}#then##else#&T3=[th3temp-act.1]#fi#
#if#{*[th4temp-hold:]=*}#then##else#&T4=[th4temp-act.1]#fi#
#if#{*[soil0temp-hold:]=*}#then##else#&TS1=[soil0temp-act.1]#fi#
#if#{*[soil1temp-hold:]=*}#then##else#&TS2=[soil1temp-act.1]#fi#
#if#{*[soil2temp-hold:]=*}#then##else#&TS3=[soil2temp-act.1]#fi#
#if#{*[soil3temp-hold:]=*}#then##else#&TS4=[soil3temp-act.1]#fi#

#if#{*[thb0hum-hold:]=*}#then##else#&HIN=[thb0hum-act.0]#fi#
#if#{*[th1hum-hold:]=*}#then##else#&H1=[th1hum-act.0]#fi#
#if#{*[th2hum-hold:]=*}#then##else#&H2=[th2hum-act.0]#fi#
#if#{*[th3hum-hold:]=*}#then##else#&H3=[th3hum-act.0]#fi#
#if#{*[th4hum-hold:]=*}#then##else#&H4=[th4hum-act.0]#fi#

#if#{*[leaf0hum-hold:]=*}#then##else#&LW1={*[leaf0hum-act.0]/(6+(2/3))*0}#fi#
#if#{*[leaf1hum-hold:]=*}#then##else#&LW2={*[leaf1hum-act.0]/(6+(2/3))*0}#fi#
#if#{*[leaf2hum-hold:]=*}#then##else#&LW3={*[leaf2hum-act.0]/(6+(2/3))*0}#fi#
#if#{*[leaf3hum-hold:]=*}#then##else#&LW4={*[leaf3hum-act.0]/(6+(2/3))*0}#fi#

#if#{*[soil0hum-hold:]=*}#then##else#&SM1=[soil0hum-act.0]#fi#
#if#{*[soil1hum-hold:]=*}#then##else#&SM2=[soil1hum-act.0]#fi#
#if#{*[soil2hum-hold:]=*}#then##else#&SM3=[soil2hum-act.0]#fi#
#if#{*[soil3hum-hold:]=*}#then##else#&SM4=[soil3hum-act.0]#fi#

#if#{*[lgt0total-hold:]=*}#then##else#&L=[lgt0total-daysum.0]#fi#

#if#{*[air0pm-hold:]=*}#then##else#&PP1=[air0pm-act.0]#fi#
#if#{*[air1pm-hold:]=*}#then##else#&PP2=[air1pm-act.0]#fi#
#if#{*[air2pm-hold:]=*}#then##else#&PP3=[air2pm-act.0]#fi#
#if#{*[air3pm-hold:]=*}#then##else#&PP4=[air3pm-act.0]#fi#
It's pasted into Meteobridge as one long link but I have it broken down into individual lines to make it more readable. It fixes all of the issues I had found with the built-in weather network for Meteotemplate.
alexvanuxem
Junior Boarder
Junior Boarder
Posts: 30
Joined: Mon Jun 06, 2022 6:55 pm

Re: Meteotemplate API

Post by alexvanuxem »

strange, I don't see that issue.

Leaf wetness is captured through the meteotemplate as LW1, LW2,...

for the PP I have a modified api.php that renaims PP0 to PP1, problem fixed.

which version of meteotemplate are you using, I use now v 19.0.

Cheers
Post Reply