Re: [weewx-user] Formatting stats.py extension

2020-03-16 Thread Mike Revitt
That works perfectly thanks Thomas, now I just need to get the cron job 
working properly

On Monday, March 16, 2020 at 3:13:26 PM UTC, Thomas Keffer wrote:
>
> For this to work, you would need to specify your new 'contexts' in the 
> constructor to TimespanBinder. Something like this (NOT TESTED):
>
> # 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_stats = TimespanBinder(timespan,
>db_lookup,
>context='alltime',
>formatter=self.generator.formatter,
>converter=self.generator.converter,
>skin_dict=self.generator.skin_dict) 
>   # 4
>
> See if that helps.
>
> -tk
>
>
>
> On Mon, Mar 16, 2020 at 7:35 AM Mike Revitt  > wrote:
>
>> I am successfully running the stats.py extension as detailed here 
>> http://www.weewx.com/docs/customizing.htm#defining_new_tags and am now 
>> trying to format the output.
>>
>>
>> The output is displayed in statistics.html using the syntax shown below
>>
>> 
>> 
>> Maximum temperature to date: 
>> $alltime.outTemp.max
>> 
>> 
>> Minimum temperature to date: 
>> $alltime.outTemp.min
>> 
>> 
>> Rain over the last seven days: 
>> $seven_day.rain.sum
>> 
>> 
>>
>> and I created 2 new tags in weewx.conf expecting this to change the 
>> format as shown below
>>
>> TimeFormats
>> 
>> hour= %H:%M
>> day = %H:%M
>> seven_day   = %H:%M on %a
>> week= %H:%M on %a
>> month   = %a %d %H:%M
>> year= %a %d-%b %H:%M
>> rainyear= %d-%b-%Y %H:%M
>> alltime = %A %d-%b-%Y %H:%M
>> current = %a %d-%b-%Y %H:%M
>> ephem_day   = %H:%M
>> ephem_year  = %d-%b-%Y %H:%M
>>
>>
>> However whilst the day, week and year tags are being used seven_day and 
>> alltime are being ignored. The output that is using used is the current 
>> format.
>>
>> Anyone know what I am doing wrong?
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/9ec3620f-4154-4506-9194-4b880a318776%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a33769e7-a403-411b-98f4-24cb60b26da6%40googlegroups.com.


Re: [weewx-user] Formatting stats.py extension

2020-03-16 Thread Thomas Keffer
For this to work, you would need to specify your new 'contexts' in the
constructor to TimespanBinder. Something like this (NOT TESTED):

# 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_stats = TimespanBinder(timespan,
   db_lookup,
   context='alltime',
   formatter=self.generator.formatter,
   converter=self.generator.converter,
   skin_dict=self.generator.skin_dict)
  # 4

See if that helps.

-tk



On Mon, Mar 16, 2020 at 7:35 AM Mike Revitt  wrote:

> I am successfully running the stats.py extension as detailed here
> http://www.weewx.com/docs/customizing.htm#defining_new_tags and am now
> trying to format the output.
>
>
> The output is displayed in statistics.html using the syntax shown below
>
> 
> 
> Maximum temperature to date: 
> $alltime.outTemp.max
> 
> 
> Minimum temperature to date: 
> $alltime.outTemp.min
> 
> 
> Rain over the last seven days: 
> $seven_day.rain.sum
> 
> 
>
> and I created 2 new tags in weewx.conf expecting this to change the format
> as shown below
>
> TimeFormats
>
> hour= %H:%M
> day = %H:%M
> seven_day   = %H:%M on %a
> week= %H:%M on %a
> month   = %a %d %H:%M
> year= %a %d-%b %H:%M
> rainyear= %d-%b-%Y %H:%M
> alltime = %A %d-%b-%Y %H:%M
> current = %a %d-%b-%Y %H:%M
> ephem_day   = %H:%M
> ephem_year  = %d-%b-%Y %H:%M
>
>
> However whilst the day, week and year tags are being used seven_day and
> alltime are being ignored. The output that is using used is the current
> format.
>
> Anyone know what I am doing wrong?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/9ec3620f-4154-4506-9194-4b880a318776%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEDB-97YoE6Y641k_Bw-Y7q%3DPuQPPNPCUaQcRbm0Yabb2Q%40mail.gmail.com.


[weewx-user] Formatting stats.py extension

2020-03-16 Thread Mike Revitt
I am successfully running the stats.py extension as detailed 
here http://www.weewx.com/docs/customizing.htm#defining_new_tags and am now 
trying to format the output.


The output is displayed in statistics.html using the syntax shown below



Maximum temperature to date: 
$alltime.outTemp.max


Minimum temperature to date: 
$alltime.outTemp.min


Rain over the last seven days: 
$seven_day.rain.sum



and I created 2 new tags in weewx.conf expecting this to change the format 
as shown below

TimeFormats

hour= %H:%M
day = %H:%M
seven_day   = %H:%M on %a
week= %H:%M on %a
month   = %a %d %H:%M
year= %a %d-%b %H:%M
rainyear= %d-%b-%Y %H:%M
alltime = %A %d-%b-%Y %H:%M
current = %a %d-%b-%Y %H:%M
ephem_day   = %H:%M
ephem_year  = %d-%b-%Y %H:%M


However whilst the day, week and year tags are being used seven_day and 
alltime are being ignored. The output that is using used is the current 
format.

Anyone know what I am doing wrong?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/9ec3620f-4154-4506-9194-4b880a318776%40googlegroups.com.