Page 1 of 1

Enhanced template features

Posted: Wed Apr 14, 2010 10:20 pm
by admin
I added these additional variables to be used in templates (and tables and cvs exports as well):
  • longitude, latitude
  • localtime, utctime
  • uploadlocaltime, uploadutctime
  • unarphasepercentage
  • lunarphasesegment
  • lunaragedays
  • lunarphasetext
  • lunarphaseicondaylengthstandardhours, daylengthcivilhours, daylengthnauticalhours
  • daylengthstandardtime, daylengthciviltime, daylengthnauticaltimesunrisestandardutctime, sunsetstandardutctime, sunrisestandardlocaltime, sunsetstandardlocaltime, sunriseciviltwilightutctime, sunsetciviltwilightutctime, sunriseciviltwilightlocaltime, sunsetciviltwilightlocaltime, sunrisenauticaltwilightutctime, sunsetnauticaltwilightutctime, sunrisenauticaltwilightlocaltime, sunsetnauticaltwilightlocaltime
  • moonriseutctime, moonsetutctime, moonriselocaltime, moonsetlocaltime
You find these introduced here: http://wiki.meteoplug.com/Define_Chart# ... and_Values

Examples of use:
[20100101000000_day1_misc_lunarphasetext]
[actual_day1_misc_sunrisestandardlocaltime]
New variables are defined as properties of a virtual sensor id named "misc". This virtual id does not retrieve data from database but computes results from given information like timestamp, etc.

When new charting engine does show problems with your existing graphs, please report to me and temporarily use "meteochart-v1.cgi" instead of "meteochart.cgi" for displaying graphs. "v1" is the old engine.

Re: Enhanced template features

Posted: Thu Apr 15, 2010 9:02 am
by skyewright
admin wrote:I added these additional variables to be used in templates (and tables and cvs exports as well):
That's great. Thank you. :)

Perhaps I have misunderstood something but localtime and utctime always seem to report the "actual" time, regardless of the timestamp used by a variable.

It would be very nice if the variable's own timestamp (including relative timestamp) could be reported, at least for localtime and utctime if not for the rest?

Re: Enhanced template features

Posted: Thu Apr 15, 2010 9:42 am
by admin
utctime, localtime, longitude, latitude do always report actual values regardless of the other given information in the variable. That might be a bit confusing, but I tried to keep all this in one parsing pateern. When more variables show up without relation to time resolutions and time frames, I might introduce a separate variable pattern for this.

There is one more misc variable "timestamp". There should report absolute time stamp that results from resolving relative time stamps. Please give these a try. I also updated the wiki accordingly.

Re: Enhanced template features

Posted: Thu Apr 15, 2010 10:08 am
by skyewright
admin wrote:utctime, localtime, longitude, latitude do always report actual values regardless of the other given information in the variable.
I can see the sense in that.
admin wrote:There is one more misc variable "timestamp". There should report absolute time stamp that results from resolving relative time stamps. Please give these a try. I also updated the wiki accordingly.
"timestamp" does exactly what I was looking for. Thank you. :D

PS. I notice that you''ve also added maindirtext and highdirtext for text directions (e.g. N, NW, etc.). Thanks for those too. :)
I've updated my Meteohub to Meteoplug template conversion example to make use of those.