Author Topic: New Saratoga AJAX/PHP template plugin for WeatherCat under construction...  (Read 28614 times)

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Todd, Ken - this is development how I like it  :)

Ken, I understand your problems :)

My preliminary suggestion is to add a tag that switches the web processing from human readable/localised date/time formats to a more machine readable format. I would suggest ISO 8601 - i.e. YYYY-MM-DD and times as hh:mm:ss (24 hour format)). Dates/times are separated by the character 'T'.

A full date/time would be of the format: YYYY-MM-DDTHH:MM:SS - i.e. 2012-03-16T22:48:14

So if WeatherCat sees ISO8601DATES$ from that point on until the end of the page (or HUMANDATES$) it switches to the ISO 8601 format for dates and times. Fixed format tags such as t12$ are excluded, I'll also add t12s$ and t24s$ which output with seconds and similarly are excluded.

(Note, I am not in front of the WeatherCat code at the moment (I'm actually deep into www.F1.com getting ready for the season), but I don't think it'll be too difficult to do this).

Would that cover your requirements?

Cheers,
Stu.
Stu, that would work just fine for the dates (ISO8601DATES$ to start the machine-friendly dates, HUMANDATES$ to end, and ISO dates in YYYY-MM-DDTHH:MM:SS format in local time)

Thanks,

Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Todd, Ken - this is development how I like it  :)

Todd, I assume you're talking about the custom CGI? If so, if I can just spec the changes you want, they are:
1. Add daily high external temperature  (Fahrenheit)
2. Add time of daily high external temperature
3. Add daily low external temperature (Fahrenheit)
4. Add time of daily low temperature.
Let me know if this is OK.

Cheers,
Stu.

Well since you asked ;D

1. Add daily high external temperature  (Fahrenheit)
2. Add time of daily high external temperature
3. Add daily low external temperature (Fahrenheit)
4. Add time of daily low temperature.
5. Daily High External Barometer (inhg)
6. Time of above
7. Daily Low External Barometer (inhg)
8. Time of above
9. High windspeed for the day
10. Time of above

Thanks Stu.

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
(I'm actually deep into www.F1.com getting ready for the season)

You are now officially my favorite developer ever! :D Are you a de Resta fan? Long time Webber fan, here (well, long time Rubio fan, but...)

Just finished watching the DVR'd Friday Practice #2.
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Todd, Ken - this is development how I like it  :)

Ken, I understand your problems :)

My preliminary suggestion is to add a tag that switches the web processing from human readable/localised date/time formats to a more machine readable format. I would suggest ISO 8601 - i.e. YYYY-MM-DD and times as hh:mm:ss (24 hour format)). Dates/times are separated by the character 'T'.

A full date/time would be of the format: YYYY-MM-DDTHH:MM:SS - i.e. 2012-03-16T22:48:14

So if WeatherCat sees ISO8601DATES$ from that point on until the end of the page (or HUMANDATES$) it switches to the ISO 8601 format for dates and times. Fixed format tags such as t12$ are excluded, I'll also add t12s$ and t24s$ which output with seconds and similarly are excluded.

(Note, I am not in front of the WeatherCat code at the moment (I'm actually deep into www.F1.com getting ready for the season), but I don't think it'll be too difficult to do this).

Would that cover your requirements?

Cheers,
Stu.
Stu, that would work just fine for the dates (ISO8601DATES$ to start the machine-friendly dates, HUMANDATES$ to end, and ISO dates in YYYY-MM-DDTHH:MM:SS format in local time)

Thanks,

Ken

Thanks Ken - I'll get those changes into the next release.
Cheers,
Stu.

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Todd, Ken - this is development how I like it  :)

Todd, I assume you're talking about the custom CGI? If so, if I can just spec the changes you want, they are:
1. Add daily high external temperature  (Fahrenheit)
2. Add time of daily high external temperature
3. Add daily low external temperature (Fahrenheit)
4. Add time of daily low temperature.
Let me know if this is OK.

Cheers,
Stu.

Well since you asked ;D

1. Add daily high external temperature  (Fahrenheit)
2. Add time of daily high external temperature
3. Add daily low external temperature (Fahrenheit)
4. Add time of daily low temperature.
5. Daily High External Barometer (inhg)
6. Time of above
7. Daily Low External Barometer (inhg)
8. Time of above
9. High windspeed for the day
10. Time of above

Thanks Stu.
Ok Todd, I'll get them into the next release.

Cheers,
Stu.

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
(I'm actually deep into www.F1.com getting ready for the season)

You are now officially my favorite developer ever! :D Are you a de Resta fan? Long time Webber fan, here (well, long time Rubio fan, but...)

Just finished watching the DVR'd Friday Practice #2.

Lol, no, I wouldn't say I'm a fan of any one in particular - this season it's more a case of seeing if anyone can challenge Vettel for the title - I do hope so! (Not that I don't like him, just that a third Red Bull season would be a little boring...).

Cheers,
Stu.


Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Ken,

Is Scott's soil temp/moisture page part of your template or is that part of Brian's WD?

Scott's page: http://www.websterweatherlive.com/wxsoil.php

Thread: http://www.wxforum.net/index.php?topic=13073.0

I'm testing/reviewing a Davis station now, so it might be interesting to have the info to share.
http://athena.trixology.com/index.php?topic=136.0

Thanks,
Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Ken,

Is Scott's soil temp/moisture page part of your template or is that part of Brian's WD?

Scott's page: http://www.websterweatherlive.com/wxsoil.php

Thread: http://www.wxforum.net/index.php?topic=13073.0

I'm testing/reviewing a Davis station now, so it might be interesting to have the info to share.
http://athena.trixology.com/index.php?topic=136.0

Thanks,
Steve
Hi Steve,

The wxsoil.php is (AFAIK) a add-on page to the templates, primarily for Weather-Display users only.  Scott (WebsterWeather) has made some amazing add-ons for the template, but.. they apply mostly to WD users (alternative dashboard, etc).

Where there are extra sensors on a station, there's nothing to prevent folks from adding tags to the WCTtags.php template and adding $tagname = $WX['...']; statements to the WCT-defs.php file to enable the display of those extra sensors.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Thanks for the explanation. I'll play with that once I get things set up in their final location with the Soil Staion.

Thanks,
Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Hi Ken,
Due to the way templates are parsed, there was no easy way for me to serialise the parsing so that one could switch the iso 8601 dates/times on and later switch them off further down the page.

What I've done is if ISO8601DATES$ is found anywhere on the page (I run a pass  for it first), all STAT$ type tags on that page will output ISO dates/times - is this OK for you? I've also added 24HRSAGO$ and DELTA24$ along with t12s$ and t24s$ which output with seconds - these are currently on test at http://www.trixology.com/live_weather/custom/

Let me know if that gives you any problems,
Stu.

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Hi Ken,
Due to the way templates are parsed, there was no easy way for me to serialise the parsing so that one could switch the iso 8601 dates/times on and later switch them off further down the page.

What I've done is if ISO8601DATES$ is found anywhere on the page (I run a pass  for it first), all STAT$ type tags on that page will output ISO dates/times - is this OK for you? I've also added 24HRSAGO$ and DELTA24$ along with t12s$ and t24s$ which output with seconds - these are currently on test at http://www.trixology.com/live_weather/custom/

Let me know if that gives you any problems,
Stu.

Hi Stu,
Love the new 24HRSAGO$ and DELTA24$ variables.. very useful!  Also, the t12s$ and t24s$ too.   8)  ;D

I don't have an issue with ISO date/times appearing on all the STAT$...:TIME$ vars with ISO8601DATES$ on the page.  I don't see any samples of the ISO date format on your http://www.trixology.com/live_weather/custom/ page at this time.. all the STAT$ dates are appearing as dd MON yyyy hh:mm AM/PM right now   ???

Best regards,
Ken

BTW.. great FAST work .. I too, love interactive development :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
I've switched them on now Ken. Give it a look and let me know if they look OK, then I'll switch them off again (don't want to frighten people :) )

Cheers,
Stu.

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
I've switched them on now Ken. Give it a look and let me know if they look OK, then I'll switch them off again (don't want to frighten people :) )

Cheers,
Stu.

Yes!

Quote
Highest temperature today = STAT$TEMPERATURE:MAX:TODAY$TEMPUNITS$ at STAT$TEMPERATURE:MAX:TODAY:TIME$


Highest temperature today = 9.78?C at 13:48:00
Highest temperature yesterday = 10.17?C at 10:45:00
Highest temperature this week = 11.28?C on 2012-03-11T13:40:00
Highest temperature last week = 12.28?C on 2012-03-09T14:14:00
Highest temperature this month = 12.61?C on 2012-03-01T12:26:00
Highest temperature last month = 12.83?C on 2012-02-22T13:22:00
Highest temperature this year = 12.83?C on 2012-02-22T13:22:00
Highest temperature last year = 24.17?C on 2011-07-27T18:18:00
Highest temperature of all time = 29.50?C on 2009-07-02T14:59:00

...

Highest solar radiation today = 584.00 W/m^2 at 11:03:00
Highest solar radiation yesterday = 139.00 W/m^2 at 14:50:00
Highest solar radiation this week = 584.00 W/m^2 on 2012-03-17T11:03:00
Highest solar radiation last week = 494.00 W/m^2 on 2012-03-07T11:01:00
Highest solar radiation this month = 584.00 W/m^2 on 2012-03-17T11:03:00
Highest solar radiation last month = 397.00 W/m^2 on 2012-02-18T11:04:00
Highest solar radiation this year = 584.00 W/m^2 on 2012-03-17T11:03:00
Highest solar radiation last year = 1215.00 W/m^2 on 2011-06-10T13:24:00

will work just fine!   Thanks!!   [woohoo]
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Thanks Ken.

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Todd, Ken - this is development how I like it  :)

Todd, I assume you're talking about the custom CGI? If so, if I can just spec the changes you want, they are:
1. Add daily high external temperature  (Fahrenheit)
2. Add time of daily high external temperature
3. Add daily low external temperature (Fahrenheit)
4. Add time of daily low temperature.
Let me know if this is OK.

Cheers,
Stu.

Well since you asked ;D

1. Add daily high external temperature  (Fahrenheit)
2. Add time of daily high external temperature
3. Add daily low external temperature (Fahrenheit)
4. Add time of daily low temperature.
5. Daily High External Barometer (inhg)
6. Time of above
7. Daily Low External Barometer (inhg)
8. Time of above
9. High windspeed for the day
10. Time of above

Thanks Stu.
Ok Todd, I'll get them into the next release.

Cheers,
Stu.

Hi Todd,
I've made the changes we talked about, I've also added a few extras.

I've got it on test at:
http://www.trixology.com/live_weather/custom_cgi/watch_weather.php

I'm currently sending the data every 5 seconds (sadly the weather is pretty quiet here at the moment). All hi/lo times are sent as local.

[Edit: I wanted to add the 3 hour baro delta, but sadly ran out of time - maybe I'll get it in later in the week. I'm also going to drop the seconds from the high/low times]

Cheers,
Stu.