Page 1 of 7

Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Sat 20 Dec 2014 11:25 pm
by JennyLeez
After years of manually adding the ‘Current Conditions’ into my Cumulus Window on my PC, I finally have a script to do it for me automatically by reading the webtags on my Server.

So this Christmas I share this new toy with anyone interested :)

This script adds a text line displaying the 'Current Conditions' gained from the Cumulus processed webtags.
It does not replace <#currcond> but may be used instead of, or in conjunction with.
e.g. Sunny, Warm, Light Winds from the North-Northwest, Temperature Falling, Barometer Falling Slowly.

Live Demos:
Cumulus Standard
Under the Time and Date.
http://wairoa.net/weather/cc/curcond.htm
Admin Modifier Panel Standalone Demo:
http://wairoa.net/weather/cc/currAdminML.php

Saratoga template:
Under the Web Cam Thumbnail
http://nzpws.net/saratoga/index.php?lang=en
Admin Modifier Panel Demo:
http://nzpws.net/saratoga/CCmodifier.php

Cumulus - Own Design
Above the Webcam thumbnail - Short Version.
http://wairoa.net/weather/cc/curconditions_short.htm
Admin Modifier Panel 'Own Design' Demo:
http://wairoa.net/weather/cc/CCmodifier.htm

Weather By You
Example template - Weather Eden
Across the top using the php method.
On the Right using the Javascript method.
http://nzpws.net/wby/index.php
Admin Modifier Panel Demo:
http://nzpws.net/wby/CCmodifier.php

Leuven Template
Under the Temperature Block
http://nzpws.net/weather2/index.php

Some decisions are a "best guess", some options will require a solar sensor.

Single language working is suitable for ALL page types (htm / html / php / asp), Multi-Language must be php, and can be used with:
- Standard Cumulus upload
- Own Design or suitable web site template
- Saratoga ML Template
- Weather By You ML Template
- Leuven Template

Options and Full Instructions are in the Readme.txt

Note – Options include javascript output in a single Language site.

USER defined variables.
Which weather "elements" to display.
User ‘language’ variables may be defined to suit your location and conditions.

Known Limitations:
Your server MUST be php enabled, but the output can be in a php page OR standard html page.
Instructions are in the Readme.

4 Distribution Versions are available.
20th December 2014 v3.0
- Saratoga
- Weather By You
- Cumulus Standard and Cumulus Own Design.
28th December 2014
- Leuven Template

Packages Contain:
curconditions.php - Main Current Conditions Script.
CCdata.php - File Cumulus will Process/upload

currAdminML.php - Optional Admin Modifier Panel addon for currconditions.php (all versions)
CCmodifier.php - Admin Modifier Panel for use with the Saratoga/Weather by You enviroments.
cur_footer.php - Addon used by CCmodifier.php for Saratoga only.
overwrite.txt - Our working file.
Readme.txt
Screenshots
Language translation Files - For use with Saratoga Template
en (Anon)
fr (PaulMy)
el (Corsair)
nl (Nitrx)
pl (pernaczy)
pt (Werk-AG)
de (KarlS)
it (Vathek)
no (Altaelva)
es (yv1hx)
fi (Kapo)
si (dunda)
mi (JennyLeez)
bg (Anon)
se (beelzebubs/bduren)
ct (Anon)
dk (Anon)
af (Anon)
ro (Anon)
hu (Anon)
he (Anon)

Language Translation Files for use with Weather By You and Cumulus Standard.
CC-de.php
CC-en.php
CC-es.php
CC-fi.php
CC-it.php
CC-nl.php
CC-no.php
CC-pl.php
CC-fr.php
CC-sl.php
CC-se.php
Files will be added as they are completed.

Admin Modifier Panel
Optional Admin Modifier Panel addon included. Allows web browser access to the ‘Current Conditions’ line with the ability to add to, or change the display plus set the length of time to display before returning back to auto.

My thanks to the beteljuice for taking an idea, a few lines of code and reanimating this script.
My thanks also to PaulMy and Nitrx for helping test the different versions and UOM and lastly but not least, my thanks to those who have helped with the translating.

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Sun 21 Dec 2014 12:23 am
by PaulMy
I will install the release version later this evening, and the beta version is being used here -
http://www.komokaweather.com Cumulus
http://www.komokaweather.ca Saratoga

Well done JennyLeez and beteljuice :clap:

Paul

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Sun 21 Dec 2014 5:04 pm
by bnwrx
I am trying it here: http://woodlandweather.org/

It says "Hot"...I am wondering if there is a setting somewhere for "F" instead of "C"??
Also it says my Temperature is "Falling Rapidly" when in fact it is slowly "Rising"

Any suggestions appreciated....

Thanks for this add-on though...

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Sun 21 Dec 2014 8:47 pm
by beteljuice
There are hiccoughs somewhere - the beteljuice will investigate ...

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Sun 21 Dec 2014 9:08 pm
by bnwrx
beteljuice wrote:There are hiccoughs somewhere - the beteljuice will investigate ...
I will patiently await the results of the investigation.....

Thank you..!

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Sun 21 Dec 2014 11:49 pm
by beteljuice
The beteljuice totally cocked-up a simple temperature conversion (Affects those with a 'native' unit of F)

In curconditions.php look for:

Code: Select all

// now do Comfort Index text
// NB: $apptemp should be APPARENT temperature C
    $CI_text = ""; // Get Out Of Jail Free
    $_apptemp = decCom($apptemp);
    if($display['showComfort']){
        if($tempunitnodeg != "C") $_apptemp = round(($_apptemp *9 /2) +32); // ***** WRONG WRONG WRONG
The 'WRONG' line should be:

Code: Select all

        if($tempunitnodeg != "C") $_apptemp = round(($_apptemp -32) *5 /9);
There had to be an :oops: somewhere !!!

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 12:24 am
by JennyLeez
Version 3 Packages Corrected and re uploaded.

Thanks beteljuice :)

For those needing to edit.
The line is around 419.

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 12:27 am
by bnwrx
beteljuice wrote:The beteljuice totally cocked-up a simple temperature conversion (Affects those with a 'native' unit of F)

In curconditions.php look for:

Code: Select all

// now do Comfort Index text
// NB: $apptemp should be APPARENT temperature C
    $CI_text = ""; // Get Out Of Jail Free
    $_apptemp = decCom($apptemp);
    if($display['showComfort']){
        if($tempunitnodeg != "C") $_apptemp = round(($_apptemp *9 /2) +32); // ***** WRONG WRONG WRONG
The 'WRONG' line should be:

Code: Select all

        if($tempunitnodeg != "C") $_apptemp = round(($_apptemp -32) *5 /9);
There had to be an :oops: somewhere !!!

I made the change... and now I am "Uncomfortably Hot"......

I think there must be another issue....

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 12:32 am
by beteljuice
I am seeing 'Uncomfortably Chilly'
<!-- temp: 32.5, apptemp: 27.6, temptrend: -1.4, tempunitnodeg: F -->
Which is correct.

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 12:34 am
by bnwrx
I took the chance and "converted" the "C" temps in the script to "F", and it seems to have adjusted me from "Hot" to "Cold"...

Her are my conversions:

I also changed the "Language" file....changed "Cold" and "Uncomfortably Cold"...to "Chilly" and "Uncomfortably Chilly"

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 12:43 am
by bnwrx
To save confusion...
I will revert to your corrected script now...(5:45mst)

You can see it still claims I am "Hot"....

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 12:48 am
by beteljuice
Do not assume - that makes an Ass with U and ME.
This is rubbish whichever way round the conversion is:

Code: Select all

       if($tempunitnodeg != "C") $_apptemp = round(($_apptemp *9 /2) +32);
The 'factor' is wrong to start with !!!

You have simply crashed through the bit we need to check, then supplied converted values that shouldn't have to happen.

How are we supposed to debug if you change what you report ?

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 12:53 am
by bnwrx
beteljuice wrote:Do not assume - that makes an Ass with U and ME.
This is rubbish whichever way round the conversion is:

Code: Select all

       if($tempunitnodeg != "C") $_apptemp = round(($_apptemp *9 /2) +32);
The 'factor' is wrong to start with !!!

You have simply crashed through the bit we need to check, then supplied converted values that shouldn't have to happen.

How are we supposed to debug if you change what you report ?
My apologies....I appreciate all your efforts....

I will leave it as is now showing....

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 1:11 am
by beteljuice
@bnwrx

I can see nothing obvious, can you please add this 'debug' line:

Code: Select all

// now do Comfort Index text
// NB: $apptemp should be APPARENT temperature C
    $CI_text = ""; // Get Out Of Jail Free
    $_apptemp = decCom($apptemp);
    if($display['showComfort']){
        if($tempunitnodeg != "C") $_apptemp = round(($_apptemp -32) *5 /9);
if($debug) echo "<!-- _apptemp: $_apptemp C -->\n";
I HAVE however discovered another problem with temp trend, where I applied a constant that I shouldn't - must have been a bad day for the beteljuice and temperatures ..

Code: Select all

    if($display['showTemp']){ // need to workout text for temp trend - figures are guess work !
        $_temptrend = decCom($temptrend);
        if($tempunitnodeg == "F") $_temptrend = ($_temptrend -32) / 9 * 5; // *** WRONG WRONG WRONG
        if($_temptrend >= -0.2 && $_temptrend <= 0.1) $ttrend = $langCurrWeather["Steady"];
'WRONG' line should be

Code: Select all

        if($tempunitnodeg == "F") $_temptrend = $_temptrend *5 /9;
Patience everone ....

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 22 Dec 2014 1:22 am
by bnwrx
I've made those changes....No change...

I must leave for a few hours.....