Building on Belchertown reports/index.html.tmpl

118 views
Skip to first unread message

Lewis McCallum

unread,
Oct 22, 2020, 6:16:10 PM10/22/20
to weewx-user
Hi all,

So I'm loving the Belchertown skin, but thought the "Records" section of the template a bit sparse, and I've been trying to extend it to hold lots of info.

I know that you can add to reports.inc and reports-table.inc but what I'm doing is more of a complete rework of the table building index.html template. 

It's going OK so far, but I'm a bit stuck on extending the "Rainiest day" and "days with/without rain" record to shorter timescales. Also min and max temp range.

I'm having difficulties because the built-in tags for calculating these don't seem to be standard weewx observation/tag names.

Does anyone know anything about the following tags:

$year_outTemp_range_max (appears to be an array)

$rainiest_day (also an array?)

$year_days_without_rain (actually all of these are arrays)


I can't find anything about what these are/where they came from/how they are used. Can anyone lend a hand to help me get and use the shorter time_length versions of these?

for context - meikleobney.net/records (to give an idea of what I'm trying to do)

Also while I'm at it, where are the "record-header-*" tags defined? I'd like to add some more.

Cheers and sorry if dumb questions,


Lewis


PS: Deb installed weewx on RPi


 

Lewis McCallum

unread,
Oct 23, 2020, 3:48:46 AM10/23/20
to weewx-user
Ok so for my add-on question, I found the "records-header" classes in the style.css file. So all good there.

 But still none the wiser on the tags that are actually arrays.

Lewis

Arend

unread,
Oct 23, 2020, 10:24:38 AM10/23/20
to weewx-user
Hi Lewis,

Nice add-on to Belchertown skin you are working on. When finished would you consider sharing this add-on?
The code you are looking for is in belchertwown.py: https://github.com/poblabs/weewx-belchertown/blob/master/bin/user/belchertown.py and is part of the search list extension. Look for "Build the all time stats." in this file.

Regards, Arend

Op vrijdag 23 oktober 2020 om 09:48:46 UTC+2 schreef lewism...@gmail.com:

Lewis McCallum

unread,
Oct 23, 2020, 10:35:50 AM10/23/20
to weewx...@googlegroups.com
Hi Arend,

I actually found that file in my lunch break today. Super useful to have the actual Belchertown code and I should be able to finishing populating my table with that now!

When I’m done and prettied up the new records page a bit I’ll pass on the new records.html.tmpl (along with the modified .py file and likely will need to update style.css). 

Another thing that Im unsure/concerned about is that I’m making all these modifications to various files (.html.tmpl files and now one of the .py files), and I worry that I’ll lose my modifications when time comes to update Belchertown. How do I safeguard against that? Will I have to back up my modified files and then go back in after the update and add the modifications back in? Feels like it could turn into a lot of work. Also feels like a lot of files to need to pass on to anyone wanting to use whatever I’ve made. Is there a better way of doing this than just going in and editing the .py/.html.tmpl/.css files?

Cheers,

Lewis 


--
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/dbo9J5GI8mI/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/55ed49be-8419-4ee2-b01b-feea8cae3a72n%40googlegroups.com.

Arend

unread,
Oct 23, 2020, 10:53:57 AM10/23/20
to weewx-user
Using fork and clone on Github you can create a repository to save the changes. If you are willing to share, you can create a pull request to Belchertown repository. If Pat likes your add-on he may consider adding it to the master.

Op vrijdag 23 oktober 2020 om 16:35:50 UTC+2 schreef lewism...@gmail.com:

Lewis McCallum

unread,
Oct 23, 2020, 11:09:18 AM10/23/20
to weewx...@googlegroups.com
It’s actually about time I learned how to use GitHub beyond just downloading and editing locally. Cheers for the advice I’ll get finishing my table and go figure out the GitHub stuff also. 

Reply all
Reply to author
Forward
0 new messages