Finally.

On Thursday, April 11, 2019 at 7:45:52 PM UTC-3, HoracioDos wrote:
>
> Thank you very much! It works fine now! I don't know why I didn't tried 
> any of these aggregation types before for $hours when I've been using them 
> for $day all day long.
>
> On Thursday, April 11, 2019 at 7:32:44 PM UTC-3, Thomas Keffer wrote:
>>
>> Oops. My mistake. The tag $hour represents an *aggregation* over an 
>> hour. You must specify the type of aggregation. The list of aggregations is 
>> given in an appendix 
>> <http://weewx.com/docs/customizing.htm#aggregation_types> to the 
>> Customizing Guide. You probably want "last" or "avg".
>>
>> So, the full tag becomes, for example, $hour.outTemp.last.raw.
>>
>> On Thu, Apr 11, 2019 at 3:23 PM HoracioDos <rose...@gmail.com> wrote:
>>
>>> Hello Tom.
>>> Thanks for your answer. I've already tried that and it doesn't work. I 
>>> get this error:
>>> Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: Generate failed 
>>> with exception '<class 'weewx.ViolatedPrecondition'>'
>>> Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: **** Ignoring 
>>> template /etc/weewx/skins/Belchertown/stats/stats-YYYY-MM.txt.tmpl
>>> Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: **** Reason: 
>>> Invalid aggregation type 'raw'
>>>
>>> I've attached a larger log with debug level = 1
>>>
>>>
>>> On Thursday, April 11, 2019 at 5:47:44 PM UTC-3, Thomas Keffer wrote:
>>>>
>>>> You need $hour.outTemp.raw, not $hour.outTemp. The latter actually 
>>>> returns a "ValueHelper" object, which is ignorant of any comparison 
>>>> operators.
>>>>
>>>> Incidentally, every tag $hour.outTemp involves a database lookup. You 
>>>> could be looking at 100 for each day. A simple speed up is to an 
>>>> intermediate, temporary variable:
>>>>
>>>> #set $hourTemp=$hour.outTemp.raw
>>>> #if hourTemp >= 30
>>>>   $set $VeryHotCount +=1
>>>>
>>>> etc.
>>>>
>>>>
>>>> On Thu, Apr 11, 2019 at 12:43 PM HoracioDos <rose...@gmail.com> wrote:
>>>>
>>>>> Hello
>>>>> I'm writing my own stats template like NOAA text files. I defined a 
>>>>> four values temperature range and I want to count all hours in a month 
>>>>> according to its range. Final objetive is to create a monthly heatmap.
>>>>> As aggregation types min/max_le/ge work with a day period or longer. I 
>>>>> made a cycle for the hours in each day for a month and evaluated the 
>>>>> temperature for each hour according to a range. There is a counter for 
>>>>> each 
>>>>> range value that I want to report. 
>>>>> I can't make it work and I can't see $hour.outTemp value. What am I 
>>>>> doing wrong? I've attached the template and its output.
>>>>> Thanks in advance 
>>>>>
>>>>> -- 
>>>>> 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.
>>>>> 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...@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.

Reply via email to