cheetah with historical data

107 views
Skip to first unread message

jschoonh

unread,
Dec 1, 2023, 12:19:30 PM12/1/23
to weewx-user

 a question about the cheetah generator
currently I display historical data per month in a thermometer form.
To get the data i use i line in the the cheetah generator (as an example) “$month($months_ago=11).outTemp.max.format(add_label=False,”
but is it possible to give an absolute date for example, the 12th month in 2022, something like $month(12,2022). I know this is wrong, but is there something I can use like this?

Here a example for the current year
https://schooot.nl/php/maande.php
Displayed in the page https://schooot.nl/weereng.php

Tom Keffer

unread,
Dec 1, 2023, 4:39:25 PM12/1/23
to weewx...@googlegroups.com
Sorry, there is no way to do that. But, it would be a good addition.

--
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/00c6ad98-2a53-4ec6-a06e-85f3e412b2bbn%40googlegroups.com.

jschoonh

unread,
Dec 1, 2023, 4:45:27 PM12/1/23
to weewx-user
Too bad, but thanks for your answer.
Then I have a challenge, which is also fun

Op vrijdag 1 december 2023 om 22:39:25 UTC+1 schreef Tom Keffer:

Tom Keffer

unread,
Dec 1, 2023, 4:59:53 PM12/1/23
to weewx...@googlegroups.com
If you're serious, start a branch off of V5, then work on the file weewx/tags.py. Look at function TimeBinder.month(). Add an appropriate argument. Perhaps structure it as a 2-way tuple (year, month). Use your experience from writing a historical data template to decide what would be convenient and general. Choose a good name for it. Then implement, then create a Pull Request and I'll take a look.

If it all looks good, documentation and tests would have to follow.

Way too late for V5, but there will inevitably be a V5.1!


jschoonh

unread,
Dec 2, 2023, 4:08:34 AM12/2/23
to weewx-user
Definitely a challenge, perhaps a bit too ambitious for me. I am an old man, very familiar with PHP, HTML, CSS, etc. Since Weewx, the basics of Python (still learning) My site does not use templates from Weewx. It is a general site with some weather pages. Responsive purely with HTML/CSS. The weather data is sent in small files to the web server which I then "build" the instruments and data with.
I am currently away from home and have limited resources. As soon as I get home (January) I definitely want to look at it, but nu rush, see what I can acomplish.

Op vrijdag 1 december 2023 om 22:59:53 UTC+1 schreef Tom Keffer:
Reply all
Reply to author
Forward
0 new messages