Re: [weewx-user] Re: Adding archive data to daily report

2018-04-27 Thread Thomas Carlin
Hey Martin,
Thank you for your interest!  I don't know if I mentioned it here, but even
cooler than that IMHO, the color scale on all the charts is dynamic, and
will adjust as the range does. The font colors also change dynamically for
better visibility.

For the record, I am not a python programmer by any means, everything I
know is self inflicted, and I am nearly positive that there is a better way
to do everything that I have done here, which is why I haven't submitted
these changes to GitHub for peer analysis, and integration.  Working with
someone else's code and modifying it to work for your needs is difficult,
and not always effective.  When I have time in the next few days, I will
try to pull the code off my machine and post it, with some basic direction,
but the support that I provide will be limited.  If anyone from FuzzyArcher
sees this, I would be happy to submit it to GitHub.  I would hesitate to
say that this is a 'finished' product, but it works for my needs.  Thoughts
and recommendations are welcome!

On Fri, Apr 27, 2018 at 7:25 AM RothMa  wrote:

> Hello Thomas,
> I want to create my own skin for Weewx. My search on how to display
> historical data on the websites led me to
> https://github.com/brewster76/fuzzy-archer and
> https://github.com/weatherstorm/Sofaskin-CW9009. I also found this thread. 
> Thanks
> for the detailed explanations.
> Now I took some code from both Github projects and was able to integrate
> the historical tables in my site using the "historygenerator.py". I'm
> able to change HTML and CSS configurations, but I'm not good at programming
> Python.
> On your wonderful page you have a monthly summary on the right side of the
> tables and an annual overview below each table. Can you please show me
> how you've extended the historygenerator.py to create the Monthly Summary
> column and the Annual Summary row?
>
> thank you very much
> Best regards
> Martin
>
> --
> 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/FHuFLPrg_DE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> weewx-user+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thomas Carlin
970-401-3805

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Adding archive data to daily report

2018-04-27 Thread RothMa
Hello Thomas, 
I want to create my own skin for Weewx. My search on how to display 
historical data on the websites led me to 
https://github.com/brewster76/fuzzy-archer and 
https://github.com/weatherstorm/Sofaskin-CW9009. I also found this thread. 
Thanks 
for the detailed explanations.
Now I took some code from both Github projects and was able to integrate 
the historical tables in my site using the "historygenerator.py". I'm able 
to change HTML and CSS configurations, but I'm not good at programming 
Python.
On your wonderful page you have a monthly summary on the right side of the 
tables and an annual overview below each table. Can you please show me how 
you've extended the historygenerator.py to create the Monthly Summary 
column and the Annual Summary row?

thank you very much
Best regards
Martin

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Adding archive data to daily report

2018-03-31 Thread Thomas Carlin
Hi Chris,
Sorry it took so long, I started a new job a few weeks ago, and hobbies 
have taken a back seat!  Let me start by saying that all the information, 
and better descriptions of what is happening can be found in the Weewx 
Customization Guide that TK and the guys have put together.  
http://weewx.com/docs/customizing.htm

All of the back end is contained in one file, On my system 
\usr\share\weewx\user\ArchiveSearch.py  Look at Defining New Tags 
 in the docs, the 
similarities should be immediately apparent.  This then get's included in 
the search list extensions in skin.conf.  You can then include your new 
tags in your *.tmpl files, to be generated each time the generator runs. 

First the ArchiveSearch.py:  I removed most of the comments that are in the 
documentation for the sake of brevity.  It is worth noting that you may 
need to install python relativedelta on your system for this to work.

*import datetime*
*import time*
*from dateutil.relativedelta import relativedelta*

*from weewx.cheetahgenerator import SearchList*
*from weewx.tags import TimespanBinder*
*from weeutil.weeutil import TimeSpan*
*from weeutil.weeutil import archiveDaySpan*
*from weeutil.weeutil import archiveWeekSpan*
*from weeutil.weeutil import archiveMonthSpan*
*from weeutil.weeutil import archiveYearSpan*

*class ArchiveSearch(SearchList):  
   # 1*
*"""My search list extension"""*

*def __init__(self, generator):
   # 2*
*SearchList.__init__(self, generator)*

*def get_extension_list(self, timespan, db_lookup):
   # 3*
*"""Returns a search list extension with two additions.*

*Parameters:*
*  timespan: An instance of weeutil.weeutil.TimeSpan. This will*
*hold the start and stop times of the domain of *
*valid times.*

*  db_lookup: This is a function that, given a data binding*
* as its only parameter, will return a database manager*
* object.*


*"""*
*# First, create TimespanBinder object for all time. This one is 
easy*
*# because the object timespan already holds all valid times to be*
*# used in the report.*
*all_time = TimespanBinder(timespan, *
*   db_lookup,*
*   formatter=self.generator.formatter,*
*   converter=self.generator.converter,*
*  context="month")   # 4*

*# Now get a TimespanBinder object for the last seven days. This 
one we*
*# will have to calculate. First, calculate the time at midnight, 
seven*
*# days ago. The variable week_dt will be an instance of 
datetime.date.*
*today_last_year_dt = datetime.date.fromtimestamp(timespan.stop) - 
relativedelta(years=1)*

*# Convert it to unix epoch time:*
*today_last_year_ts = time.mktime(today_last_year_dt.timetuple())  
 # 6*



*today_last_year_time_span = archiveDaySpan(today_last_year_ts)*
*# Form a TimespanBinder object, using the time span we just*
*# calculated:*
*today_last_year= TimespanBinder(today_last_year_time_span,*
* db_lookup,*
*
 formatter=self.generator.formatter,*
*
 converter=self.generator.converter,*
* context="month") # 7*
*#Assembles this week last year*
*week_last_year_time_span = archiveWeekSpan(today_last_year_ts)*
*# Form a TimespanBinder object, using the time span we just*
*# calculated:*
*week_last_year= TimespanBinder(week_last_year_time_span,*
* db_lookup,*
*
 formatter=self.generator.formatter,*
*
 converter=self.generator.converter,*
* context="month") # 7*


*#Assembles this month last year.*
*month_last_year_time_span = archiveMonthSpan(today_last_year_ts)*
*# Form a TimespanBinder object, using the time span we just*
*# calculated:*
*month_last_year= TimespanBinder(month_last_year_time_span,*
* db_lookup,*
*
 formatter=self.generator.formatter,*
*
 converter=self.generator.converter,*
* context="month") # 7*

*#Assembles last year.*
*last_year_time_span = archiveYearSpan(today_last_year_ts)*
*# Form a TimespanBinder object, using the time span we just*
*# calculated:*
*last_year= 

Re: [weewx-user] Re: Adding archive data to daily report

2018-03-05 Thread Chris Alemany
The history cards are totally cool! Would love to see how you made them. 
Thanks for this!

On Monday, March 5, 2018 at 8:15:43 AM UTC-8, Thomas Carlin wrote:
>
> Hi Chris!
>
> Thank you for the kind words.  I did not make this available anywhere, but 
> I would be happy to post it here if you are interested.  Keep in mind that 
> I am not a programer by any stretch, but I haven't had any issues with it.  
> The really cool extension on the history tab I didn't write, but I 
> extensively modified it to auto-define the color scheme, and color the 
> fonts accurately so they don't get lost on the background.  The original 
> unmodified version is available here:  
> https://github.com/brewster76/fuzzy-archer/blob/master/bin/user/historygenerator.py,
>  
> and I am less confident in the modifications I made to it than the 
> historical summary cards, but I have debated submitting it to the author 
> for review anyway.  
>
> Let me know if you would like the History Cards, and I'll post some code.
>
>
> On Sunday, March 4, 2018 at 3:53:05 PM UTC-7, Chris Alemany wrote:
>>
>> Hi Thomas! 
>>
>> This is a great addition, love how you presented it on your website too.
>>
>> Do you have the extensions you made available to download anywhere?
>>
>> Thanks!
>> Chris
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Adding archive data to daily report

2018-03-04 Thread Chris Alemany
Hi Thomas! 

This is a great addition, love how you presented it on your website too.

Do you have the extensions you made available to download anywhere?

Thanks!
Chris

On Sunday, February 5, 2017 at 10:58:11 AM UTC-8, Thomas Carlin wrote:
>
> That did the trick.  Thanks again Tom
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Adding archive data to daily report

2017-02-05 Thread Thomas Carlin
That did the trick.  Thanks again Tom

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Adding archive data to daily report

2017-02-05 Thread Thomas Keffer
The initializer for the TimespanBinder object takes an argument 'context',
which is what formatting to use for time. The default is "current". Other
options are "hour", "day", "week", "month", "year", and "rainyear". Choose
one of those, depending on whether you are displaying an aggregate over a
day, week, etc.

-tk



On Sun, Feb 5, 2017 at 9:09 AM, Thomas Carlin 
wrote:

> Hopefully my last question for this project.  If you are interested in the
> progress, the link in my first post includes the added history sections.
>
> I have defined several new tags in examples/ArchiveSearch.py
> today_last_year
> week_last_year
> mont_last_year
> last_year
> last_year_to_date
>
> and those all work as expected.  I can use them in my templates, and they
> give me the data that I expect to see (More or less, today_... is off one
> day, the wrong direction to compensate for leap year last year, but that is
> beside the point) but when it comes to the date fields, mintime, maxtime,
> etc. they are displaying using the 'current'  format defined in
> [[TimeFormats]]  I tried adding each of my tags to the [[TimeFormats]]
> list, but had no success.
>
> Is there something that I missed in the docs that explains this?
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Adding archive data to daily report

2017-02-04 Thread Thomas Carlin
Thanks Tom, I knew it had to be there somewhere!

On Saturday, February 4, 2017 at 1:38:49 PM UTC-7, Tom Keffer wrote:
>
> http://weewx.com/docs/customizing.htm#wee_reports
>
> -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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Adding archive data to daily report

2017-02-04 Thread Thomas Keffer
http://weewx.com/docs/customizing.htm#wee_reports

-tk

On Sat, Feb 4, 2017 at 12:03 PM, Thomas Carlin 
wrote:

> I'm making pretty good progress on this, but it is slow going to
> troubleshoot my extension script since I have to wait for the Cheetah
> Generator to run.  Is there any way to run that process manually?
>
> Many thanks!
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.