Page 1 of 1

Current Conditions Icon

Posted: Fri 14 Apr 2023 3:15 pm
by rick044
Hello,
the current conditions icon on my site never changes from night clear (icon number 1). I have the Metar set in the settings weather php and there is a meter file in my cache that updates often. What else am I missing to get this current conditions icon to update? I can't see any $iconnumber in my CUtags.php.

Thanks.

Re: Current Conditions Icon

Posted: Fri 14 Apr 2023 3:38 pm
by saratogaWX
Please post the URL to your website showing the issue.

For Cumulus/CumulusMX, an $iconnumber is not set by the software itself. The CU-defs.php will set it if you have a near-by METAR set, and that station reports cloud/sky conditions (some fully automated stations do not report cloud/sky conditions). The default is for 'partly cloudy' if the METAR does not contain cloud/sky conditions. Your local rain gauge can override it with a Rain icon if it is raining.

Re: Current Conditions Icon

Posted: Fri 14 Apr 2023 4:13 pm
by broadstairs
I have modified my CU-defs.php to add code to set the $iconnumber where a solar sensor is available. I used to have one with my old VP1 and now with my WS80 I also have solar. So for anyone who might be interested the code is here:-

Code: Select all

if (isset($WX['CurrentSolarMax'])) {  //setup for curent solar condition and icon number
    $lasttip = $WX['MinutesSinceLastRainTip'];
    if ($lasttip >= 40)  {
        if ($isdaylight == 1) {
            $currentsolarpercent = round(($VPsolar/$CurrentSolarMax)*100);
            if ($currentsolarpercent >= 75) { //Sunny
                $iconnumber = 0;
                $Currentsolarcondition = "Sunny";
            }
            if (($currentsolarpercent < 75) and ($currentsolarpercent >= 60)) { //Partly Cloudy 
                $iconnumber = 9;
                $Currentsolarcondition = "Few Clouds";
            }  
            if (($currentsolarpercent < 60) and ($currentsolarpercent >= 40)) { //Cloudy
                $iconnumber = 36;
                $Currentsolarcondition = "Partly Cloudy";
            }    
            if (($currentsolarpercent < 40) and ($currentsolarpercent >= 25)) { //Mainly Cloudy
                $iconnumber = 37;
                $Currentsolarcondition = "Mainly Cloudy";
            }
            if (($currentsolarpercent < 25) and ($currentsolarpercent >= 5)) { //Overcast
                $iconnumber = 18;
                $Currentsolarcondition = "Overcast";
            } 
            if (($currentsolarpercent < 5) and ($isdaylight == 1)) { //Overcast
                $iconnumber = 18;
                $Currentsolarcondition = "Overcast";
            }     
            if (($currentsolarpercent < 5) and ($isdaylight == 0)) { //Night
                $iconnumber = 1;
                $Currentsolarcondition = "Night";
            }     
        }
            if ($isdaylight == 0) { //Night time
                $iconnumber = 1;
                $Currentsolarcondition = "Night";
        }
    }
Feel free to use/modify as required.

Stuart

Re: Current Conditions Icon

Posted: Fri 14 Apr 2023 10:17 pm
by rick044
Thanks all.
I still had the setting of $SITE['WXtags'] set to "test tags.php" I changed it to CUtags.php and it seems to be working now. Posting this for anyone else looking in the future.