Difference between pages "Hardware" and "Templates/en"

From meteoplug
(Difference between pages)
Jump to: navigation, search
 
(Updating to match new version of source page)
 
Line 1: Line 1:
<translate>
+
__NOTOC__
<!--T:1-->
+
<languages /><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 />[[File:inhand.png|frameless|130px|left]]Meteobridge can be used with two miniature consumer routers from TP-LINK and one from ASUS. These devices are converted into a Meteobridge by flashing a new firmware. As always when you flash un-official firmware to a device you are voiding the manufacturers warranty. That means, when the device gets faulty later on, you can't reach out to TP-LINK or ASUS for warranty. smartbedded UG, whichs owns the Meteobridge software does also not provide any warranty on the flashed device. As the routers are very cheap and risk of bricking the device is minimal, you don't have a significant financial expousre. However, you have to know, that you are converting the router into a Meteobridge at your own risk.
+
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: <pre>sensor-selector=converter.decimals:replacement</pre>
 +
"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.
  
==TP-LINK TL-MR3020== <!--T:2-->
+
Some stations do support additional temp/hum sensors. These will be enumerated as "th1temp", "th1hum", "th1dew", and so on. "Live Data" tab will illustrate what sensor number matches what current data. When you have a fully equiped Davis Vantage you might also have soil and leaf sensors. These are also reported as temp/hum sensors, but there is no dewpoint data computed for these types of sensors. soil sensors are enumerated as "th10temp", "th10hum", ..., "th13temp", "th13hum" and leaf sensors are listed as "th15temp", "th15hum", ..., "th18temp", "th18hum". "hum" values do not represent relative humidity in that case but data in units "cbar" and "wet". However, Meteobridge does not invent new unit selectors for it, so you have to use "hum" as a generic selector to get "cbar" and wetness data from the soil/leaf sensors.
[[File:tl-mr3020.png|right]] TL-MR3020 from TP-Link is a tiny WLAN router, which is word-wide available for less than $40. Flashing the unit with meteobridge firmware makes the router a meteobridge. Meteobridge firmware is tested with currently sold TL-MR3020 which are version 1.7. This router hardware comes with the following features:
+
* 4 MB flash
+
* 32 MB RAM
+
* One LAN port
+
* Internal WLAN (no external antenna)
+
* USB 2.0 only port <font color=red>(not capable of driving USB 1.x devices, will need a USB 2.0 Hub inbetween)</font>
+
* A couple of activity LEDs (USB, LAN, WLAN)
+
* Illuminated button on the top
+
* Dimensions: 2.9 x 2.6 x 0.9 inch (74 x 67 x22 mm)
+
* Weight: 2.0 oz (58 g) without accessories
+
* Temperature: -10 ~60 ℃ ℃ operating (-40℃~80℃ storage)
+
* Humidity: 10%~90% operating (5%~90% storage)
+
* Power Consumption: 1-2 watts
+
* Certificates: CE, FCC, RoHS
+
* As a consumer router world-wide available from TP-Link
+
* Street price below $40
+
  
==TP-LINK TL-WR703N== <!--T:3-->
+
==Selectors==
[[File:tl-wr703n.png|right]] TL-WR703N from TP-Link is the little brother of TL-MR3020. While technical specs are nearly identical it comes with an even smaller form factor and less LEDs for signaling status. TP-LINK does sell WR703N just on the China market, but you can easily get one via ebay for less than $30. Meteobridge is tested on hardware revision 1.6 of this router. Router hardware comes with the following features:
+
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:
* 4 MB flash
+
* '''act''': most recent data
* 32 MB RAM
+
* '''hmin''': minimum value of this hour
* One LAN port
+
* '''hmax''': maximum value of this hour
* Internal WLAN (no external antenna)
+
* '''dmin''': minimum value of today
* USB 2.0 only port <font color=red>(not capable of driving USB 1.x devices, will need a USB 2.0 Hub inbetween)</font>
+
* '''dmax''': maximum value of today
* One activity LED
+
* '''ydmin''': minimum value of yesterday
* Reset button behind a pinhole at the back
+
* '''ydmax''': maximum value of yesterday
* Dimensions: 2.2 x 2.2 x 0.7 inch (57 x 57 x 18 mm)
+
* '''mmin''': minimum value of this month
* Weight: 1.3 oz (36 g) without accessories
+
* '''mmax''': maximum value of this month
* Temperature: -10℃~60℃ operating (-40℃~80℃ storage)
+
* '''ymin''': minimum value of this year
* Humidity: 10%~90% operating (5%~90% storage)
+
* '''ymax''': maximum value of this year
* Power Consumption: 1 watts
+
* '''amin''': minimum value of all time
* Certificates: no indication of CE, FCC, RoHS
+
* '''amax''': maximum value of all time
* only available for China market from TP-Link, but easy to get worl-wide via China-based ebay sellers
+
* '''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.
* Street price: below $30
+
  
==ASUS WL-330N3G== <!--T:4-->
+
When you are interested in timestamps of min/max values, you can make use of these selectors:
[[File:wl-wr703n.png|right]] This tiny router from ASUS has similar specs like the ones from TP-Link. Flashing the unit is a bit more complicated (cannot be done via web interface, needs TFTP in a prepared LAN) but it can handle USB 1.x and USB 2.0 devices without need for an additional USB hub. Please do not confuse this router with its predecessor WL-330N, which is not suitable for Meteobridge.
+
* '''hmintime''': timestamp of minimum value of this hour
* 4 MB flash
+
* '''hmaxtime''': timestamp of maximum value of this hour
* 32 MB RAM
+
* '''dmintime''': timestamp of minimum value of today
* One LAN port
+
* '''dmaxtime''': timestamp of maximum value of today
* Internal WLAN (no external antenna)
+
* '''ydmintime''': timestamp of minimum value of yesterday
* USB 2.0 port (capable of driving USB 1.x and USB 2.0 devices)
+
* '''ydmaxtime''': timestamp of maximum value of yesterday
* A couple of activity LEDs (Power, USB, LAN, WLAN)
+
* '''mmintime''': timestamp of minimum value of this month
* One button on the top and a non-functional reset button behind a larger pin hole at the bottom
+
* '''mmaxtime''': timestamp of maximum value of this month
* Dimensions: 90 x 38.9 x 12.8 mm (LxWxH)
+
* '''ymintime''': timestamp of minimum value of this year
* Weight: 1.3 oz (35 g) without accessories
+
* '''ymaxtime''': timestamp of maximum value of this year
* Power Consumption: abt. 1-2 watts
+
* '''amintime''': timestamp of minimum value of all time
* Certificates: CE, FCC, RoHS
+
* '''amaxtime''': timestamp of maximum value of all time
* As a consumer router world-wide available from ASUS
+
* '''starttime''': timestamp of first recorded value
* Street price: depends on region, cheaper in Europe/Asia (30 Euro), more expansive in the US ($50)
+
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.
</translate>
+
 
 +
Apart from selectors that use absolute, predefined time slots there are also selectors that look for a certain amount of time into the past.
 +
* '''val2''', '''val5''', '''val10''', '''val15''', '''val30''', '''val60''': selects the value the sensor has shown 2, 5, 10, 15, 30 or 60 minutes ago
 +
* '''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.
 +
* '''ft''' converts meters to feet.
 +
* '''endir''' converts a wind direction into one of 16 English direction texts.
 +
* '''dedir''' converts a wind direction into one of 16 German direction texts.
 +
If an unknown conversion string is used, no conversion will take place, no error message will appear.
 +
 
 +
When variable returns a timestamp, then this converter can be applied:
 +
* '''utc''' reports timestamp in UTC instead of localtime, which is default.
 +
 
 +
==System Variables==
 +
Meteobridge provides some additional variables that tell details not directly related to weather conditions. Sensor name is "mbsystem", defined selectors are:
 +
* '''swversion''': Meteobridge version string (example: "1.1")
 +
* '''buildnum''': build number as integer (example: 1673)
 +
* '''platform''': string that specifies hw platform (example: "TL-MR3020")
 +
* '''language''': language used on Meteobridge's web interface (example: "English")
 +
* '''timezone''': defined timezone (example: "Europe/Berlin")
 +
* '''latitude''': latitude as float (example: 53.875120)
 +
* '''longitude''': longitude as float (example: 9.885357)
 +
* '''lunarage''': days passes since new moon as integer (example: 28)
 +
* '''lunarpercent''': lunarphase given as percentage from 0% (new moon) to 100% (full moon)
 +
* '''lunarsegment''': lunarphase segment as integer (0 = new moon, 1-3 = growing moon: quarter, half, three quarters, 4 = full moon, 5-7 = shrinking moon: three quarter, half, quarter)
 +
* '''daylength''': length of day (example: "11:28")
 +
* '''civildaylength''': alternative method for daylength computation (example: "12:38")
 +
* '''nauticaldaylength''': alternative method for daylength computation (example: "14:00")
 +
* '''sunrise''': time of sunrise in local time. Can be converterd to UTC by applying "=utc" to the variable (example: "06:47", resp. "05:47")
 +
* '''sunset'''. time of sunset in local time. Can be converterd to UTC by applying "=utc" to the variable (example: "18:15", resp. "17:15")
 +
* '''civilsunrise''', '''civilsunset''', '''nauticalsunrise''', '''nauticalsunset''': alternative computations for sunset and sunrise.
 +
* '''daynightflag''': returns "D" when there is daylight, otherwise "N".
 +
* '''moonrise''': time of moonrise in local time. Can be converterd to UTC by applying "=utc" to the variable. Please notice that not every day has a moonrise time, therefore, variable can be non-existent on certain days (example: "05:46", resp. "04:46")
 +
* '''moonset''': time of moonset in local time. Can be converterd to UTC by applying "=utc" to the variable. Please notice that not every day has a moonset time, therefore, variable can be non-existent on certain days (example: "17:00", resp. "16:00")
 +
 
 +
==Time/Date Variables==
 +
Variables representing current date/time 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.
 +
 
 +
When variable returns a string instead of a number (in case of a timestamp for example), "decimal" specification does have a different format and meaning, which allows to select a substring. Specification of the substring consists of two lower-case letters. The first one specifies start point of the substring, second leter the position of last character of the string to be reported. For example, when string is timestamp "20130303121055" a specification of ".ad" selects a substring from first character (position code "a") until fourth character (position code "d"). When you want to grab the time for lowest outdoor temperature of today the template for that will be <font face="Courier"><span style="background-color:lightgrey;">[th0temp-dmintime.ij:--]:[th0temp-dmintime.kl:--]</span></font face>. "ij" selects the hour part at position 9-10 and "kl" selects minute part at position 11-12 of the timestamp.
 +
 
 +
==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.
 +
 
 +
# 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.
 +
# 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>.

Revision as of 21:58, 7 April 2013

Other languages:

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.

Some stations do support additional temp/hum sensors. These will be enumerated as "th1temp", "th1hum", "th1dew", and so on. "Live Data" tab will illustrate what sensor number matches what current data. When you have a fully equiped Davis Vantage you might also have soil and leaf sensors. These are also reported as temp/hum sensors, but there is no dewpoint data computed for these types of sensors. soil sensors are enumerated as "th10temp", "th10hum", ..., "th13temp", "th13hum" and leaf sensors are listed as "th15temp", "th15hum", ..., "th18temp", "th18hum". "hum" values do not represent relative humidity in that case but data in units "cbar" and "wet". However, Meteobridge does not invent new unit selectors for it, so you have to use "hum" as a generic selector to get "cbar" and wetness data from the soil/leaf sensors.

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
  • starttime: timestamp of first recorded value

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.

  • val2, val5, val10, val15, val30, val60: selects the value the sensor has shown 2, 5, 10, 15, 30 or 60 minutes ago
  • 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.
  • ft converts meters to feet.
  • endir converts a wind direction into one of 16 English direction texts.
  • dedir converts a wind direction into one of 16 German direction texts.

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

When variable returns a timestamp, then this converter can be applied:

  • utc reports timestamp in UTC instead of localtime, which is default.

System Variables

Meteobridge provides some additional variables that tell details not directly related to weather conditions. Sensor name is "mbsystem", defined selectors are:

  • swversion: Meteobridge version string (example: "1.1")
  • buildnum: build number as integer (example: 1673)
  • platform: string that specifies hw platform (example: "TL-MR3020")
  • language: language used on Meteobridge's web interface (example: "English")
  • timezone: defined timezone (example: "Europe/Berlin")
  • latitude: latitude as float (example: 53.875120)
  • longitude: longitude as float (example: 9.885357)
  • lunarage: days passes since new moon as integer (example: 28)
  • lunarpercent: lunarphase given as percentage from 0% (new moon) to 100% (full moon)
  • lunarsegment: lunarphase segment as integer (0 = new moon, 1-3 = growing moon: quarter, half, three quarters, 4 = full moon, 5-7 = shrinking moon: three quarter, half, quarter)
  • daylength: length of day (example: "11:28")
  • civildaylength: alternative method for daylength computation (example: "12:38")
  • nauticaldaylength: alternative method for daylength computation (example: "14:00")
  • sunrise: time of sunrise in local time. Can be converterd to UTC by applying "=utc" to the variable (example: "06:47", resp. "05:47")
  • sunset. time of sunset in local time. Can be converterd to UTC by applying "=utc" to the variable (example: "18:15", resp. "17:15")
  • civilsunrise, civilsunset, nauticalsunrise, nauticalsunset: alternative computations for sunset and sunrise.
  • daynightflag: returns "D" when there is daylight, otherwise "N".
  • moonrise: time of moonrise in local time. Can be converterd to UTC by applying "=utc" to the variable. Please notice that not every day has a moonrise time, therefore, variable can be non-existent on certain days (example: "05:46", resp. "04:46")
  • moonset: time of moonset in local time. Can be converterd to UTC by applying "=utc" to the variable. Please notice that not every day has a moonset time, therefore, variable can be non-existent on certain days (example: "17:00", resp. "16:00")

Time/Date Variables

Variables representing current date/time 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.

When variable returns a string instead of a number (in case of a timestamp for example), "decimal" specification does have a different format and meaning, which allows to select a substring. Specification of the substring consists of two lower-case letters. The first one specifies start point of the substring, second leter the position of last character of the string to be reported. For example, when string is timestamp "20130303121055" a specification of ".ad" selects a substring from first character (position code "a") until fourth character (position code "d"). When you want to grab the time for lowest outdoor temperature of today the template for that will be [th0temp-dmintime.ij:--]:[th0temp-dmintime.kl:--]. "ij" selects the hour part at position 9-10 and "kl" selects minute part at position 11-12 of the timestamp.

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.