Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

<#isdaylight> and <#forecastnumber> Webtags

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

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

<#isdaylight> and <#forecastnumber> Webtags

Post by beteljuice »

New <#webtags> <#isdaylight>, <#forecastnumber> What's the point ?

Well ........ If you are using the 'normal' xxxT.htm template method of updating your website - things just got a whole lot more interesting :D

You don't even need to use JavaScript !


First of all the following assumes that you create a (web) directory called myimages.

<#isdaylight>

OK - let's say you would like a day or night image in the top right of your webpage.

First of all, you need to create a 'day' image, call it /myimages/daynight_1.gif (or jpg or png)
Then create a 'night' image, call it /myimages/daynight_0.gif
If you don't want one of the images, make it a small transparent gif or png
NB. Both images MUST be the same format !

Then between the <body> tag and <div id='content'> tags of your xxxT.htm file, you would need something like

Code: Select all

<!-- Daytime / night time graphic -->
<img src="myimages/daynight_<#isdaylight>.gif" style=" position: absolute; right: 5%; margin-top: 1%;" />
Don't forget to put the same format as the images you created !
Job done !

If you would like to change your entire page background, that is a little bit different in the xxxT.htm code.
(I would recommend two jpg or png format images)

In the <head> section of your page you need to add some css code AFTER
<link href="weatherstyle.css" rel="stylesheet" type="text/css">

Like this:

Code: Select all


<link href="weatherstyle.css" rel="stylesheet" type="text/css">

<style type="text/css">
body {
	
	background-image: url(images/daynight_<#isdaylight>.jpg);
}
</style>

Now for forecast images / icons !

<#forecastnumber>

There are actually 29 possibilities, 28 weather (including exceptional high / low), and one 'no data'

In your myimages directory, create the following images: (once again, format of your choice, as long as they are all the same)

weather_0.jpg - this could be a 'blank', means "Not Available"
weather_-1.jpg - this could be a copy of the next image, means Exceptionally Fine
weather_1.jpg
... These should be to suit forecast conditions 1 => 26
weather_26.jpg
weather_-26.jpg - this could be a copy of above, means Exceptionally Bad

You decide where you are going to put the image in your xxxT.htm file

Code: Select all

<img src="myimages/weather_<#forecastnumber>.jpg" alt="Station Forecast" title="Station Forecast" />
But wait ... "What light through yonder window breaks" ...
You can have different day / night forecast graphics (although strictly speaking the forecast is for some time in the future)

Create images as above, but called
for NIGHT graphics
weather_0_0.jpg
weather_0_-1.jpg
weather_0_1.jpg
..
weather_0_26.jpg
weather_0_-26.jpg

for DAY graphics
weather_1_0.jpg
weather_1_-1.jpg
weather_1_1.jpg
..
weather_1_26.jpg
weather_1_-26.jpg

html then becomes:

Code: Select all

<img src="myimages/weather_<#isdaylight>_<#forecastnumber>.jpg" alt="Station Forecast" title="Station Forecast" />
NB. I haven't tested this :shock: - but It should work (I hope :oops: )

Edit: Not a good start, I got one of the webtags wrong :roll: - thanks Steve
Last edited by beteljuice on Sun 29 Nov 2009 1:56 am, edited 3 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
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: <#isdaynight> and <#forecastnumber> Webtags

Post by daj »

A brilliant solution which saves a lot of coding -- I can now cut down quite a few lines of PHP on my site :)

Plugs for the Wiki -- the new webtags have been added to the list http://wiki.sandaysoft.com/index.php?title=Webtags
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: <#isdaylight> and <#forecastnumber> Webtags

Post by gemini06720 »

Or, another way would be to have two separate directories, such as:

0 - containing the night files
1 - containing the day files

... ;)
User avatar
akasonny
Posts: 232
Joined: Mon 15 Jun 2009 4:43 am
Weather Station: Zephyr TD-1000
Operating System: Windows 10
Location: Sahuarita, AZ, USA
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by akasonny »

This is one great idea ...

If anyone establishes or locates 26 icons for this function, would you please post the URL here? There are alot of them out there but usually less than 26 or they just don't fit the webtag descriptions. In other words, its a wee bit difficult to 'force' most of them to fit...I've tried it and can't really say I'm proud of the outcome.
User avatar
Palmyweather
Posts: 58
Joined: Sat 28 Nov 2009 9:57 am
Weather Station: WeatherDuino Pro2 Plus (custom)
Operating System: Windows 11
Location: New Zealand
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by Palmyweather »

Could you please tell us what the 28 weather stats are? As in 1 = Sunny, 2 = Partly Cloudy, 3 = Cloudy etc...?
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: <#isdaylight> and <#forecastnumber> Webtags

Post by daj »

they are all listed in the samplestrings.ini file in your Cumulus folder, or listed in the Cumuus wiki -- http://wiki.sandaysoft.com/index.php?title=Strings.ini

Remember, you need to be on Version 1.8.8 build 874 or greater to take full advantage of this
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
akasonny
Posts: 232
Joined: Mon 15 Jun 2009 4:43 am
Weather Station: Zephyr TD-1000
Operating System: Windows 10
Location: Sahuarita, AZ, USA
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by akasonny »

I'd like to see an expansion to this idea if its feasible.

Currently, when a unit surpasses a pre-determined level, you can use ALARM to sound an audible tone. It would be nice if we had a webtag flag set for each alarm case, as well (ie: #highwind_0, #highwind_1).

As example, if the wind speed were to exceed x mph, the alarm would sound and a webtag would set,(like #highwind_1) generating a "windy" icon/png which could be displayed on the indexT.htm or some other web page. And then use this same principle for temperature high, temperature low, rain rate and anything else deemed useable.

I know Steve has made extensive use of strings.ini up to this point..and now we have "daynight" so perhaps I'm pushing the envelope here a bit ... but the idea is still pretty cool.
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by steve »

akasonny wrote:Currently, when a unit surpasses a pre-determined level, you can use ALARM to sound an audible tone. It would be nice if we had a webtag flag set for each alarm case, as well (ie: #highwind_0, #highwind_1).

As example, if the wind speed were to exceed x mph, the alarm would sound and a webtag would set,(like #highwind_1) generating a "windy" icon/png which could be displayed on the indexT.htm or some other web page. And then use this same principle for temperature high, temperature low, rain rate and anything else deemed useable.
Yes that's a nice idea, and pretty straightforward to implement, with the existing set of alarm conditions. Easiest way (for me) would be a tag just called (for example) <#highwindalarm> which had a value of 1 while the alarm condition was met, and 0 otherwise.
Steve
User avatar
akasonny
Posts: 232
Joined: Mon 15 Jun 2009 4:43 am
Weather Station: Zephyr TD-1000
Operating System: Windows 10
Location: Sahuarita, AZ, USA
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by akasonny »

That's spot on. A transparent png for condition 0 and a more applicable png for condition 1 would work just fine. In fact, the transparent png could work for ALL situations which have condition 0...and so would just need to make/obtain png's for condition 1 responses and tie them in, in the appropriate web pages.

As if you needed another idea to add, eh? (probably NOT).
steve wrote:[Yes that's a nice idea, and pretty straightforward to implement, with the existing set of alarm conditions. Easiest way (for me) would be a tag just called (for example) <#highwindalarm> which had a value of 1 while the alarm condition was met, and 0 otherwise.
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by steve »

akasonny wrote:As if you needed another idea to add, eh? (probably NOT).
Ah well, it keeps me out of mischief.

There seems to be a rash of people finding real, fixable bugs in Cumulus at the moment. I want to get these out of the way, and any others that come along soon, and then 'release' 1.8.8 before (at some point) embarking on more enhancements. But I'll be sure to include this one when I do.
Steve
User avatar
GTB
Posts: 75
Joined: Thu 06 Nov 2008 12:14 am
Weather Station: ws1081 with Cumulus
Operating System: win 2000
Location: Terrigal NSW
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by GTB »

just tried the <#forecastnumber> and <#isdaylight> combination on my site

will have to monitor to see how well the <#isdaylight> works i guess

geoff
Image
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: <#isdaylight> and <#forecastnumber> Webtags

Post by beteljuice »

Query for Steve:

<#forecastnumber> and its realtime equivalent.

Is the output 0 if they are NOT using Cumulus forecast ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by steve »

beteljuice wrote:<#forecastnumber> and its realtime equivalent.

Is the output 0 if they are NOT using Cumulus forecast ?
Yes.
Steve
Master120
Posts: 29
Joined: Wed 13 Jan 2010 6:20 am
Weather Station: ws2350
Operating System: XP
Location: Finland

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by Master120 »

So it is in the strings.ini file the <#stationtype> tag should be?
Default stationtype is ws2300(not mine) so where to change this.

Also read about cumuluswebtags.php, but the USAGE part is complicated.

J
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: <#isdaylight> and <#forecastnumber> Webtags

Post by steve »

Master120 wrote:So it is in the strings.ini file the <#stationtype> tag should be?
Default stationtype is ws2300(not mine) so where to change this.
You change the displayed station type on the station settings screen (Configuration | Station). The "Station model" box.
Steve
Post Reply