Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/history report #54

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

seehase
Copy link

@seehase seehase commented Jun 18, 2022

Added the history report from https://github.com/ngulden/niculskin/
and took also some version updates from dependabot

dependabot bot added 5 commits June 18, 2022 10:18
Bumps [node-sass](https://github.com/sass/node-sass) from 5.0.0 to 7.0.0.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](sass/node-sass@v5.0.0...v7.0.0)

---
updated-dependencies:
- dependency-name: node-sass
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
(cherry picked from commit 31d9fd5)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
(cherry picked from commit b27f8a0)
Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v6.1.0...v6.1.11)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
(cherry picked from commit ac62267)
@seehase
Copy link
Author

seehase commented Jun 18, 2022

Example can be seen here
https://solar.seehausen.org/weewx/history.html

@uktricky
Copy link

Nice add on - how about wind? Average and max speeds?

@seehase
Copy link
Author

seehase commented Jun 19, 2022

Nice add on - how about wind? Average and max speeds?

Hi @uktricky
I added wind tables... please have a look
https://solar.seehausen.org/weewx/history.html
grafik

@uktricky
Copy link

Looks good, I've just gotten around to looking this again, work always getting in the way! I've created a dev version of my current NeoWX-Material installation so I can have a play in dev before I risk breaking my live site.

Might be a daft question but I am not an expert when using GitHub by any means! How do I get your history pages into my version? Would you mind sending me some guidance? Thanks in advance...

@seehase
Copy link
Author

seehase commented Jul 24, 2022

Looks good, I've just gotten around to looking this again, work always getting in the way! I've created a dev version of my current NeoWX-Material installation so I can have a play in dev before I risk breaking my live site.

Might be a daft question but I am not an expert when using GitHub by any means! How do I get your history pages into my version? Would you mind sending me some guidance? Thanks in advance...

How to get History Reports
download the files from
https://github.com/seehase/neowx-material/archive/refs/heads/feature/history-report.zip

Extract ZIP file and copy these files

src/footer.inc
src/header.inc
src/history.html.tmpl
src/skin.conf

to folder
/etc/weewx/skins/neowx-material

Copy
bin/user/historygenerator.py

to
/usr/share/weewx/user

then restart weewx and you should see the History Report after the next generation run

@cbirkenbeul
Copy link

@seehase Is this a render issue on Safari? Or a small bug?
Bildschirmfoto 2022-07-25 um 12 30 54

@seehausen
Copy link

@seehase Is this a render issue on Safari? Or a small bug?
This depends on the screen resolution
I'm not a Frontend expert, probably this can be optimised ;-), maybe you can help?
but the colors looks different to what I have

@cbirkenbeul
Copy link

Yeah, it seems it like a resolution thing. I'm on a newer MacBook with pretty big resolution. If I shrink the browser window, it seems ok.

@uktricky
Copy link

uktricky commented Jul 26, 2022

Looks good, I've just gotten around to looking this again, work always getting in the way! I've created a dev version of my current NeoWX-Material installation so I can have a play in dev before I risk breaking my live site.
Might be a daft question but I am not an expert when using GitHub by any means! How do I get your history pages into my version? Would you mind sending me some guidance? Thanks in advance...

How to get History Reports download the files from https://github.com/seehase/neowx-material/archive/refs/heads/feature/history-report.zip

Extract ZIP file and copy these files

src/footer.inc
src/header.inc
src/history.html.tmpl
src/skin.conf

to folder /etc/weewx/skins/neowx-material

Copy bin/user/historygenerator.py

to /usr/share/weewx/user

then restart weewx and you should see the History Report after the next generation run

Many thanks - I did find the files you'd changed and hacked around so got it working, had to amend the skin.conf as I'd changed the original from the original release. Thanks again for pulling this feature together be good to see it merged into the release version.

Re. the other posts on this thread, I'm running on Safari also but again larger resolution.

Screenshot 2022-07-26 at 19 52 50

@cbirkenbeul
Copy link

So I tried it a third time. This time I deleted the "old" neowx-material folder and used it from the uploaded zip file.

Still the same issues. Rendering is off and just the first value got a css background. The rendering is on @seehase Site off too. So this does not seems a problem on my side directly.

There is also a thread on the wetterstationsforum.info forum with a small manual bit with slightly other instructions. I also tried this, but without success.

@seehausen
Copy link

So I tried it a third time. This time I deleted the "old" neowx-material folder and used it from the uploaded zip file.

Still the same issues. Rendering is off and just the first value got a css background. The rendering is on @seehase Site off too. So this does not seems a problem on my side directly.

There is also a thread on the wetterstationsforum.info forum with a small manual bit with slightly other instructions. I also tried this, but without success.

I know, it's because of the responsive design, and breakpoints for specific screen resolutions.
I'll try to fix it, or just prevent switching

@seehase
Copy link
Author

seehase commented Jul 30, 2022

So I tried it a third time. This time I deleted the "old" neowx-material folder and used it from the uploaded zip file.

Still the same issues. Rendering is off and just the first value got a css background. The rendering is on @seehase Site off too. So this does not seems a problem on my side directly.

There is also a thread on the wetterstationsforum.info forum with a small manual bit with slightly other instructions. I also tried this, but without success.

I fixed it somehow. not yet perfect but it does not break anymore

just take the history.html.tmpl file from last commit...
Maybe we find some Bootstrap guru who can solve it finally

@ferretstew
Copy link

ferretstew commented Aug 19, 2022

Thank you @seehase for this improvement. My use of US units seems to be causing trouble, particularly with parsing rainfall data which is stored in the the non-integer #.## format. When I first merged your code and added the [HistoryReport] section to skins conf, I used #.## formatted values for minvalues and maxvalues under the [[rain]] subsection. For example:

#minvalues = 0.00, 0.10, 0.25, 0.50, 0.75, 1.00 # Override default temperature colour scheme with rain specific scale 360 #maxvalues = 0.10, 0.25, 0.50, 0.70, 1.00, 10.00

When I ran wee_reports using those values, I received this error:

pi@weewx: /etc/weewx/skins/neowx-material $ sudo wee_reports
Using configuration file /etc/weewx/weewx.conf
Generating for all time
Traceback (most recent call last):
File "/usr/share/weewx/weewx/reportengine.py", line 197, in run
obj.start()
File "/usr/share/weewx/weewx/reportengine.py", line 385, in start
self.run()
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 169, in run
ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 229, in generate
ngen += self.generate(section[subsection], subsection, gen_ts)
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 229, in generate
ngen += self.generate(section[subsection], subsection, gen_ts)
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 321, in generate
searchList = self._getSearchList(encoding, timespan,
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 415, in _getSearchList
search_list += obj.get_extension_list(timespan, db_lookup)
File "/usr/share/weewx/user/historygenerator.py", line 171, in get_extension_list
self.search_list_extension[table_name] = self._statsHTMLTable(table_options, table_stats, table_name,
File "/usr/share/weewx/user/historygenerator.py", line 291, in _statsHTMLTable
htmlLine += (' ' * 12) + self._colorCell(value[0], format_string, bgColours)
File "/usr/share/weewx/user/historygenerator.py", line 317, in _colorCell
if (value >= int(c[0])) and (value <= int(c[1])):
ValueError: invalid literal for int() with base 10: '0.00'

It seemed the code was not handling the floats, so I modified skins.conf to use integers for minvalues and maxvalues as a temporary workaround and ran wee_reports again. The config file modification addressed the original error, but this time I received a different error:

pi@weewx: /usr/share/weewx/user $ sudo wee_reports
Using configuration file /etc/weewx/weewx.conf
Generating for all time
Traceback (most recent call last):
File "/usr/share/weewx/weewx/reportengine.py", line 197, in run
obj.start()
File "/usr/share/weewx/weewx/reportengine.py", line 385, in start
self.run()
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 169, in run
ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 229, in generate
ngen += self.generate(section[subsection], subsection, gen_ts)
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 229, in generate
ngen += self.generate(section[subsection], subsection, gen_ts)
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 321, in generate
searchList = self._getSearchList(encoding, timespan,
File "/usr/share/weewx/weewx/cheetahgenerator.py", line 415, in _getSearchList
search_list += obj.get_extension_list(timespan, db_lookup)
File "/usr/share/weewx/user/historygenerator.py", line 171, in get_extension_list
self.search_list_extension[table_name] = self._statsHTMLTable(table_options, table_stats, table_name,
File "/usr/share/weewx/user/historygenerator.py", line 227, in _statsHTMLTable
unit_type = reading.converter.group_unit_dict[reading.value_t[2]]
File "/usr/share/weewx/weewx/tags.py", line 488, in getattr
vh = self._do_query()
File "/usr/share/weewx/weewx/tags.py", line 474, in _do_query
result = weewx.xtypes.get_aggregate(self.obs_type, self.timespan,
File "/usr/share/weewx/weewx/xtypes.py", line 127, in get_aggregate
return xtype.get_aggregate(obs_type, timespan, aggregate_type, db_manager,
File "/usr/share/weewx/weewx/xtypes.py", line 455, in get_aggregate
target_val = weewx.units.convertStd(val, db_manager.std_unit_system)[0]
File "/usr/share/weewx/weewx/units.py", line 1444, in convertStd
return StdUnitConverters[target_std_unit_system].convert(val_t)
File "/usr/share/weewx/weewx/units.py", line 879, in convert
new_unit_type = self.group_unit_dict.get(val_t[2], USUnits[val_t[2]])
IndexError: tuple index out of range

This second error seems to occur during the conversion to US units, and I have never received it before when generating reports. I presume my weewx database contains rain data stored in non-integer format, but I don't have the python knowledge to determine whether that is resulting in this error. I would also like to be able to use appropriate US non-integer units for minunits and maxunits in skins.conf.

Can you help?

@seehase
Copy link
Author

seehase commented Aug 21, 2022

HI @ferretstew
database values in non-integer is no problem, they are always stored in numeric

To have min/max ranges in numeric you can take my latest version or just change this line

if (value >= float(c[0])) and (value <= float(c[1])):
of historygenerator.py to

if (value >= float(c[0])) and (value <= float(c[1])):
and restart weewx service

float value can be set in skin.conf like

       minvalues = 0.00, 1.10, 3.25, 7.50, 10.75, 12.10  
       maxvalues = 1.10, 3.25, 7.50, 10.75, 12.10, 100.40

for your problem with us-units, please send me your wewwx.conf and skin.conf, then I can have a look, It will take a while because I will be on vacation

@ferretstew
Copy link

I made the recommended change to historygenerator.py and restarted weewx, but I still receive the second error mentioned in my last post ("tuple index out of range" on line 879 of units.py).

I have attached a zipfile of my weewx.conf and skin.conf, modified to obscure passwords. I don't think I've modified skin.conf.
I believe all mods I've made the skin configuration are contained in my weewx.conf. Also, you will notice I've reverted to using floats in my rain minvalues and maxvalues (for example, "0.10").

Thank you!

configs.zip

@seehase
Copy link
Author

seehase commented Sep 16, 2022

Hi ferretstew
US Units should not be a problem
see https://solar.seehausen.org/weewx/index.html I currently changed the units to US

I think the problem is your configuration, it is a bit "mixed"
Best solution would be start a new configuration from scratch, and configure your driver and parameter
have a look into my config files,
e.g. HistoryReport config should be in the skin.conf

you can take the attached skin.conf without any changes, only your weewx.conf should be adapted
take the default weewx conf and make the changes for your driver, and skin, then it should work

if you have a question please send me a mail to [email protected]

config-files.zip

@Pogs2004
Copy link

Pogs2004 commented Nov 5, 2022

@Pogs2004 nice... but was is the solution, or was the problem? ah I see... I use a very old version, I will update the historygenerator.py in my PR

Anyway I see not much activity in this repo, does it make sense to continue working in a new fork?

This is the one I used (extension changed to txt):
historygenerator.txt

It's a shame there's not much activity, it's a great skin and the recent additions like this and the wind direction graph make it a fully loaded front end.

@seehase
Copy link
Author

seehase commented Nov 5, 2022

Updated my PR and also added the new winDir feature

@W0CHP
Copy link

W0CHP commented Nov 5, 2022

Hi @seehase, problem solved, see above reply to @W0CHP . Thanks for all the help

My pleasure! Cheers!

@W0CHP
Copy link

W0CHP commented Nov 5, 2022

Updated my PR and also added the new winDir feature

Awesome! Glad my PR was useful. Enjoying the collaboration. :)

@W0CHP
Copy link

W0CHP commented Nov 6, 2022

@seehase per your request, here's my All-Time Records template for history.html.tmpl...

After the last "card" (UV, around line # 94), add the following (and tweak to your desire):

                    <div class="card-body text-center">
                        <h3 class="h4-responsive $Extras.color-text"><i class="fa fa-list-alt" ></i> All-Time Records</h3>
                        <div class="card-body text-center">
                            <div class="card">
                                <table class="table text-left">
                                    <tr>
                                        <th colspan="3" class="text-center"><b>Temperatures</b></td>
                                    </tr>
                                    <tr>
                                        <td>Highest:</td>
                                        <td>$alltime.outTemp.max</td>
                                        <td>$alltime.outTemp.maxtime</td>
                                     </tr>
                                     <tr>
                                        <td>Lowest:</td>
                                        <td>$alltime.outTemp.min</td>
                                        <td>$alltime.outTemp.mintime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="text-center"><br><b>Heat Index</b></td>
                                    </tr>
                                    <tr>
                                        <td>Highest:</td>
                                        <td>$alltime.heatindex.max</td>
                                        <td>$alltime.heatindex.maxtime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="text-center"><br><b>Wind Chill</b></td>
                                    </tr>
                                    <tr>
                                        <td>Lowest:</td>
                                        <td>$alltime.windchill.min</td>
                                        <td>$alltime.windchill.mintime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="text-center"><br><b>Dewpoint</b></td>
                                    </tr>
                                    <tr>
                                        <td>Highest:</td>
                                        <td>$alltime.dewpoint.max</td>
                                        <td>$alltime.dewpoint.maxtime</td>
                                    </tr>
                                    <tr>
                                        <td>Lowest:</td>
                                        <td>$alltime.dewpoint.min</td>
                                        <td>$alltime.dewpoint.mintime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="text-center"><br><b>Pressure</b></td>
                                    </tr>
                                    <tr>
                                        <td>Highest:</td>
                                        <td>$alltime.barometer.max</td>
                                        <td>$alltime.barometer.maxtime</td>
                                    </tr>
                                    <tr>
                                        <td>Lowest:</td>
                                        <td>$alltime.barometer.min</td>
                                        <td>$alltime.barometer.mintime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="text-center"><br><b>Wind</b></td>
                                    </tr>
                                    <tr>
                                        <td>Highest Sustained:</td>
                                        <td>$alltime.windSpeed.max.format('%.0f')</td>
                                        <td>$alltime.windSpeed.maxtime</td>
                                    </tr>
                                    <tr>
                                        <td>Highest Gust:</td>
                                        <td>$alltime.windGust.max.format('%.0f')</td>
                                        <td>$alltime.windGust.maxtime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="text-center"><br><b>Precipitation</b></td>
                                    </tr>
                                    <tr>
                                        <td>Highest Daily Rainfall:</td>
                                        <td>$alltime.rain.maxsum</td>
                                        <td>$alltime.rain.maxsumtime</td>
                                    </tr>
                                    <tr>
                                        <td>Highest Rain Rate:</td>
                                        <td>$alltime.rainRate.max</td>
                                        <td>$alltime.rainRate.maxtime</td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>

@seehase
Copy link
Author

seehase commented Nov 6, 2022

@W0CHP
Thanks... integrated it into my PR

@Pogs2004
Copy link

Pogs2004 commented Nov 7, 2022

Looking good now, I have added the all time records (tweaked a bit): https://www.360shetland.co.uk/weather/history.html

@W0CHP I was looking at your Sun & Moon page, just wondering how you coded the "Today's Total Luminosity
9 hours, 58 minutes, 42 seconds (2 minutes, 32 seconds less than yesterday)"? It would be very useful for my station

@seehausen
Copy link

Looking good now, I have added the all time records (tweaked a bit): https://www.360shetland.co.uk/weather/history.html

@W0CHP I was looking at your Sun & Moon page, just wondering how you coded the "Today's Total Luminosity 9 hours, 58 minutes, 42 seconds (2 minutes, 32 seconds less than yesterday)"? It would be very useful for my station

@Pogs2004
I like your tweaks ;-) would like to take them into my PR, can you send them to me?

@Pogs2004
Copy link

Pogs2004 commented Nov 7, 2022

@Pogs2004 I like your tweaks ;-) would like to take them into my PR, can you send them to me?

EDIT My history.html.tmpl file, it wasn't working correctly in dark mode and the font size was too small. I haven't set the language translations in the all time records section but it should be easy to do. I split the all time records into a separate card and aligned the headings to the left. I have also added the Erik Flowers WI weather icons which are installed with Neowx rather than the Font Awesome ones which may not be on an end users system.

#encoding UTF-8
#attr $active_nav = 'history'

<!DOCTYPE html>
<html class="no-js">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="profile" href="http://gmpg.org/xfn/11" />

        <title>
           $Extras.Translations[$Extras.language].history | $station.location
        </title>
        #include "head.inc"

         <!-- <style type="text/css">
			 .auto-theme .table {color:black !important;}
		 </style> -->

    </head>

    <body class="${Extras.Appearance.mode}-theme main-bg" ontouchstart="">
        #attr $active_nav = 'history'
        #include "header.inc"

        <main>
            <div class="container">
            <div class="row my-4 align-content-start">
             <div class="col-12 mb-4 text-center">
                 <h2 class="h2-responsive text-dark"><i class="wi wi-day-cloudy-gusts" ></i> <dfn data-info="Colour coded weather statistics by year and month">Weather Statistics</dfn></h2></br>

                <div class="col-sm">
                    <div class="card">

                            <div class="card card-body">
                                <h4 class="h5-responsive blue-text"><i class="wi wi-thermometer" ></i> $Extras.Translations[$Extras.language].min_temp</h4>
                                $min_temp_table
                            </div>
               
                            <div class="card card-body">
                                <h4 class="h5-responsive blue-text"><i class="wi wi-thermometer" ></i> $Extras.Translations[$Extras.language].avg_temp</h4>
                                $avg_temp_table
                            </div>

                            <div class="card card-body">
                                <h4 class="h5-responsive blue-text"><i class="wi wi-thermometer" ></i> $Extras.Translations[$Extras.language].max_temp</h4>
                                $max_temp_table
                            </div>

                            <div class="card card-body">
                                <h4 class="h5-responsive blue-text"><i class="wi wi-showers" ></i> $Extras.Translations[$Extras.language].rain</h4>
                                $rain_table
                            </div>

                            <div class="card card-body">
                                <h4 class="h5-responsive blue-text"><i class="wi wi-showers" ></i> $Extras.Translations[$Extras.language].rain_days (> 0.2mm)</h4>
                                $rain_days_table
                            </div>

                            <div class="card card-body">
                                <h4 class="h5-responsive blue-text"><i class="wi wi-strong-wind" ></i> $Extras.Translations[$Extras.language].max_wind</h4>
                                $max_wind_table
                            </div>

                            <div class="card card-body">
                                <h4 class="h5-responsive blue-text"><i class="wi wi-strong-wind" ></i> $Extras.Translations[$Extras.language].avg_wind</h4>
                                $avg_wind_table
                            </div>

                            <div class="card card-body">
                                <h4 class="h5-responsive blue-text"><i class="wi wi-day-sunny" ></i> $Extras.Translations[$Extras.language].uv_max</h4>
                                $uv_max_table
                            </div>
                    </div>
                    </br><h2 class="h2-responsive text-dark text-center"><i class="wi wi-time-2" ></i> <dfn data-info="All time records since September 2021">All Time Records</dfn></h2></br>
                    <div class="card">

                                <div class="card-body text-center" style="text-align:left;width:100%;">
                                <table class="table text-left records" style="width:100%;font-size:19px;">
                                    <tr>
                                        <th colspan="3" class="blue-text" style="text-align:left;font-size:20px;"><i class="wi wi-thermometer" ></i> Temperature</th>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest:</td>
                                        <td style="font-size:18px;">$alltime.outTemp.max</td>
                                        <td style="font-size:18px;">$alltime.outTemp.maxtime</td>
                                     </tr>
                                     <tr>
                                        <td style="font-size:18px;">Lowest:</td>
                                        <td style="font-size:18px;">$alltime.outTemp.min</td>
                                        <td style="font-size:18px;">$alltime.outTemp.mintime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="blue-text" style="text-align:left;font-size:20px;"><i class="wi wi-day-windy" ></i> Feels Like</th>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest:</td>
                                        <td style="font-size:18px;">$alltime.appTemp.max</td>
                                        <td style="font-size:18px;">$alltime.appTemp.maxtime</td>
                                     </tr>
                                    <tr>
                                        <td style="font-size:18px;">Lowest:</td>
                                        <td style="font-size:18px;">$alltime.appTemp.min</td>
                                        <td style="font-size:18px;">$alltime.appTemp.mintime</td>
                                    </tr>
                                    <tr>
                                         <th colspan="3" class="blue-text" style="text-align:left;font-size:20px;"><i class="wi wi-humidity" ></i> Humidity</th>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest:</td>
                                        <td style="font-size:18px;">$alltime.outHumidity.max</td>
                                        <td style="font-size:18px;">$alltime.outHumidity.maxtime</td>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Lowest:</td>
                                        <td style="font-size:18px;">$alltime.outHumidity.min</td>
                                        <td style="font-size:18px;">$alltime.outHumidity.mintime</td>
                                    </tr>
                                    <tr>
                                         <th colspan="3" class="blue-text" style="text-align:left;font-size:20px;"><i class="wi wi-barometer" ></i> Pressure</th>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest:</td>
                                        <td style="font-size:18px;">$alltime.barometer.max</td>
                                        <td style="font-size:18px;">$alltime.barometer.maxtime</td>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Lowest:</td>
                                        <td style="font-size:18px;">$alltime.barometer.min</td>
                                        <td style="font-size:18px;">$alltime.barometer.mintime</td>
                                    </tr>
                                    <tr>
                                         <th colspan="3" class="blue-text" style="text-align:left;font-size:20px;"><i class="wi wi-strong-wind" ></i> Wind</th>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest Sustained:</td>
                                        <td style="font-size:18px;">$alltime.windSpeed.max.format('%.0f')</td>
                                        <td style="font-size:18px;">$alltime.windSpeed.maxtime</td>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest Gust:</td>
                                        <td style="font-size:18px;">$alltime.windGust.max.format('%.0f')</td>
                                        <td style="font-size:18px;">$alltime.windGust.maxtime</td>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Longest Wind Run:</td>
                                        <td style="font-size:18px;">$alltime.windrun.max</td>
                                        <td style="font-size:18px;">$alltime.windrun.maxtime</td>
                                     </tr>
                                    <tr>
                                         <th colspan="3" class="blue-text" style="text-align:left;font-size:20px;"><i class="wi wi-umbrella" ></i> Precipitation</th>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest Daily Rainfall:</td>
                                        <td style="font-size:18px;">$alltime.rain.maxsum</td>
                                        <td style="font-size:18px;">$alltime.rain.maxsumtime</td>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest Rain Rate:</td>
                                        <td style="font-size:18px;">$alltime.rainRate.max</td>
                                        <td style="font-size:18px;">$alltime.rainRate.maxtime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="blue-text" style="text-align:left;font-size:20px;"><i class="wi wi-day-sunny" ></i> UV Index</th>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest:</td>
                                        <td style="font-size:18px;">$alltime.UV.max</td>
                                        <td style="font-size:18px;">$alltime.UV.maxtime</td>
                                    </tr>
                                    <tr>
                                        <th colspan="3" class="blue-text" style="text-align:left;font-size:20px;"><i class="wi wi-day-sunny" ></i> Solar Radiation</th>
                                    </tr>
                                    <tr>
                                        <td style="font-size:18px;">Highest:</td>
                                        <td style="font-size:18px;">$alltime.radiation.max</td>
                                        <td style="font-size:18px;">$alltime.radiation.maxtime</td>
                                    </tr>
                                </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>       
        </main>

        #include "footer.inc"
        #include "js.inc"
    </body>
</html>

@W0CHP
Copy link

W0CHP commented Nov 7, 2022

@W0CHP I was looking at your Sun & Moon page, just wondering how you coded the "Today's Total Luminosity 9 hours, 58 minutes, 42 seconds (2 minutes, 32 seconds less than yesterday)"? It would be very useful for my station

Sure @Pogs2004 - in the almanac.html.tmpl file, insert the following at the top, after the #encoding UTF-8 declaration:

#set $now = $current.dateTime.raw
#set $yesterday = $now - 24*3600
#set $today_dayluminosity = $almanac.sun.set.raw -  $almanac.sun.rise.raw                                                                                   
#set $yesterday_dayluminosity = $almanac($almanac_time=$yesterday).sun.set.raw - $almanac($almanac_time=$yesterday).sun.rise.raw                            
#set $difference_pre = $today_dayluminosity - $yesterday_dayluminosity
#set $difference = $difference_pre//60
#set $seconds = $almanac.sun.set.raw - $almanac.sun.rise.raw
#set $hours = $seconds //3600
#set $seconds %= 3600
#set $minutes = $seconds//60
#set $seconds %= 60
#set $dayluminosity_str = "%d hours, %d minutes, %d seconds" % ($hours, $minutes, $seconds)                                                                 
#set $difference = $today_dayluminosity - $yesterday_dayluminosity
#if $difference
    #set $delta = abs($difference)
    #set $amt_str = "%s%d seconds" % (str(int($delta) // 60) + ' minutes, ' if ($delta // 60) > 0 else '', $delta % 60 if ($delta // 60) > 0 else $delta)
    #if $difference > 0
        #set $delta_str = "%s more than yesterday" % $amt_str
    #else
        #set $delta_str = "%s less than yesterday" % $amt_str
    #end if
    #set $dayluminosity_str = "%s" % ($dayluminosity_str)
#end if

Then place something similar to this in the Sun "card" and tweak:

<h6 class="h6-responsive $Extras.color-text"> Today's Total Luminosity</h6>
<div class="row">
    <div class="col">
        $dayluminosity_str ($delta_str)
    </div>
</div>

@seehase
Copy link
Author

seehase commented Nov 7, 2022

Thanks @W0CHP
took over agin your changes
only have some problems with $alltime.windrun.* these values are not calculated correctly in my installation

@seehase
Copy link
Author

seehase commented Nov 7, 2022

Question: as there is not much actitity in that repo... do we want to create a fork to continue working on improvements?
Either my fork (https://github.com/seehase/neowx-material/tree/master) or any other
I like to contribute in this skin

@Pogs2004
Copy link

Pogs2004 commented Nov 7, 2022

@W0CHP I was looking at your Sun & Moon page, just wondering how you coded the "Today's Total Luminosity 9 hours, 58 minutes, 42 seconds (2 minutes, 32 seconds less than yesterday)"? It would be very useful for my station

Sure @Pogs2004 - in the almanac.html.tmpl file, insert the following at the top, after the #encoding UTF-8 declaration:

#set $now = $current.dateTime.raw
#set $yesterday = $now - 24*3600
#set $today_dayluminosity = $almanac.sun.set.raw -  $almanac.sun.rise.raw                                                                                   
#set $yesterday_dayluminosity = $almanac($almanac_time=$yesterday).sun.set.raw - $almanac($almanac_time=$yesterday).sun.rise.raw                            
#set $difference_pre = $today_dayluminosity - $yesterday_dayluminosity
#set $difference = $difference_pre//60
#set $seconds = $almanac.sun.set.raw - $almanac.sun.rise.raw
#set $hours = $seconds //3600
#set $seconds %= 3600
#set $minutes = $seconds//60
#set $seconds %= 60
#set $dayluminosity_str = "%d hours, %d minutes, %d seconds" % ($hours, $minutes, $seconds)                                                                 
#set $difference = $today_dayluminosity - $yesterday_dayluminosity
#if $difference
    #set $delta = abs($difference)
    #set $amt_str = "%s%d seconds" % (str(int($delta) // 60) + ' minutes, ' if ($delta // 60) > 0 else '', $delta % 60 if ($delta // 60) > 0 else $delta)
    #if $difference > 0
        #set $delta_str = "%s more than yesterday" % $amt_str
    #else
        #set $delta_str = "%s less than yesterday" % $amt_str
    #end if
    #set $dayluminosity_str = "%s" % ($dayluminosity_str)
#end if

Then place something similar to this in the Sun "card" and tweak:

<h6 class="h6-responsive $Extras.color-text"> Today's Total Luminosity</h6>
<div class="row">
    <div class="col">
        $dayluminosity_str ($delta_str)
    </div>
</div>

Thanks yet again @W0CHP! I’ve added it in and reformatted the sun and moon tables, looks great. Edit re the last new and full moon,, I was using last_new_moon and last_full_moon instead of previous. https://www.360shetland.co.uk/weather/almanac.html

@W0CHP
Copy link

W0CHP commented Nov 7, 2022

Thanks yet again @W0CHP! I’ve added it in and reformatted the sun and moon tables, looks great. Edit re the last new and full moon,, I was using last_new_moon and last_full_moon instead of previous. https://www.360shetland.co.uk/weather/almanac.html

My pleasure. Your site is looking amazing, @Pogs2004!

Q: I noticed your history/stats are leveraging what looks the more modern and responsive flexbox (or grid)? If so, I would recommend either doing a PR or posting the code for someone to do a PR to make the report more responsive by default.

@W0CHP
Copy link

W0CHP commented Nov 7, 2022

Question: as there is not much actitity in that repo... do we want to create a fork to continue working on improvements? Either my fork (https://github.com/seehase/neowx-material/tree/master) or any other I like to contribute in this skin

Yeah @seehase, this repo hasn't moved since 2021 (even PR's). I'd be OK with using and contributing to your (more "living") fork. If @neoground wants to pull all the changes in at a later date, it can always be done.

@Pogs2004
Copy link

Pogs2004 commented Nov 9, 2022

My pleasure. Your site is looking amazing, @Pogs2004!

Q: I noticed your history/stats are leveraging what looks the more modern and responsive flexbox (or grid)? If so, I would recommend either doing a PR or posting the code for someone to do a PR to make the report more responsive by default.

Thanks @W0CHP! I am still playing around with the layout for the stats, unfortunately although it looks good on desktop and tablet it is a bit broken on small screens unless they are turned landscape. Even then, the max rain is a bit messy. If I use a fully flex container it looks good on small screens but stretched the full width of the viewport on desktop and tablet.

I'm thinking to use a bit of code to determine the viewport size then use an appropriate container, I have done this for my own business website.

As soon as I'm happy I'll post it up here

@W0CHP
Copy link

W0CHP commented Nov 10, 2022

Thanks @W0CHP! I am still playing around with the layout for the stats, unfortunately although it looks good on desktop and tablet it is a bit broken on small screens unless they are turned landscape. Even then, the max rain is a bit messy. If I use a fully flex container it looks good on small screens but stretched the full width of the viewport on desktop and tablet.

I'm thinking to use a bit of code to determine the viewport size then use an appropriate container, I have done this for my own business website.

As soon as I'm happy I'll post it up here

Sounds good, mate. You got talent, and it would be beneficial for @seehase 's fork! 👍

@danitus13
Copy link

Grazie@W0CHP! Sto ancora giocando con il layout per le statistiche, sfortunatamente anche se sembra buono su desktop e tablet è un po' rotto su piccoli schermi a meno che non siano trasformati in orizzontale. Anche allora, la pioggia massima è un po' disordinata. Se utilizzo un contenitore completamente flessibile, sembra buono su schermi piccoli ma si estende per l'intera larghezza del viewport su desktop e tablet.
Sto pensando di utilizzare un po 'di codice per determinare la dimensione del viewport, quindi utilizzare un contenitore appropriato, l'ho fatto per il mio sito Web aziendale.
Appena sarò felice lo posterò qui

Suona bene, amico. Hai talento e sarebbe utile per@seehasela forchetta!👍

I'm trying to make a graph for cumulative evapotranspiration, can anyone help me? Thank you

#73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants