Add daylight hours in almanac data for Standard skin

99 views
Skip to first unread message

bgra...@umw.edu

unread,
Dec 27, 2022, 4:39:41 PM12/27/22
to weewx-user
Hello,
I'm sure this is a simple problem but, not being a programmer, I'm confused on how to proceed.
In the Seasons skin, the "celestial" link gives the following data:
   Total daylight     9 hours, 34 minutes, 40 seconds
   0 minutes, 11 seconds more than yesterday

I would like to add this data to the "almanac" data in my Standard skin but don't know how. Since the Seasons skin is not selected in weewx.conf then I imagine some files need to be moved and activated.

Could someone please point me in the correct direction? Thanks
Cheers,
Bob

vince

unread,
Dec 27, 2022, 5:06:07 PM12/27/22
to weewx-user
Same as editing any other skin.

Copy the 4-line snippet for that info from the seasons.inc file in the Seasons skin and insert it where you want it in the .tmpl file(s) you want the info added to in the Standard skin.  Which file(s) you need to edit depends on which day/week/month/year file(s) you want to see the added stuff added to.

Save copies of your original files just in case.  If you typo your edits it is 'very' hard to figure out which line(s) you typo'd.

vince

unread,
Dec 27, 2022, 5:08:07 PM12/27/22
to weewx-user
oops - that's celestial.inc in the Seasons skin of course.  Sorry.

vince

unread,
Dec 28, 2022, 1:40:39 PM12/28/22
to weewx-user
Update for others who might want to do this too...
 
It's a one-liner to add to index.html in the right spot to #include a modified variant of the Seasons celestial.inc starting point.

Screenshot 2022-12-28 at 9.58.01 AM.png

Add the attached "standard_celestial.inc" file to your skins/Standard directory.
Then insert the #include line after line 105 in index.html.tmpl ala the following excerpt:

              <tr>
                <td class="stats_label">$obs.label.radiation</td>
                <td class="stats_data">$current.radiation</td>
              </tr>
              #end if

              ## add total daylight information
              #include "standard_celestial.inc"


            </tbody>
          </table>
        </div>

        <p>&nbsp;</p>

        <div class="stats">
          <div class="stats_header">
            $gettext("Since Midnight")
          </div>
standard_celestial.inc

bgra...@umw.edu

unread,
Dec 28, 2022, 4:49:24 PM12/28/22
to weewx-user
Great, Vince, that’s perfect for what I need! Something positive on the weather page…
Many thanks and much appreciated!
Bob

Reply all
Reply to author
Forward
0 new messages