Difference between pages "Getting Started" and "Templates"

From meteoplug
(Difference between pages)
Jump to: navigation, search
 
 
Line 1: Line 1:
 +
__NOTOC__
 
<languages /><translate>
 
<languages /><translate>
 
<!--T:1-->
 
<!--T:1-->
__NOTOC__
+
<br />Meteobridge provides a very flexible mechanism to smuggle sensor data of different kinds into strings to be used by Meteobrdge push services like Twitter, HTTP GET uploads or MSQL database insert requests.
<br />To make a Meteobridge out of TP-LINK routers TL-MR3020 or TL-WR703N, you simply habe to install an applicable Meteobridge firmware image. Flashing the firmware can be done with the firmware update functions the router's stock firmware does provide. By doing so you will void the TP-LINK warranty, but having the cheap price in mind you will certainly not face a substantial financial risk in the unlikely event that you brick the router.  
+
Simply type in the text you want to upload and represent the pieces of sensor data by so called variables. When data gets uploaded, these variables will be replaced by current sensor data and so a string filled with the data you intended will be uploaded.
  
==Flashing Meteobridge Firmware to TL-MR3020== <!--T:2-->
+
<!--T:2-->
Please consult the TP-Link manual to understand how to get access with your browser to its web interface. What the manual will tell you is basically that you have to connect your PC/Laptop via ethernet cable, and log in to the router's web interface (IP is 192.168.0.254, login name is "admin", password: "admin").  
+
Each variable starts with an opening square bracket "[" and is terminated by a closing square bracket "]". The structure of the variable name between these brackets is as follows: <pre>sensor-selector=converter.decimals:replacement</pre>
When you have access to web interface of TL-MR3020, overwrite factory firmware like a regular firmware update by [http://www.meteohub.de/files/meteobridge-tl-mr3020-v1.0.bin meteobridge-tl-mr3020-v1.0.bin]. Wait until unit restarts. After that it will be a Meteobridge client in standard configuration receiving an IP via DHCP from your router in the LAN.
+
"converter", "decimals" and "replacement" can be omitted, "sensor" and "type" 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.
  
==Flashing Meteobridge Firmware to TL-WR703N== <!--T:3-->
+
==Sensors== <!--T:3-->
As TL-WR703N does only come with a Chinese web interface, it might be a bit tricky to find the right menu item to initiate firmware update. First you have to login with your browser. To achieve that you have to connect your PC/Laptop via ethernet cable, and log in to the router's web interface (IP is 192.168.1.1, login name is "admin", password: "admin").  
+
These sensors are defined in Meteobridge.
 +
* '''th0temp''': outdoor temperature in degrees Celsius
 +
* '''th0hum''': relative outdoor humidity as percentage
 +
* '''th0dew''': outdoor dew point in degrees Celsius
 +
* '''thb0temp''': indoor temperature in degrees Celsius
 +
* '''thb0hum''': indoor humidity as percentage
 +
* '''thb0dew''': indoor dewpoint in degrees Celsius
 +
* '''thb0press''': station pressure in hPa
 +
* '''thb0seapress''': normalized pressure (computed to sea level) in hPa
 +
* '''wind0wind''': wind speed in m/s
 +
* '''wind0avgwind''': average windspeed in m/s (time used for average depends on station)
 +
* '''wind0dir''': wind direction in degress (is North)
 +
* '''wind0chill''': wind chill temperature in degrees Celsius
 +
* '''rain0rate''': rain rate in mm/h
 +
* '''rain0total''': rain fall in mm
 +
* '''uv0index''': uv index
 +
* '''sol0rad''': solar radiation in W/m^2
 +
If a sensor is not there or data of sensor has passed the "tolerated data age" interval, Meteobridge will not provide data for it and will present the value defined as "replacement". If no replacement is given, variable will not be converted into data but will stay as is.
  
<!--T:4-->
+
==Selectors== <!--T:4-->
When you have access to web interface of TL-WR703N, you select the item at the bottom of the left menu items, marked in light red on the left picture below (system screen). Next you choose sub menu item as marked in light red in the right picture below (flash screen) and browse to target file by pressing light red marked file select dialog in the middle of the screen. You find Meteobridge firmware for this device here: [http://www.meteohub.de/files/meteobridge-tl-wr703n-v1.0.bin meteobridge-tl-wr703n-v1.0.bin]
+
Sensors are followed by a selector (syntactically separated by a dash) that specifies what period in time should be used for evaluation. Valid selectors are:
 +
* '''act''': most recent data
 +
* '''hmin''': minimum value of this hour
 +
* '''hmax''': maximum value of this hour
 +
* '''dmin''': minimum value of today
 +
* '''dmax''': maximum value of today
 +
* '''ydmin''': minimum value of yesterday
 +
* '''ydmax''': maximum value of yesterday
 +
* '''mmin''': minimum value of this month
 +
* '''mmax''': maximum value of this month
 +
* '''ymin''': minimum value of this year
 +
* '''ymax''': maximum value of this year
 +
* '''amin''': minimum value of all time
 +
* '''amax''': maximum value of all time
 +
* '''daysum or sumday''', '''monthsum''', '''yearsum''', '''allsum''', '''ydaysum''': selects summerized delta values from today, this month, this year, all time or yesterday: "rain0total-sumday" is todays rain fall.
 +
 
 +
When you are interested in timestamps of min/max values, you can make use of these selectors:
 +
* '''hmintime''': timestamp of minimum value of this hour
 +
* '''hmaxtime''': timestamp of maximum value of this hour
 +
* '''dmintime''': timestamp of minimum value of today
 +
* '''dmaxtime''': timestamp of maximum value of today
 +
* '''ydmintime''': timestamp of minimum value of yesterday
 +
* '''ydmaxtime''': timestamp of maximum value of yesterday
 +
* '''mmintime''': timestamp of minimum value of this month
 +
* '''mmaxtime''': timestamp of maximum value of this month
 +
* '''ymintime''': timestamp of minimum value of this year
 +
* '''ymaxtime''': timestamp of maximum value of this year
 +
* '''amintime''': timestamp of minimum value of all time
 +
* '''amaxtime''': timestamp of maximum value of all time
 +
Timestamps are strings of format "YYYYMMDDhhmmss". Year "YYYY" is reported in 4 digits, all other values (month "MM", day "DD", hour "hh", minute "mm", second "ss") come with 2 digits, leading zeros are not supressed.  
  
 
<!--T:5-->
 
<!--T:5-->
<gallery>
+
Apart from selectors that use absolute, predefined time slots there are also selectors that look for a certain amount of time into the past.
File:wr703n-p1.png|system screen
+
* '''max2''', '''max5''', '''max10''', '''max15''', '''max30''', '''max60''': selects the maximum value from the last 2, 5, 10, 15, 30 or 60 minutes
File:wr703n-p2.png|flash screen
+
* '''min2''', '''min5''', '''min10''', '''min15''', '''min30''', '''min60''': selects the minimum value from the last 2, 5, 10, 15, 30 or 60 minutes
</gallery>
+
* '''avg2''', '''avg5''', '''avg10''', '''avg15''', '''avg30''', '''avg60''': selects average value from the last 2, 5, 10, 15, 30 or 60 minutes
 +
* '''sum2''', '''sum5''', '''sum10''', '''sum15''', '''sum30''', '''sum60''': selects summerized delta values from the last 2, 5, 10, 15, 30 or 60 minutes, which is useful to get amount of total rain in a certain time frame: "rain0total-sum60" is rainfall im mm of last 60 minutes.
  
<!--T:6-->
+
==Converters== <!--T:6-->
Finally, a "are you sure" dialog will pop up, please press "yes" button and wait until progress bar has reached 100%. Unit will reboot automatically. After reboot it will be a Meteobridge in standard configuration receiving an IP via DHCP from your router in the LAN.
+
Sensor data is reported in ISO units (°C, hPa, mm, m/s) by default, but can be converted into non-ISO units (imperial) by adding a conversion token. Defined tokens are:
 +
* '''F''' converts temperature from Celsius to Fahrenheit.
 +
* '''psi''' converts pressure from hPa (equivalent to mbar) to psi.
 +
* '''mmHg''' converts pressure from hPa to millimeters of mercury.
 +
* '''inHg''' converts pressure from hPa to inches of mercury.
 +
* '''kmh''' converts wind speed from meters per second to kilometers per hour.
 +
* '''mph''' converts wind speed from meters per second to miles per hour.
 +
* '''kn''' converts wind speed from meters per second to knots.
 +
* '''bft''' converts wind speed from meters per second to Beaufort scale.
 +
* '''in''' converts millimeters to inches.
 +
If an unknown conversion string is used, no conversion will take place, no error message will appear.
  
==Flashing Meteobridge Firmware to WL-330N3G== <!--T:7-->
+
==Special Variables== <!--T:7-->
As ASUS WL-330N3G cannot be flashed by its stock web interface, it is necessary that you setup a TFTP environment on your Host PC to transfer the flash data via Ethernet to WL-330N3G. Using TFTP is quite simple.  
+
There are a couple of variables that don't come as "sensor-selector=converter" chains but have a distinct meaning by themselves.
  
 
<!--T:8-->
 
<!--T:8-->
First of all the router needs to toggled into "TFTP update mode". This is done by keeping the button on the top pressed for 5-10 seconds while doing a power cycle. After a couple of seconds the power LED starts a very slow blinking. You can now release the button. Router now waits for being firmware-updated via TFTP.
+
Date und time variables are defined as follows:
 +
* '''YYYY''': year as four digit number
 +
* '''YY''': year as two digit number
 +
* '''MM''': month as two digit number, if only one digit neede a zero will be used as first digit
 +
* '''M''': month as one or two digit number, no leading zeros
 +
* '''DD''': day of month as two digit number, if only one digit neede a zero will be used as first digit
 +
* '''D''': day of month as one or two digit number, no leading zeros
 +
* '''hh''': hour as two digit number, if only one digit neede a zero will be used as first digit
 +
* '''h''': hour as one or two digit number, no leading zeros
 +
* '''mm''': minute as two digit number, if only one digit neede a zero will be used as first digit
 +
* '''m''': minute as one or two digit number, no leading zeros
 +
* '''ss''': seconds as two digit number, if only one digit neede a zero will be used as first digit
 +
* '''s''': seconds as one or two digit number, no leading zeros
 +
When a capital "U" preceeds a date/time variable name, UTC is used instead of local time ("[Uhh]:[Umm]:[Uss] UTC" is evaluated to a string like "16:03:33 UTC")
  
<!--T:9-->
+
==Decimals== <!--T:9-->
Sections below describe how to do it for Linux and Windows 7.
+
Unless otherwise defined numbers are reported with one decimal. By specifying a value for "decimals" you can determine resolution of presented values.
  
===Flashing via TFTP on Linux=== <!--T:10-->
+
==Replacement== <!--T:10-->
TFTP update does not need any additional software installed, your Linux already has all you need. Flashing is very straight forward, just execute the script below.<pre>#!/bin/sh
+
When a variable is not defined or there is no data for a specified sensor, information specified as "replacement" string will be represented instead.
#
+
if [ "$1" = "" ]
+
then
+
  echo "error: flash sys file missing as parameter"
+
  exit 1
+
else
+
  echo "power cycle WL-330N3G with button pressed and wait"
+
  echo "until power LED does go off and on again. Then "
+
  echo "release button and press <RETURN>."
+
  read a
+
  echo "start flashing..."
+
  ifconfig br0:0 192.168.1.20
+
  echo -ne "binary\ntrace\nrexmt 1\nput $1\nquit\n" | tftp 192.168.1.1
+
  echo "...transfer done."
+
  echo "Wait until unit does reboot (will take at least 2 minutes). "
+
  echo "Do not remove from power during flash process!"
+
fi
+
</pre>
+
The script needs to be called with the flash update file [http://www.meteohub.de/files/meteobridge-wl-330n3g-v1.0.sys meteobridge-wl-330n3g-v1.0.sys] as parameter. Please execute the script as root, otherwise "ifconfig" and "tftp" will not do or will ask for root password. "ifconfig" sets a virtual ethernet adapter with IP 192.168.1.20 on your Linux box, which is the IP the router expects to get the firmware update from.
+
  
===Flashing via TFTP on Windows 7=== <!--T:11-->
+
==Examples== <!--T:11-->
First you have to enable the TFTP service of your Windows 7. You can do that by
+
Having a look at examples usually helps to understand how easy that is.
# Open Control Panel > Programs and Features
+
# Click "Turn Windows features on or off" on left side menu
+
# Enable "TFTP Client" then click OK button
+
  
 
<!--T:12-->
 
<!--T:12-->
Next step is to set the IP of your hosts Ethernet adapter to "192.168.1.20". This will disconnect your Host from your network (as far as your equip is not in the 192.168.1.x class c subnet) but it is necessary to use this distinct IP address in order to make the WL-330N3G to accept the flash data transfer.
+
# Template <font face="Courier"><span style="background-color:lightgrey;">Outdoor temperature is [th0temp-act=F.1:--]°F</span></font face> will be converted into <font face="Courier"><span style="background-color:lightgrey;">Outdoor temperature is 3.4°F</span></font face> when there is outdoor temp data and into <font face="Courier"><span style="background-color:lightgrey;">Outdoor temperature is --°F</span></font face> if outdoor temp sensor does not provide recent data.
If you dont know how to set your Ethernet adapter to a static IP, please have a look [http://blog.mclaughlinsoftware.com/2009/11/26/windows-7-static-ip/ here].
+
# Template <font face="Courier"><span style="background-color:lightgrey;">Local time is [hh]:[mm]</span></font face> will be converted into <font face="Courier"><span style="background-color:lightgrey;">Local time is 09:27</span></font face>.
 
+
# Template <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: [wind0wind-max10.1:--]m/s, [wind0wind-max10=mph.1:--]mph, [wind0wind-max10=kn.0:--]kn</span></font face> will be converted into <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: 10.5m/s, 23.5mph, 20kn</span></font face>.
<!--T:13-->
+
When TFTP is enabled and IP of your host PC is set to 192.168.1.20 we can start flashing. Please open a CMD shell and type in the command <pre>tftp -i 192.168.1.1 put flash-file-name</pre> where ''flash-file-name'' is the name of the image to flash. When command is done successfully, number of transferred bytes is displayed.
+
 
+
===Final Flashing Tasks=== <!--T:14-->
+
IP of router in update mode is 192.168.1.1, which hopefully will not do a collision with one of your other devices. If there is a collision, switch off the other devices during flash. After data has been transferred via TFTP you have to wait a couple of minutes until flash process inside the router is done and router restarts itself. Restart switches off all LEDs for a short time. Now it is safe to disconnect the router from power. Interrupting the flash processes by a power cycle will brick the router.
+
 
+
==Findout IP==  <!--T:28-->
+
When Meteobridge is connected to your LAN it will try to receive a dynamic IP from your DHCP server during boot. Wait until blinking of the largest LED has stopped.
+
Now there are different ways to find out which IP your Meteobridge has received.
+
 
+
===Lazy Way===  <!--T:29-->
+
When Meteobridge starts it communicates LAN IP and WAN IP to the Internet server, where it loads the application stack from. Therefore you can ask there, what has been the last known LAN IP reported from a Meteobridge sharing the same router and WAN IP with your browsing PC. When Meteobridge and PC are in the same LAN, browsing to this address should tell you the LAN IP to use: [http://magicip.meteobridge.com MagicIP]
+
 
+
===IP Signaling=== <!--T:15-->
+
Do a short press on the push button on the top (TL-MR3020, WL-330N3G) or a short press of the reset button behind the pinhole at the back of the unit (TL-WR703N). Now LED will start signaling the IP.
+
 
+
<!--T:16-->
+
Meteobridge will signal its IP by pulsing the LED beneath the pressed button (TL-MR3020) or the blue LED on the top of the device (TL-WR703N) or the power LED (WL-330N3G). Sequence begins with LED going off, then each of the four numbers (delimited by a dot) will be signaled one by one. The dot between the numbers will be signaled by a "H" (LED shines bright). Each number is signaled by blinking digit per digit. Each digit is represented by a "M" (LED shines medium dimmed) repeated as often as the digit tells us. The zero digit is signaled by ten blinks. After having done this for all digits of all numbers of the IP, the end is signaled by LED staying off a while like it started with. When Sequenze is done, the LED is constantly turned on again.
+
 
+
<!--T:17-->
+
Example: IP 192.168.10.77 Legend: M = LED medium dimmed, H = LED shines bright, _ = LED is dark
+
 
+
<!--T:18-->
+
<pre>Signal:                                          Comment
+
___M___M_M_M_M_M_M_M_M_M___M_M___H              192
+
___M___M_M_M_M_M_M___M_M_M_M_M_M_M_M___H        168
+
___M___M_M_M_M_M_M_M_M_M_M___H                  10
+
___M_M_M_M_M_M_M___M_M_M_M_M_M_M___              77</pre>
+
 
+
<!--T:19-->
+
When Meteobridge is connected via LAN it will signal the LAN IP. To get the WLAN IP signaled in that case, please disconnect ethernet cable from meteobridge's LAN port and start IP signaling again. This time WLAN IP will be signaled.
+
 
+
===Alternative Ways to Find-Out IP=== <!--T:20-->
+
If you don't like reading the blinks, you can also use an IP scanner (for example: [http://www.advanced-ip-scanner.com/ Advanced IP Scanner]) or you can look into the logs of your router that provides IPs via DHCP for clients in the LAN/WLAN.
+
 
+
<!--T:21-->
+
When a FAT formatted USB stick is connected to the USB port, a file "network.log" is written to the USB stick in addition to the LED blinking. The file will look like this:<pre>Sat Jan  5 00:23:16 UTC 2013
+
MAC:    xx:xx:xx:xx:xx:xx
+
LAN IP:  192.168.123.245</pre>
+
 
+
==Cloud Simulator for Network Configuration== <!--T:22-->
+
If Meteobridge client cannot connect to your LAN or your LAN does not provide a DHCP service, large LED will not leave fast-blinking mode. To get network settings fixed, you can define the correct network parameters in a simulator in the Internet, which works as follows.
+
# Please browse to [http://config.meteobridge.com config.meteobridge.com]. There you will find a simulation of the Meteobridge web interface. Please select the "Setup Network" tab and configure settings as needed for your specific network situation.  
+
# When settings are done, please press "save" and change to "Download" tab which will cause your browser to start downloading a configuration file named "config.tgz".
+
# Please store that file (as is, do not unpack) on a USB stick formatted as FAT32 and start the Meteobridge with the USB stick plugged into the USB port of Meteobridge. When network settings are right, Meteobridge will stop with slow and fast blinking and turn on the LED constantly.
+
# You can now remove the USB stick, it is no longer needed. When you restart this Meteobridge client with the same USB stick inserted, file "config.tgz" on USB stick will not be used again as it has been marked as used for this specific Meteobridge unit. Nevertheless, the stick can still be used to setup networking of other Meteobridge clients. The stick also holds a log file which reports if an update of network setttings was aplied.
+
 
+
==First Login== <!--T:23-->
+
When you have done the flashing of your meteobridge and initial network setup done, you can reach meteobridge for final configuration with your browser by typing in its IP as URL.  
+
 
+
<!--T:24-->
+
As login is protected by a password, your browser will ask for a user name and password. '''Please enter ''meteobridge'' as user und also ''meteobridge'' as password'''. While the user cannot be changed, you can change the password later on. On first login you will be guided to "License" tab, where you have to accept license terms and have to press "Save and Apply" befor you can navigate to the other tabs. Sections listed in the setup menu at the left will tell you how to finalize configuration so that your weather data gets finally uploaded to Weather Underground.
+
 
+
<!--T:25-->
+
Your browser will show you meteobridge's web interface with 7 tabs. Please go through all these tabs and make the required settings. The page will show warnings for all still missing essentials until you have worked through all of this. It is just a few steps, which will be explained in the setup chapters, page by page.
+
 
+
==Back to Defaults== <!--T:26-->
+
When you have misconfigured the network or system password in a way that you can't no longer reach meteobridge, you can revert the system back to defaults by pressing the button on the top of TL-MR3020 / WL-330N3G or the reset button at the back of TL-WR703N at the back behind a pin hole. By pushing these buttons you can revert to defaults in two ways.
+
# '''Reset to default network operation''' is done by pressing the button and keeping it presses until LED goes on again for the first time. Now release button and system will restart with default network configuration, which is LAN DHCP client mode. Network settings done before are still stored inside meteobridge when unit has started in LAN DHCP client mode, but these will need additional "Save" clicks to be made active again.
+
# '''Reset password''' is done by pressing button and keeping it pressed until LED goes on for the second time. Meteobridge will reboot and will be available with default password via ssh (user root, password meteobridge) and http (user meteobridge, password meteobridge).
+
 
+
==Flash Again== <!--T:27-->
+
When you need to flash a new Meteobridge firmware to your TL-MR3020 or TL-WR703N, you can do that by going to "Setup Network" tab on Meteobridge web interface und pressing "Expert Mode (OpenWrt)" button. This will bring you to the openwrt SW stack below meteobridge application software stack. If your device cannot load Meteobridge application stack from the Internet for some reason, you can also directly access openwrt web interface by browsing to "http://ip-of-your-meteobridge-device/cgi-bin/luci". Login with your Meteobridge password and goto "System" tab. Select sub tab "Backup / Flash Firmware" and use offered "Flash new firmware" section. Unmark "keep settings" option and start flashing. Keep device connected to power, it will restart automatically.  
+
If you have a WL-330N3G, this always needs to be flashed with the TFTP environment as in setup section for that device explained.
+
 
</translate>
 
</translate>

Revision as of 20:06, 3 March 2013

Other languages:
Deutsch • ‎English

Meteobridge provides a very flexible mechanism to smuggle sensor data of different kinds into strings to be used by Meteobrdge push services like Twitter, HTTP GET uploads or MSQL database insert requests.

Simply type in the text you want to upload and represent the pieces of sensor data by so called variables. When data gets uploaded, these variables will be replaced by current sensor data and so a string filled with the data you intended will be uploaded.

Each variable starts with an opening square bracket "[" and is terminated by a closing square bracket "]". The structure of the variable name between these brackets is as follows:
sensor-selector=converter.decimals:replacement

"converter", "decimals" and "replacement" can be omitted, "sensor" and "type" 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.

Sensors

These sensors are defined in Meteobridge.

  • th0temp: outdoor temperature in degrees Celsius
  • th0hum: relative outdoor humidity as percentage
  • th0dew: outdoor dew point in degrees Celsius
  • thb0temp: indoor temperature in degrees Celsius
  • thb0hum: indoor humidity as percentage
  • thb0dew: indoor dewpoint in degrees Celsius
  • thb0press: station pressure in hPa
  • thb0seapress: normalized pressure (computed to sea level) in hPa
  • wind0wind: wind speed in m/s
  • wind0avgwind: average windspeed in m/s (time used for average depends on station)
  • wind0dir: wind direction in degress (0° is North)
  • wind0chill: wind chill temperature in degrees Celsius
  • rain0rate: rain rate in mm/h
  • rain0total: rain fall in mm
  • uv0index: uv index
  • sol0rad: solar radiation in W/m^2

If a sensor is not there or data of sensor has passed the "tolerated data age" interval, Meteobridge will not provide data for it and will present the value defined as "replacement". If no replacement is given, variable will not be converted into data but will stay as is.

Selectors

Sensors are followed by a selector (syntactically separated by a dash) that specifies what period in time should be used for evaluation. Valid selectors are:

  • act: most recent data
  • hmin: minimum value of this hour
  • hmax: maximum value of this hour
  • dmin: minimum value of today
  • dmax: maximum value of today
  • ydmin: minimum value of yesterday
  • ydmax: maximum value of yesterday
  • mmin: minimum value of this month
  • mmax: maximum value of this month
  • ymin: minimum value of this year
  • ymax: maximum value of this year
  • amin: minimum value of all time
  • amax: maximum value of all time
  • daysum or sumday, monthsum, yearsum, allsum, ydaysum: selects summerized delta values from today, this month, this year, all time or yesterday: "rain0total-sumday" is todays rain fall.

When you are interested in timestamps of min/max values, you can make use of these selectors:

  • hmintime: timestamp of minimum value of this hour
  • hmaxtime: timestamp of maximum value of this hour
  • dmintime: timestamp of minimum value of today
  • dmaxtime: timestamp of maximum value of today
  • ydmintime: timestamp of minimum value of yesterday
  • ydmaxtime: timestamp of maximum value of yesterday
  • mmintime: timestamp of minimum value of this month
  • mmaxtime: timestamp of maximum value of this month
  • ymintime: timestamp of minimum value of this year
  • ymaxtime: timestamp of maximum value of this year
  • amintime: timestamp of minimum value of all time
  • amaxtime: timestamp of maximum value of all time

Timestamps are strings of format "YYYYMMDDhhmmss". Year "YYYY" is reported in 4 digits, all other values (month "MM", day "DD", hour "hh", minute "mm", second "ss") come with 2 digits, leading zeros are not supressed.

Apart from selectors that use absolute, predefined time slots there are also selectors that look for a certain amount of time into the past.

  • max2, max5, max10, max15, max30, max60: selects the maximum value from the last 2, 5, 10, 15, 30 or 60 minutes
  • min2, min5, min10, min15, min30, min60: selects the minimum value from the last 2, 5, 10, 15, 30 or 60 minutes
  • avg2, avg5, avg10, avg15, avg30, avg60: selects average value from the last 2, 5, 10, 15, 30 or 60 minutes
  • sum2, sum5, sum10, sum15, sum30, sum60: selects summerized delta values from the last 2, 5, 10, 15, 30 or 60 minutes, which is useful to get amount of total rain in a certain time frame: "rain0total-sum60" is rainfall im mm of last 60 minutes.

Converters

Sensor data is reported in ISO units (°C, hPa, mm, m/s) by default, but can be converted into non-ISO units (imperial) by adding a conversion token. Defined tokens are:

  • F converts temperature from Celsius to Fahrenheit.
  • psi converts pressure from hPa (equivalent to mbar) to psi.
  • mmHg converts pressure from hPa to millimeters of mercury.
  • inHg converts pressure from hPa to inches of mercury.
  • kmh converts wind speed from meters per second to kilometers per hour.
  • mph converts wind speed from meters per second to miles per hour.
  • kn converts wind speed from meters per second to knots.
  • bft converts wind speed from meters per second to Beaufort scale.
  • in converts millimeters to inches.

If an unknown conversion string is used, no conversion will take place, no error message will appear.

Special Variables

There are a couple of variables that don't come as "sensor-selector=converter" chains but have a distinct meaning by themselves.

Date und time variables are defined as follows:

  • YYYY: year as four digit number
  • YY: year as two digit number
  • MM: month as two digit number, if only one digit neede a zero will be used as first digit
  • M: month as one or two digit number, no leading zeros
  • DD: day of month as two digit number, if only one digit neede a zero will be used as first digit
  • D: day of month as one or two digit number, no leading zeros
  • hh: hour as two digit number, if only one digit neede a zero will be used as first digit
  • h: hour as one or two digit number, no leading zeros
  • mm: minute as two digit number, if only one digit neede a zero will be used as first digit
  • m: minute as one or two digit number, no leading zeros
  • ss: seconds as two digit number, if only one digit neede a zero will be used as first digit
  • s: seconds as one or two digit number, no leading zeros

When a capital "U" preceeds a date/time variable name, UTC is used instead of local time ("[Uhh]:[Umm]:[Uss] UTC" is evaluated to a string like "16:03:33 UTC")

Decimals

Unless otherwise defined numbers are reported with one decimal. By specifying a value for "decimals" you can determine resolution of presented values.

Replacement

When a variable is not defined or there is no data for a specified sensor, information specified as "replacement" string will be represented instead.

Examples

Having a look at examples usually helps to understand how easy that is.

  1. Template Outdoor temperature is [th0temp-act=F.1:--]°F will be converted into Outdoor temperature is 3.4°F when there is outdoor temp data and into Outdoor temperature is --°F if outdoor temp sensor does not provide recent data.
  2. Template Local time is [hh]:[mm] will be converted into Local time is 09:27.
  3. Template Max gust in last 10 minutes was: [wind0wind-max10.1:--]m/s, [wind0wind-max10=mph.1:--]mph, [wind0wind-max10=kn.0:--]kn will be converted into Max gust in last 10 minutes was: 10.5m/s, 23.5mph, 20kn.