Sunshine Hours

324 vues
Accéder directement au premier message non lu

Kalli

non lue,
26 oct. 2020, 13:16:2326/10/2020
à weewx-user

Hello i have weewx-wd. in FreshWDL the sun is displayed. unfortunately i can't find any settings for it at weewx. Can anybody help me further.

gjr80

non lue,
26 oct. 2020, 22:55:2226/10/2020
à weewx-user
Hallo Kalli,

The short answer is at the moment sunshine hours is not provided by WeeWX or WeeWX-WD. Looking at the WeeWX-WD code it appears to be something I started working on but never fully implemented. Can you let me know hat version of WeeWX and WeeWX-WD you are running. It should be a simple function to implement.

Gary

Tom Keffer

non lue,
27 oct. 2020, 08:25:3427/10/2020
à weewx-user
The Seasons skin has something you can use. Look in the file celestial.inc. 

If you just want amount of daylight, try something like (NOT TESTED):

#set $sunrise_ts = $almanac.sun.rise.raw
#set $sunset_ts = $almanac.sun.set.raw
#if $sunrise_ts and $sunset_ts

    #set $today_daylight = $sunset_ts -  $sunrise_ts
    #set $seconds = $today_daylight
    #set $hours = $seconds //3600
    #set $seconds %= 3600
    #set $minutes = $seconds//60
    #set $seconds %= 60
    #set $daylight_str = "%d hours, %d minutes, %d seconds" % ($hours, $minutes, $seconds)

    <p>Total daylight: $daylight_str</p>

#end if

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/884f712b-74c8-4bd4-8655-74610e4f94dcn%40googlegroups.com.

gjr80

non lue,
27 oct. 2020, 08:39:0527/10/2020
à weewx-user
Tom,

I suspect that in this case FreshWDL is displaying sunshine hours as measured by a sunshine recorder. Some PWS software approximates sunshine hours by calculating the cumulative time for a day where the solar irradiance is above a given level. From memory the measurement of sunshine hours has come up a couple of times here or in weewx-development.

Gary

Tom Keffer

non lue,
27 oct. 2020, 08:40:3927/10/2020
à weewx-user

Kalli

non lue,
27 oct. 2020, 11:52:3027/10/2020
à weewx-user
Gir80 I have the weewx 3.8 weewx wd v1.3

gjr80

non lue,
27 oct. 2020, 17:39:1727/10/2020
à weewx-user
Thanks Kalli, I will put something together and email you.

Gary

Kalli

non lue,
1 nov. 2020, 08:26:0701/11/2020
à weewx-user
Hello Gir80
I'm curious what you're doing great again.

cu.Kalli

gjr80

non lue,
1 nov. 2020, 17:26:4201/11/2020
à weewx-user
Hi Kalli,

Have written the code but just sorting out a couple of unrelated issues that are causing problems under WeeWX v3.8.0. Won't be long.

Gary

gjr80

non lue,
1 nov. 2020, 23:10:5601/11/2020
à weewx-user
Kalli,

I've added an approximation for sunshine time to WeeWX-WD. The algorithm involves calculating the elapsed time in seconds for which the WeeWX field 'radiation' is above a set threshold level and storing this time in field 'sunshine' in the WeeWX-WD database weewxwd.sdb. The default threshold level is 120 W/m2, but can be adjusted using the sunshine_threshold config item under the [Weewx-WD] stanza in weewx.conf. So in an archive record if radiation is above the threshold value the sunshine field will be set to the interval (in seconds) covered by the archive record. So if your archive interval is set to 300, field sunshine in that archive record would contain 300, if radiation was below the threshold value then field sunshine will be 0. Field sunshine is not added to loop packets, only archive records.

You can then use field sunshine in report tags just like other WeeWX fields, though you will need to set the binding for each tag. For example, the sunshine time for today would be:

$day($data_binding='wd_binding').sunshine.sum

I have also populated the sunshine hour tags in testtags.php, so any sites/apps that use sunshine hours from testtags.php should now display data. I am not sure what FreshWDL uses, let's get WeeWX-WD working properly with sunshine then we can come back to FreshWDL if necessary.

Unfortunately you are going to have to upgrade to WeeWX-WD v2.1.0, adding 'sunshine' to a WeeWX-WD v1.x version was more work than I was prepared to do. The upgrade process is straight forward and I have detailed the steps below.

To upgrade WeeWX-WD v1.x to v2.1.0 (the following steps are based on you having a package install rather than a setup.py install, if you have a setup.py install let me know and I will provide appropriate instructions):

1. download the v2.1.0 extension package:

$ wget -P /var/tmp https://github.com/gjr80/weewx-weewx-wd/releases/download/v2.1.0/weewxwd-2.1.0.tar.gz

2. stop WeeWX and backup your WeeWX and WeeWX-WD databases:

$ sudo cp /var/lib/weewx/weewx.sdb /var/lib/weewx/weewx_backup.sdb
$ sudo cp /var/lib/weewx/weewxwd.sdb /var/lib/weewx/weewxwd_backup.sdb


3. install v2.1.0:

$ sudo wee_extension --install=/var/tmp/weewxwd-2.1.0.tar.gz

4. remove some v1.x residue that the installer cannot remove:

$ sudo rm -R /etc/weewx/skins/SteelGauges
$ sudo rm /usr/share/weewx/user/imageStackedWindRose3.py*
$ sudo rm /usr/share/weewx/user/wd_database
$ sudo rm /usr/share/weewx/user/wdAstroSearchX3.py*
$ sudo rm /usr/share/weewx/user/wdSearchX3.py*
$ sudo rm /usr/share/weewx/user/wdTaggedStats3.py*
$ sudo rm /usr/share/weewx/user/weewxwd3.py*


5. edit weewx.conf and make the following changes:

- under [StdReport] delete the [[wdSteelGauges]] stanza in full
- under [DataBindings] [[wd_binding]] change:

    schema = user.weewxwd3.schema

    to

    schema = user.wdschema.weewxwd_schema

- under [Engine] [[Services]] delete the user.weewxwd3.WdWXCalculate entry from process_services
- under [Engine] [[Services]] delete user.weewxwd3.WdArchive from archive_services

WeeWX-WD will now add a field 'sunshine' to each archive record but it will not be saved to database (whilst the WeeWX-WD database schema now includes field 'sunshine' your WeeWX-WD database will not include field 'sunshine' as the database was created using the old WeeWX-WD schema). To add field sunshine to the WeeWX-WD database:

1. use the utility wee_database to create a new copy WeeWX-WD database with the new schema and populate it with data from the old WeeWX-WD database:

$ sudo wee_database /etc/weewx/weewx.conf --reconfigure --binding=wd_binding

2. you will now have a new WeeWX-WD database named weewxwd.sdb_new that includes field sunshine, you now need to swap your old WeeWX-WD database for this new database:

$ sudo mv /var/lib/weewx/weewxwd.sdb /var/lib/weewx/weewxwd_orig.sdb
$ sudo mv /var/lib/weewx/weewxwd.sdb_new /var/lib/weewx/weewxwd.sdb

3. the daily summaries in the new database should be rebuilt on the next WeeWX startup but let's do it manually to make sure:

$ sudo wee_database /etc/weewx/weewx.conf --binding=wd_binding --rebuild-daily

You should now be able to restart WeeWX and WeeWX-WD will populate field sunshine in the WeeWX-WD database and the sunshine hours fields in testtags.php should also be populated.

Gary

Xant

non lue,
2 nov. 2020, 14:41:4102/11/2020
à weewx-user

A VERY SIMPLIFIED note for those that may consider an easy visual approach regarding solar rad...

Through Belchertown skin, I plot Theoretical Radiation at same plot of Out-Temp, this giving an easy visual of "day/night vs temp".



To note that this approach also serve those which PWS does not have Solar Rad sensors, as Theoretical Max Rad is a WeeWX Calculation.

Xant

d k

non lue,
3 nov. 2020, 14:10:4303/11/2020
à weewx-user
Gary, awesome work. Thanks for taking the time. I wonder how this compares with the work of that gentleman you cited a while ago.

karl Lutz

non lue,
7 nov. 2020, 02:13:1807/11/2020
à weewx...@googlegroups.com
Hello
i made the change.
but with WD-Live only the primeval time is displayed.
please take a look.

http://wetter-uerdingen.de/
 
cu. Kalli
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/7WiiU9J26e4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/28ed7084-b28f-4011-9129-b413ebe19bd9n%40googlegroups.com.

Kalli

non lue,
7 nov. 2020, 09:12:0507/11/2020
à weewx-user
Hello
Gir80
data is written into the Sunshine data field.
but we now get the data in the Clientrawextra.txt
at position 696.

cu. kalli

gjr80

non lue,
10 nov. 2020, 21:30:0110/11/2020
à weewx-user
Hi Kalli,

Not sure how I missed clientrawextra. I've updated the template and it should be correct now. To use the updated template:

1. move aside your existing clientrawextra.txt.tmpl:

$ sudo mv /etc/weewx/skins/Clientraw/clientrawextra.txt.tmpl /etc/weewx/skins/Clientraw/clientrawextra_orig.txt.tmpl

2. download the updated clientrawextra.txt.tmpl in its place:


3. No need to stop/restart WeeWX, the updated clientrawextra.txt will be generated when clientrawextra.txt is next updated(there is a default 10 minute stale age on the file so it could take 10 minutes).

Gary

karl Lutz

non lue,
11 nov. 2020, 11:41:5711/11/2020
à weewx...@googlegroups.com
Great you are the best
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/7WiiU9J26e4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message