ktrue / CU-HWS

Home Weather Station website template for Cumulus (WeeWX, WeatherCat too)
Other
23 stars 13 forks source link

Solar UV Module missing almanac pop-up links #51

Closed steepleian closed 5 years ago

steepleian commented 5 years ago

Hi Ken,

I have just noticed that the pop-up links are missing from Solar UV module

ktrue commented 5 years ago

Which Solar UV module? weather34uvsolar.php solaruvds.php

and what did the links say/and what script was invoked with the link?

steepleian commented 5 years ago

Just had to install a previous version to remind myself.

The links are the same for both modules. You can see them here: - https://claydonsweather.org.uk/WX-HWS-demo

On 12 Feb 2019, at 21:55, Ken notifications@github.com wrote:

Which Solar UV module? weather34solaruv.php solaruvds.php

and what did the links say/and what script was invoked with the link?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ktrue/CU-HWS/issues/51#issuecomment-462952086, or mute the thread https://github.com/notifications/unsubscribe-auth/ARlZ_os5K9T9zk9HcpycNMmOOTDDbphqks5vMzhsgaJpZM4a4FSw.

ktrue commented 5 years ago

So the 'Solar | UV Index | Lux' panel had three links to: uvindex.php uvalmanac.php solaralmanac.php

The first one (uvindex.php) works with data from realtime.txt, the other two show historical data (and current data from a UV or Solar sensor). The historical data is not available in the realtime.txt .

For example, solaralmanac.php needs variables: $weather["solardmax"] $weather["solarmmax"] $weather["solarydmax"] $weather["solarymax"] and none of those are available via livedata.php fetching realtime.txt (the data is not in realtime.txt)

Likewise for the uvalmanac.php .. it has unique $weather[] variables not available.

So... the uvguide.php could be added as a link, but it's English only with no translation currently :(

With no source data, I don't recommend putting back links to uvalmanac.php nor solaralmanac.php quite yet.

ktrue commented 5 years ago

Ha! I found the livedata.php for Meteobridge had

    //alamanac solar
    $solaroriginalDate = $meteobridgeapi[108];
    $solarydmaxtime = date("H:i", strtotime($solaroriginalDate));   
    $solaroriginalDate2 = $meteobridgeapi[110];
    $solarmmaxtime = date('jS M H:i', strtotime($solaroriginalDate2));  
    $solaroriginalDate4 = $meteobridgeapi[112];
    $solarymaxtime = date('jS M H:i', strtotime($solaroriginalDate4));  
    $solaroriginalDate6 = $meteobridgeapi[106];
    $solardmaxtime = date('H:i', strtotime($solaroriginalDate6));   

    $weather["solarydmax"]          = number_format($meteobridgeapi[107],0, '.', ''); //temp max yesterday
    $weather["solarydmaxtime"]      = $solarydmaxtime; //seconds    
    $weather["solarmmax"]           = number_format($meteobridgeapi[109],0, '.', ''); //temp max month
    $weather["solarmmaxtime"]       = $solarmmaxtime; //date    
    $weather["solarymax"]           = number_format($meteobridgeapi[111],0, '.', ''); //temp max year
    $weather["solarymaxtime"]       = $solarymaxtime; //seconds 
    $weather["solardmax"]           = number_format($meteobridgeapi[105],0, '.', ''); //temp max today
    $weather["solardmaxtime"]       = $solardmaxtime; //seconds 

    //alamanac uv   
    $uvoriginalDate = $meteobridgeapi[115];
    $uvydmaxtime = date("H:i", strtotime($uvoriginalDate)); 
    $uvoriginalDate2 = $meteobridgeapi[117];
    $uvmmaxtime = date('jS M H:i', strtotime($uvoriginalDate2));    
    $uvoriginalDate4 = $meteobridgeapi[119];
    $uvymaxtime = date('jS M H:i', strtotime($uvoriginalDate4));    
    $uvoriginalDate6 = $meteobridgeapi[113];
    $uvdmaxtime = date('H:i', strtotime($uvoriginalDate6)); 

    $weather["uvydmax"]         = number_format($meteobridgeapi[114],1); //temp max yesterday
    $weather["uvydmaxtime"]     = $uvydmaxtime; //seconds   
    $weather["uvmmax"]          = number_format($meteobridgeapi[116],1); //temp max month
    $weather["uvmmaxtime"]      = $uvmmaxtime; //date   
    $weather["uvymax"]          = number_format($meteobridgeapi[118],1); //temp max year
    $weather["uvymaxtime"]      = $uvymaxtime; //seconds    
    $weather["uvdmax"]          = number_format($meteobridgeapi[58],1); //temp max today
    $weather["uvdmaxtime"]      = $uvdmaxtime; //seconds    

So the solaralmanac.php and uvalmanac.php were Meteobridge-specific pages I think.

steepleian commented 5 years ago

Ok,

I can generate all those variables very easily from the weewx database using the built in report generator (same goes for all the Meteobridge almanacs). I presume that is also possible from the Cumulus MySql database with the appropriate code?

On 13 Feb 2019, at 00:14, Ken notifications@github.com wrote:

ktrue commented 5 years ago

There isn't a native Cumulus mySQL database associated with the CU-HWS -- we're running on realtime.txt data for the displays, historical info from WU, forecasts from DarkSky (and current conds), optional current conds from METAR. To keep compatibility with current Cumulus/CumulusMX, WeeWX and WeatherCat, we need to rely only on data that comes from realtime.txt (IMHO), otherwise, we'd need likely need four methods to update a mySQL database from the four flavors of software with differing capabilities. I'm really not trying to be a pain here, but that expansion is beyond what I'd signed up with Brian to do with the Cumulus version of HWS.

steepleian commented 5 years ago

Hi Ken I completely understand and strongly agree. The most important thing for me is that the CU master remains visually faithful to Brian’s Meteobridge master and his design ethos where possible within the constraints of the realtime.txt file. I have explained this to all my WeeWX users who are in general agreement. However, many WeeWX users are very keen to use their own data for charts etc. In reality WeeWX can do anything that Meteobridge can do and more. I believe that it is possible to offer these benefits by by keeping this aspect completely seperate from the CU-HWS development so as not to complicate the process. I am putting a short protocol together of how this should be possible and will run it by you. By the way, I notice that Wim van Der Kuil has also opened up his version to Cumulus and WeatherCat as well with an older design but his code is completely beyond me! Regards, Ian

On 13 Feb 2019, at 00:35, Ken notifications@github.com wrote:

There isn't a native Cumulus mySQL database associated with the CU-HWS -- we're running on realtime.txt data for the displays, historical info from WU, forecasts from DarkSky (and current conds), optional current conds from METAR. To keep compatibility with current Cumulus/CumulusMX, WeeWX and WeatherCat, we need to rely only on data that comes from realtime.txt (IMHO), otherwise, we'd need likely need four methods to update a mySQL database from the four flavors of software with differing capabilities. I'm really not trying to be a pain here, but that expansion is beyond what I'd signed up with Brian to do with the Cumulus version of HWS.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ktrue/CU-HWS/issues/51#issuecomment-463003600, or mute the thread https://github.com/notifications/unsubscribe-auth/ARlZ_k71DF5MlUcms8rSVltIFbDbpUaeks5vM13GgaJpZM4a4FSw.