Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Cumulus Realtime Gadget

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
Post Reply
TNETWeather

Re: Cumulus Realtime Gadget

Post by TNETWeather »

Been using one of the versions of this for a while. One annoying thing is that the icon is based on forecast is not what most people expect when they look at the gadget. They expect it to be current conditions instead.

For example, the icon on the gadget now is showing Rain, but it is actually a completely clear sky with no rain in sight. That is going to change, and we have a 40% chance of rain coming, but someone looking at the gadget would assume that it is or has rained recently.

Now that I have a metar collection script that will be combined with my webtags system, I am going to give this a rework by creating on the fly a gadget collect file that a reworked gadget can get to get exactly what it needs, rather than pulling from the realtime.txt file.

Something like:

gadgetfeed.php

Which when called outputs a similarily formatted space delimited file like realtime.txt but with only the fields I really need like:

Code: Select all

	Date
	Time
	Timezone
	Temp
	Temp Diff
	Wind chill
	Dewpt
	Humidty
	Rainfall day
	Rain Rate
	Rainfall month
	Rainfall year
	Wind Speed
	Wind Dir
	Pressure
	Pressure Diff
	Uv
	SolarRad
	Current Cond icon code
	Forecast icon code
	visability
	temp units
	wind units
	rain units
	pressure units
	Daylight Flag
And perhaps some more fields that I am not thinking about yet.

Then I will have exactly the data needed to provide the a gadget with current conditions showing instead of forecast. Could even set it up so that it switches or can be switched to show more detail, like rain data.

Each time the script is called, it will use the webtags along with the metar data to fill in the current conditions etc...

The ultimate goal would be to create a fixed configured gadget that visitors can download and use which only obtains info from the weather station it was designed for. Kind of like a public service to the area.

The configuration would be fixed with the URL of the station with the getgadge.php script, a fixed time interval like perhaps once every 3 or 5 minutes, and perhaps a selection to choose between a full sized gadget like it is now, or a smaller compressed one like Brad is talking about.

The long update times are because I can imagine a number of these running forever once they are setup and over time that could start taking a toll.

Also, as a php script, I could control who uses the data, and what data they can see... a possible bonus service type thing.

The graphics used can be customized for just the station as well giving it a custom look.

Hmmmm... network just dropped. How cool... NOT!..

Must be the pissed off Groundhog chewing on the cables again.

For a change the business side is not effected... normally it is the other way around.
Last edited by TNETWeather on Wed 03 Feb 2010 9:35 am, edited 2 times in total.
TNETWeather

Re: Cumulus Realtime Gadget

Post by TNETWeather »

Sample gadgetfeed.php output

Code: Select all

2010-02-03 02:43 MST 52.8 -0.9 52.8 43.7 71 0.00 0.00 0.00 2.88 0.0 --- 1003.86 -0.43 0.0 0 FINE 21 Occasional_precipitation,_worsening 10_miles °F mph in hPa 0 
Live File:

http://cumulus.tnetweather.com/gadgetfeed.php

Play script:

Code: Select all

<?php
####################################################################
#
# Test Script for Gadget Feed
#
# (c) 2010 TNET Services, Inc.
#          http://cumulus.tnetweather.com/projects
#
####################################################################
require_once("tnetwebtags.php");
$SITE['metarstation'] = 'KIWA'; // Which Metar station to use.  Would be in Settings.php file
require_once("getmetar.php");  // Eventually called by the webtags script itself rather than from here

echo $WX['year'] . '-' . $WX['month'] . '-' . $WX['day'] . ' ';
echo $WX['hour'] . ':' . $WX['minute']  . ' ';
echo 'MST '; // Missing from tagfile
echo $WX['temp'] . ' ';
echo $WX['temptrend'] . ' ';
echo $WX['wchill'] . ' ';
echo $WX['dew'] . ' ';
echo $WX['hum'] . ' ';
echo $WX['rfall'] . ' ';
echo $WX['rrate'] . ' ';
echo $WX['rmonth'] . ' ';
echo $WX['ryear'] . ' ';
echo $WX['wspeed'] . ' ';
echo $WX['wdir'] . ' ';
echo $WX['press'] . ' ';
echo $WX['presstrendval'] . ' ';
echo $WX['UV'] . ' ';
echo $WX['SolarRad'] . ' ';
echo $WX['curicon'] . ' ';
echo $WX['forecastnumber'] . ' ';
echo preg_replace('/ /','_',$WX['forecast']) . ' ';
echo preg_replace('/ /','_',$WX['metarvis']) . ' ';
echo $WX['tempunit'] . ' ';
echo $WX['windunit'] . ' ';
echo $WX['rainunit'] . ' ';
echo $WX['pressunit'] . ' ';
echo $WX['isdaylight'] . ' ';
Test Metar Get Script:

http://cumulus.tnetweather.com/scripts/getmetar.php
Last edited by TNETWeather on Wed 03 Feb 2010 9:48 am, edited 4 times in total.
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumulus Realtime Gadget

Post by daj »

The ultimate goal would be to create a fixed configured gadget that visitors can download and use which only obtains info from the weather station it was designed for. Kind of like a public service to the area.
Great idea
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Cumulus Realtime Gadget

Post by gemini06720 »

Kevin this is a great idea.

When will it be ready for testing... :)
TNETWeather

Re: Cumulus Realtime Gadget

Post by TNETWeather »

The gadget itself, would need to be reworked... No ready to start doing that yet but once one of the others has access to a gadgetfeed output, it is not hard. I am a bit weak on javascript... just don't use it much.

The metar script should be ready shortly. Just doing some more tweaking on it before building the actual script. It is a external script to the webtag script, which would then call it if it is there. Not really intended to be called as a stand alone script.

The modified webtags script just needs to insert that check and call..

The gadgetfeed.php is already working. Just need to fine tune what variables it outputs. As you can see above, there is next to nothing in it.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Cumulus Realtime Gadget

Post by beteljuice »

The problem with METAR .....

As has already been said in this thread, the logic to automatically decide 'current' conditions is actually very difficult and 'fuzzy'.

At first thought METAR seems an ideal solution. For those who don't know these are weather reports (sometimes automated) typically from airports, but also can be from ships etc.

Knowadays the major airports issue them every 30 mins 24/7.

But ..... They are after all reporting local conditions, so things like rain, snow, fog etc. simply may not apply to your location !

So that leaves us with cloud cover right ? - well ....
These things are aviation based, so cloud may be described at eg. three different altitudes - for some 'decoders' this causes possible pitfalls. Cloud may not be described at all.

eg. CAVOK - Ceiling And Visibility OK, clear skies - NOT !, it means no appreciable cloud structure below 10,000 feet - to a ground observer it may be hazy / thin overcast.

In programs such as getwx and similar http://woody.cowpi.com/phpscripts only the last (highest) cloud condition is taken into account.

A different decoder (may) pick up multiple layers http://www.dickie.webfusion.co.uk/compost/wx_TZ.php

So if there are multiple layers of cloud, and the top layer is BKN (broken) and the lower layer(s) is FEW or SCaTtered, getwx will report "Mostly Cloudy", whereas in reality for a ground observer we would wish for overcast.

In regards to homebrew descisions from your own kit, there is the problem of when did it really start raining and has it actually stopped yet ! (esp. for those with 0.3mm spoons).

For fog, mist and fire index warnings - anyone without a Davis hygrometer need not apply !!!

Nothing is ever easy is it ?
Image
......................Imagine, what you will KNOW tomorrow !
TNETWeather

Re: Cumulus Realtime Gadget

Post by TNETWeather »

Short of buying a Ceilometer or hiring someone to stand outside and do it manually it is good enough.

Not sure about outside the US, but here most of them update every 15-30mins, conditions don't change that fast.

You would not be looking there for rain conditions since your station can do that. The script looks at rain rate along with the last tip value to determine that type of info. Also, if you have a Solar sensor, it can be used to provide a better idea of what is going on during the day.

WD has been using Metar data for this purpose for years. Not 100% but certainly thousands of dollars less than the alternatives.

Fuzzy is okay when it is all you have.
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Cumulus Realtime Gadget

Post by gemini06720 »

Kevin, how about using the forecast from WXSIM for those of us that have that software - I have been using WXSIM for almost two years and the results (forecasts) produced by the software have proven to be more accurate than those produced by Environment Canada or any other local (to my area) forecasters...
ho66es
Posts: 38
Joined: Tue 26 Jan 2010 2:25 pm
Weather Station: Davi Vantage Vue
Operating System: Raspbian
Location: Belfast, UK
Contact:

Re: Cumulus Realtime Gadget

Post by ho66es »

love the gadget, and have a small? request

is it possible to make part of the gadget a clickable hyperlink with the target the realtime.txt url - the realtime.txt at end?
my weather station is http://www.ho66es.org/weather
TNETWeather

Re: Cumulus Realtime Gadget

Post by TNETWeather »

gemini06720 wrote:Kevin, how about using the forecast from WXSIM for those of us that have that software - I have been using WXSIM for almost two years and the results (forecasts) produced by the software have proven to be more accurate than those produced by Environment Canada or any other local (to my area) forecasters...
Well, I already was displaying my WXSIM data on my Cumulus website before I changed it to using the WIKI. Pretty much the same code that works for WD templates can be used with some tweaks. I have not put it back on the new site (still on my WD site) because ... time.

As for using that with the gadgetfeed data, its doable, but not on the list right now. Primarily because a cumulus only station would not be able to use WXSIM.

I was talking to Tom (WXSIM) just the other day about what it would take to use a Cumulus station's data for WXSIM but it is not on the burner yet. He is too busy right now with what is already on his platter. I did make a good case for it though.

One of the neat things about the scripts is that you end up with the source and can hack them to do things you want.

I am trying to stick to things that are easily supported rather than what could be done. I've got a whole directory of weather and website scripts I've never released because I don't have time to finish documenting them to provide support.

Making scripts is easy... supporting them is time consuming.
TNETWeather

Re: Cumulus Realtime Gadget

Post by TNETWeather »

ho66es wrote:love the gadget, and have a small? request

is it possible to make part of the gadget a clickable hyperlink with the target the realtime.txt url - the realtime.txt at end?
I think that might be a bit unusual for someone to want to do.

You can certainly do this yourself though... The gadget is really nothing more than a collection of files in a zip file that has been renamed with a gadget extension.

You can download the Gadget, extract it, make the changes you want and rezip it up, rename it to end in gadget and load it.
ho66es
Posts: 38
Joined: Tue 26 Jan 2010 2:25 pm
Weather Station: Davi Vantage Vue
Operating System: Raspbian
Location: Belfast, UK
Contact:

Re: Cumulus Realtime Gadget

Post by ho66es »

TNETWeather wrote:
ho66es wrote:love the gadget, and have a small? request

is it possible to make part of the gadget a clickable hyperlink with the target the realtime.txt url - the realtime.txt at end?
I think that might be a bit unusual for someone to want to do.

You can certainly do this yourself though... The gadget is really nothing more than a collection of files in a zip file that has been renamed with a gadget extension.

You can download the Gadget, extract it, make the changes you want and rezip it up, rename it to end in gadget and load it.
cool, its just sometimes I want to see trend graphs etc and i am to lazy to open browser and locate bookmark :)
my weather station is http://www.ho66es.org/weather
TNETWeather

Re: Cumulus Realtime Gadget

Post by TNETWeather »

cool, its just sometimes I want to see trend graphs etc and i am to lazy to open browser and locate bookmark
You close your browser(s) ?

I always have one or more browsers open with several tabs.

You could create a shortcut on your desktop that has the URL already in it. One double click and you are there.
ho66es
Posts: 38
Joined: Tue 26 Jan 2010 2:25 pm
Weather Station: Davi Vantage Vue
Operating System: Raspbian
Location: Belfast, UK
Contact:

Re: Cumulus Realtime Gadget

Post by ho66es »

i also dislike stuff on my desktop, and i don't know why i close browsers i just do :)
my weather station is http://www.ho66es.org/weather
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Cumulus Realtime Gadget

Post by gemini06720 »

TNETWeather wrote:You could create a shortcut on your desktop that has the URL already in it. One double click and you are there.
Or one could install Prism and use the desktop links created by Prism...
Post Reply