Re: [weewx-user] Re: Cheetah for loop and data_binding

2018-09-27 Thread Thomas Keffer
Fixed in commit ba86c25
,
to appear in V3.9.

Thanks for your help!

-tk

On Wed, Sep 26, 2018 at 10:46 PM Mike Hawkins  wrote:

> Excellent ! That has solved the problem.
>
> Thank you very much
>
> Best regards
>
> Mike
>
>
> On Thursday, September 27, 2018 at 1:52:13 AM UTC+1, Thomas Keffer wrote:
>>
>> Try this one.
>>
>> -tk
>>
>> On Wed, Sep 26, 2018 at 3:28 PM Mike Hawkins  wrote:
>>
>>> Unfortunately your new tags.py did not fix my problem.
>>>
>>> If I put a simple print into the
>>>
>>> def records(self, data_binding=None):
>>> manager = self.db_lookup(data_binding)
>>> for record in manager.genBatchRecords(self.timespan.start,
>>> self.timespan.stop):
>>> yield CurrentObj(self.db_lookup, data_binding,
>>> record['dateTime'], self.formatter,
>>>  self.converter, record=record)
>>>
>>>
>>> routine, then it shows that data_binding is always None.  But I don't
>>> know how to work back up to find out where the data_binding gets lost.
>>>
>>> Regards
>>>
>>> Mike
>>>
>>>
>>>
>>>
>>> On Wednesday, September 26, 2018 at 1:19:12 AM UTC+1, Thomas Keffer
>>> wrote:

 This is a bug. Try this version of tags.py.

 To answer your other questions, there are a bunch of tests that use
 $day, as well as other tags. Look in
 bin/weewx/test/test_skins/StandardTest.

 The "context" used in the tags is for formatting. It's how it knows to
 format a day related time as hh:mm, but a month related time as hh:mm
 dd-MM. Nothing to do with databases.

 Let me know if this new tags.py solves your problem!

 -tk

 On Tue, Sep 25, 2018 at 4:31 PM mwall  wrote:

> tom and gary,
>
> do you know if there is a unit test for the $day tag (or any other
> tag, for that matter)?  i'm not finding anything.
>
> also, this looks suspect, but perhaps not relevant to this problem.
>  in tags.py i see this:
>
>
> def hour(self, data_binding=None, hours_ago=0):
>
> return
> TimespanBinder(weeutil.weeutil.archiveHoursAgoSpan(self.report_time,
> hours_ago=hours_ago),
>
>   self.db_lookup,
> data_binding=data_binding,
>
>   context='day',
> formatter=self.formatter, converter=self.converter,
>
>   **self.option_dict)
>
>
> should the context be 'hour' not 'day'?
>
> m
>
> --
> 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.
> 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+...@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.
>

-- 
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: Cheetah for loop and data_binding

2018-09-26 Thread Mike Hawkins
Excellent ! That has solved the problem.

Thank you very much

Best regards

Mike


On Thursday, September 27, 2018 at 1:52:13 AM UTC+1, Thomas Keffer wrote:
>
> Try this one.
>
> -tk
>
> On Wed, Sep 26, 2018 at 3:28 PM Mike Hawkins  > wrote:
>
>> Unfortunately your new tags.py did not fix my problem.
>>
>> If I put a simple print into the 
>>  
>> def records(self, data_binding=None):
>> manager = self.db_lookup(data_binding)
>> for record in manager.genBatchRecords(self.timespan.start, 
>> self.timespan.stop):
>> yield CurrentObj(self.db_lookup, data_binding, 
>> record['dateTime'], self.formatter,
>>  self.converter, record=record)
>>
>>
>> routine, then it shows that data_binding is always None.  But I don't 
>> know how to work back up to find out where the data_binding gets lost.
>>
>> Regards
>>
>> Mike
>>
>>
>>
>>
>> On Wednesday, September 26, 2018 at 1:19:12 AM UTC+1, Thomas Keffer wrote:
>>>
>>> This is a bug. Try this version of tags.py.
>>>
>>> To answer your other questions, there are a bunch of tests that use 
>>> $day, as well as other tags. Look in 
>>> bin/weewx/test/test_skins/StandardTest. 
>>>
>>> The "context" used in the tags is for formatting. It's how it knows to 
>>> format a day related time as hh:mm, but a month related time as hh:mm 
>>> dd-MM. Nothing to do with databases.
>>>
>>> Let me know if this new tags.py solves your problem!
>>>
>>> -tk
>>>
>>> On Tue, Sep 25, 2018 at 4:31 PM mwall  wrote:
>>>
 tom and gary,

 do you know if there is a unit test for the $day tag (or any other tag, 
 for that matter)?  i'm not finding anything.

 also, this looks suspect, but perhaps not relevant to this problem.  in 
 tags.py i see this:


 def hour(self, data_binding=None, hours_ago=0):

 return 
 TimespanBinder(weeutil.weeutil.archiveHoursAgoSpan(self.report_time, 
 hours_ago=hours_ago),

   self.db_lookup, 
 data_binding=data_binding,

   context='day', formatter=self.formatter, 
 converter=self.converter,

   **self.option_dict)


 should the context be 'hour' not 'day'?

 m

 -- 
 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.
 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+...@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: Cheetah for loop and data_binding

2018-09-26 Thread Thomas Keffer
Try this one.

-tk

On Wed, Sep 26, 2018 at 3:28 PM Mike Hawkins  wrote:

> Unfortunately your new tags.py did not fix my problem.
>
> If I put a simple print into the
>
> def records(self, data_binding=None):
> manager = self.db_lookup(data_binding)
> for record in manager.genBatchRecords(self.timespan.start,
> self.timespan.stop):
> yield CurrentObj(self.db_lookup, data_binding,
> record['dateTime'], self.formatter,
>  self.converter, record=record)
>
>
> routine, then it shows that data_binding is always None.  But I don't know
> how to work back up to find out where the data_binding gets lost.
>
> Regards
>
> Mike
>
>
>
>
> On Wednesday, September 26, 2018 at 1:19:12 AM UTC+1, Thomas Keffer wrote:
>>
>> This is a bug. Try this version of tags.py.
>>
>> To answer your other questions, there are a bunch of tests that use $day,
>> as well as other tags. Look in bin/weewx/test/test_skins/StandardTest.
>>
>> The "context" used in the tags is for formatting. It's how it knows to
>> format a day related time as hh:mm, but a month related time as hh:mm
>> dd-MM. Nothing to do with databases.
>>
>> Let me know if this new tags.py solves your problem!
>>
>> -tk
>>
>> On Tue, Sep 25, 2018 at 4:31 PM mwall  wrote:
>>
>>> tom and gary,
>>>
>>> do you know if there is a unit test for the $day tag (or any other tag,
>>> for that matter)?  i'm not finding anything.
>>>
>>> also, this looks suspect, but perhaps not relevant to this problem.  in
>>> tags.py i see this:
>>>
>>>
>>> def hour(self, data_binding=None, hours_ago=0):
>>>
>>> return
>>> TimespanBinder(weeutil.weeutil.archiveHoursAgoSpan(self.report_time,
>>> hours_ago=hours_ago),
>>>
>>>   self.db_lookup, data_binding=data_binding,
>>>
>>>   context='day', formatter=self.formatter,
>>> converter=self.converter,
>>>
>>>   **self.option_dict)
>>>
>>>
>>> should the context be 'hour' not 'day'?
>>>
>>> m
>>>
>>> --
>>> 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.
>>> 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.
>

-- 
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.
#
#Copyright (c) 2009-2015 Tom Keffer 
#
#See the file LICENSE.txt for your full rights.
#
"""Classes for implementing the weewx tag 'code' codes."""

import weeutil.weeutil
from weeutil.weeutil import to_int
import weewx.units
from weewx.units import ValueTuple

#===
#Class TimeBinder
#===

class TimeBinder(object):
"""Binds to a specific time. Can be queried for time attributes, such as month.

When a time period is given as an attribute to it, such as obj.month,
the next item in the chain is returned, in this case an instance of
TimespanBinder, which binds things to a timespan.
"""

def __init__(self, db_lookup, report_time,
 formatter=weewx.units.Formatter(), converter=weewx.units.Converter(), **option_dict):
"""Initialize an instance of DatabaseBinder.

db_lookup: A function with call signature db_lookup(data_binding), which
returns a database manager and where data_binding is an optional binding
name. If not given, then a default binding will be used.

report_time: The time for which the report should be run.

formatter: An instance of weewx.units.Formatter() holding the formatting
information to be used. [Optional. If not given, the default
Formatter will be used.]

converter: An instance of weewx.units.Converter() holding the target unit
information to be used. [Optional. If not given, the default
Converter will be used.]

option_dict: Other options which can be used to customize calculations.
[Optional.]
"""
self.db_lookup= db_lookup
self.report_time  = report_time
self.formatter= formatter
self.converter= converter
self.option_dict  = option_dict

# What follows is the list of time period attributes:

def trend(self, 

Re: [weewx-user] Re: Cheetah for loop and data_binding

2018-09-26 Thread Mike Hawkins
Unfortunately your new tags.py did not fix my problem.

If I put a simple print into the 
 
def records(self, data_binding=None):
manager = self.db_lookup(data_binding)
for record in manager.genBatchRecords(self.timespan.start, 
self.timespan.stop):
yield CurrentObj(self.db_lookup, data_binding, 
record['dateTime'], self.formatter,
 self.converter, record=record)


routine, then it shows that data_binding is always None.  But I don't know 
how to work back up to find out where the data_binding gets lost.

Regards

Mike




On Wednesday, September 26, 2018 at 1:19:12 AM UTC+1, Thomas Keffer wrote:
>
> This is a bug. Try this version of tags.py.
>
> To answer your other questions, there are a bunch of tests that use $day, 
> as well as other tags. Look in bin/weewx/test/test_skins/StandardTest. 
>
> The "context" used in the tags is for formatting. It's how it knows to 
> format a day related time as hh:mm, but a month related time as hh:mm 
> dd-MM. Nothing to do with databases.
>
> Let me know if this new tags.py solves your problem!
>
> -tk
>
> On Tue, Sep 25, 2018 at 4:31 PM mwall > 
> wrote:
>
>> tom and gary,
>>
>> do you know if there is a unit test for the $day tag (or any other tag, 
>> for that matter)?  i'm not finding anything.
>>
>> also, this looks suspect, but perhaps not relevant to this problem.  in 
>> tags.py i see this:
>>
>>
>> def hour(self, data_binding=None, hours_ago=0):
>>
>> return 
>> TimespanBinder(weeutil.weeutil.archiveHoursAgoSpan(self.report_time, 
>> hours_ago=hours_ago),
>>
>>   self.db_lookup, data_binding=data_binding,
>>
>>   context='day', formatter=self.formatter, 
>> converter=self.converter,
>>
>>   **self.option_dict)
>>
>>
>> should the context be 'hour' not 'day'?
>>
>> m
>>
>> -- 
>> 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 .
>> 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: Cheetah for loop and data_binding

2018-09-25 Thread Thomas Keffer
This is a bug. Try this version of tags.py.

To answer your other questions, there are a bunch of tests that use $day,
as well as other tags. Look in bin/weewx/test/test_skins/StandardTest.

The "context" used in the tags is for formatting. It's how it knows to
format a day related time as hh:mm, but a month related time as hh:mm
dd-MM. Nothing to do with databases.

Let me know if this new tags.py solves your problem!

-tk

On Tue, Sep 25, 2018 at 4:31 PM mwall  wrote:

> tom and gary,
>
> do you know if there is a unit test for the $day tag (or any other tag,
> for that matter)?  i'm not finding anything.
>
> also, this looks suspect, but perhaps not relevant to this problem.  in
> tags.py i see this:
>
>
> def hour(self, data_binding=None, hours_ago=0):
>
> return
> TimespanBinder(weeutil.weeutil.archiveHoursAgoSpan(self.report_time,
> hours_ago=hours_ago),
>
>   self.db_lookup, data_binding=data_binding,
>
>   context='day', formatter=self.formatter,
> converter=self.converter,
>
>   **self.option_dict)
>
>
> should the context be 'hour' not 'day'?
>
> m
>
> --
> 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.
#
#Copyright (c) 2009-2015 Tom Keffer 
#
#See the file LICENSE.txt for your full rights.
#
"""Classes for implementing the weewx tag 'code' codes."""

import weeutil.weeutil
from weeutil.weeutil import to_int
import weewx.units
from weewx.units import ValueTuple

#===
#Class TimeBinder
#===

class TimeBinder(object):
"""Binds to a specific time. Can be queried for time attributes, such as month.

When a time period is given as an attribute to it, such as obj.month,
the next item in the chain is returned, in this case an instance of
TimespanBinder, which binds things to a timespan.
"""

def __init__(self, db_lookup, report_time,
 formatter=weewx.units.Formatter(), converter=weewx.units.Converter(), **option_dict):
"""Initialize an instance of DatabaseBinder.

db_lookup: A function with call signature db_lookup(data_binding), which
returns a database manager and where data_binding is an optional binding
name. If not given, then a default binding will be used.

report_time: The time for which the report should be run.

formatter: An instance of weewx.units.Formatter() holding the formatting
information to be used. [Optional. If not given, the default
Formatter will be used.]

converter: An instance of weewx.units.Converter() holding the target unit
information to be used. [Optional. If not given, the default
Converter will be used.]

option_dict: Other options which can be used to customize calculations.
[Optional.]
"""
self.db_lookup= db_lookup
self.report_time  = report_time
self.formatter= formatter
self.converter= converter
self.option_dict  = option_dict

# What follows is the list of time period attributes:

def trend(self, time_delta=None, time_grace=None, data_binding=None):
"""Returns a TrendObj that is bound to the trend parameters."""
if time_delta is None:
time_delta = to_int(self.option_dict['trend'].get('time_delta', 10800))
if time_grace is None:
time_grace = to_int(self.option_dict['trend'].get('time_grace', 300))
return TrendObj(time_delta, time_grace, self.db_lookup, data_binding, self.report_time, 
 self.formatter, self.converter, **self.option_dict)

def hour(self, data_binding=None, hours_ago=0):
return TimespanBinder(weeutil.weeutil.archiveHoursAgoSpan(self.report_time, hours_ago=hours_ago), 
  self.db_lookup, data_binding=data_binding, 
  context='day', formatter=self.formatter, converter=self.converter,
  **self.option_dict)

def day(self, data_binding=None, days_ago=0):
return TimespanBinder(weeutil.weeutil.archiveDaySpan(self.report_time, days_ago=days_ago), 
  self.db_lookup, data_binding=data_binding, 
  context='day', 

[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread mwall
tom and gary,

do you know if there is a unit test for the $day tag (or any other tag, for 
that matter)?  i'm not finding anything.

also, this looks suspect, but perhaps not relevant to this problem.  in 
tags.py i see this:


def hour(self, data_binding=None, hours_ago=0):

return 
TimespanBinder(weeutil.weeutil.archiveHoursAgoSpan(self.report_time, 
hours_ago=hours_ago),

  self.db_lookup, data_binding=data_binding,

  context='day', formatter=self.formatter, 
converter=self.converter,

  **self.option_dict)


should the context be 'hour' not 'day'?

m

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread Mike Hawkins
Hi, Thanks for the suggestion, they do indeed return different values:

wf: 7.3C
wx: 5.5C
default: 5.5C

Mike

On Tuesday, September 25, 2018 at 10:30:33 PM UTC+1, mwall wrote:
>
>
>
> On Tuesday, September 25, 2018 at 1:42:55 PM UTC-4, Mike Hawkins wrote:
>>
>>
>> At one point in the index.html.templ I have:
>> $latest($data_binding='weatherflow_binding').outTemp
>> $current.outTemp
>>
>> and I get the expected differing values, so I know the weatherflow sensor 
>> and database are ok and the 'weatherflow_binding' is working properly.  But 
>> the following code, just creates a page with two copies of the default 
>> outTemp data, so I end up with a pretty chart, but with only one line on it.
>> 
>>
>
> could you verify that the weatherflow binding ('weatherflow_binding') and 
> the davis binding ('wx_binding'?) actually return different values?
>
> try this:
>
> wf: $latest($data_binding='weatherflow_binding').outTemp
> wx: $latest($data_binding='wx_binding').outTemp
> default: $latest.outTemp
>
>

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread mwall


On Tuesday, September 25, 2018 at 1:42:55 PM UTC-4, Mike Hawkins wrote:
>
>
> At one point in the index.html.templ I have:
> $latest($data_binding='weatherflow_binding').outTemp
> $current.outTemp
>
> and I get the expected differing values, so I know the weatherflow sensor 
> and database are ok and the 'weatherflow_binding' is working properly.  But 
> the following code, just creates a page with two copies of the default 
> outTemp data, so I end up with a pretty chart, but with only one line on it.
> 
>

could you verify that the weatherflow binding ('weatherflow_binding') and 
the davis binding ('wx_binding'?) actually return different values?

try this:

wf: $latest($data_binding='weatherflow_binding').outTemp
wx: $latest($data_binding='wx_binding').outTemp
default: $latest.outTemp

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread vince
On Tuesday, September 25, 2018 at 1:16:54 PM UTC-7, Mike Hawkins wrote:
>
> Ah, thanks for that suggestion,having the same variable names did not even 
> cross my mind.  Changing them does not fix the problem, but definitely a 
> good suggestion, thanks
>
>>
>>
yeah - it was a stretch for sure

 You're defining an array of hashes, does that get pre-parsed and 
populated, or is it really on-the-fly magic.

Maybe try to just dump out series[data][Davis] and series[data][Dataflow] 
(so to speak) in text format and see if cheetah does that right without 
Chartist ?

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread Mike Hawkins
Ah, thanks for that suggestion,having the same variable names did not even 
cross my mind.  Changing them does not fix the problem, but definitely a 
good suggestion, thanks

Mike


On Tuesday, September 25, 2018 at 6:42:55 PM UTC+1, Mike Hawkins wrote:
>
> Hi,
> I'm hoping somebody can point out what I am doing wrong here.
>
> I have a new weewx installation on a Raspberry Pi and everything is 
> working great.  So I am modifying my skin, using the Responsive and 
> Washboard skins as a base.
>
> I have two weather stations a Davis and a Weatherflow and would like to 
> use chartist to draw a graph with both temperature values on for 
> comparison. Chartist is not the problem, getting the data from the 
> weatherflow sensor on to the chart is the problem.
>
> At one point in the index.html.templ I have:
> $latest($data_binding='weatherflow_binding').outTemp
> $current.outTemp
>
> and I get the expected differing values, so I know the weatherflow sensor 
> and database are ok and the 'weatherflow_binding' is working properly.  But 
> the following code, just creates a page with two copies of the default 
> outTemp data, so I end up with a pretty chart, but with only one line on it.
>
>   
> new Chartist.Line('#temperature', {
>series: [
> {
>   name: 'Davis',
>   data: [
> #for $record in $day.records
> #set $floatminute = float($record.dateTime.format("%M")) / 60;
> #set $decimalminute = str($floatminute - int($floatminute))[2:];
> {x: "$record.dateTime.format("%H").$decimalminute", y: 
> "$record.outTemp.nolabel("%1f","undefined")"},
> #end for
>   ]
> },
> {
>   name: 'Weatherflow',
>   data: [
> #for $record in $day($data_binding='weatherflow_binding').records
> #set $floatminute = float($record.dateTime.format("%M")) / 60;
> #set $decimalminute = str($floatminute - int($floatminute))[2:];
> {x: "$record.dateTime.format("%H").$decimalminute", y: 
> "$record.outTemp.nolabel("%1f","undefined")"},
> #end for
>   ]
> },
>   ]
> }, {
>   showPoint: false,
>   axisX: {
> type: Chartist.FixedScaleAxis,
> divisor: 24,
> low: 0,
> high: 24,
>   }
> });
>
>
> the output looks like:
>
> new Chartist.Line('#temperature', {
> series: [
> {
> name: 'Davis',
> data: [
> {x: "00.08333", y: "3.46"},
> {x: "00.1667", y: "3.38"},
> {x: "00.25", y: "3.330247"},
> {x: "00.", y: "3.251208"},
> {x: "00.4167", y: "3.191667"},
> 
> ]
> },
> {
> name: 'Weatherflow',
> data: [
> {x: "00.08333", y: "3.46"},
> {x: "00.1667", y: "3.38"},
> {x: "00.25", y: "3.330247"},
> {x: "00.", y: "3.251208"},
> {x: "00.4167", y: "3.191667"},
> 
>
>
>
>
> It looks to me like the data_binding in the second for loop is being 
> ignored, but I know nothing and user error is probable.
>
> Can anybody point out what I'm doing wrong here?
>
> Best regards
>
> Mike
>
> https://duckrising.com/weewx/
>

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread vince
On Tuesday, September 25, 2018 at 12:27:44 PM UTC-7, Mike Hawkins wrote:
>
> Certainly, i’m not trying to do anything that could not be done with the 
> built in functionality, it is partly a question of style, I think this 
> looks better, but mainly now it’s an annoyance that is under my skin, I 
> think this should work and want to understand why it isn’t.


Well at quick glance, you use the same variable names for both blocks of 
data.

#for $record in $day($data_binding='weatherflow_binding').records
#set $floatminute = float($record.dateTime.format("%M")) / 60;
#set $decimalminute = str($floatminute - int($floatminute))[2:];

It shouldn't matter, but just for the joy of adventure, try:

#for $wf_record in $day($data_binding='weatherflow_binding').records
#set $wf_floatminute = float($wf_record.dateTime.format("%M")) / 60;
#set $wf_decimalminute = str($wf_floatminute - int($wf_floatminute))[2:];

Maybe there's something in how cheetah parses loops, I dunno.  Give it a 
try.

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread Mike Hawkins
Certainly, i’m not trying to do anything that could not be done with the built 
in functionality, it is partly a question of style, I think this looks better, 
but mainly now it’s an annoyance that is under my skin, I think this should 
work and want to understand why it isn’t.

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread vince
On Tuesday, September 25, 2018 at 11:36:34 AM UTC-7, Mike Hawkins wrote:
>
> Thanks for the reply, that was my first go and it works very nicely. But 
> chartist is just gorgeous and I can not resist taking advantage, hell or no 
> hell.
>
> On Tuesday, September 25, 2018 at 7:27:46 PM UTC+1, vince wrote:
>>
>> I'd never mess with Cheetah hell to just build a graph, given any way to 
>> avoid it
>>
>>
>>
>>
What in particular are you trying to accomplish that the default graphing 
engine can't do ?

Nice site incidentally - I like all the different sources of data.

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread Mike Hawkins
Thanks for the reply, that was my first go and it works very nicely. But 
chartist is just gorgeous and I can not resist taking advantage, hell or no 
hell.

On Tuesday, September 25, 2018 at 7:27:46 PM UTC+1, vince wrote:
>
> On Tuesday, September 25, 2018 at 10:42:55 AM UTC-7, Mike Hawkins wrote:
>>
>> I have two weather stations a Davis and a Weatherflow and would like to 
>> use chartist to draw a graph with both temperature values on for 
>> comparison. Chartist is not the problem, getting the data from the 
>> weatherflow sensor on to the chart is the problem.
>>
>>
> m - WeatherFlow is pretty slick isn't it ?
>
> I'm wondering if you're working too hard.   I overlay multiple db sources 
> onto one chart just in skin.conf with no cheetah magic (hell) required. 
> This generates a file for our outside 'baseball viewing room', overlaying 
> the VP2 outside temp with a couple sensors from a RasPi on a breadboard in 
> the outside room.
>
>   [[[dayBaseball]]]
>   outTemp
>   label = OutTemp
>   extraTemp1
>   data_binding = pi_binding
>   label = BaseballRoom(1)
>   extraTemp2
>   data_binding = pi_binding
>   label = BaseballRoom(2)
>
>
> I'd never mess with Cheetah hell to just build a graph, given any way to 
> avoid it
>
>
>
>

-- 
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.


[weewx-user] Re: Cheetah for loop and data_binding

2018-09-25 Thread vince
On Tuesday, September 25, 2018 at 10:42:55 AM UTC-7, Mike Hawkins wrote:
>
> I have two weather stations a Davis and a Weatherflow and would like to 
> use chartist to draw a graph with both temperature values on for 
> comparison. Chartist is not the problem, getting the data from the 
> weatherflow sensor on to the chart is the problem.
>
>
m - WeatherFlow is pretty slick isn't it ?

I'm wondering if you're working too hard.   I overlay multiple db sources 
onto one chart just in skin.conf with no cheetah magic (hell) required. 
This generates a file for our outside 'baseball viewing room', overlaying 
the VP2 outside temp with a couple sensors from a RasPi on a breadboard in 
the outside room.

[[[dayBaseball]]]
outTemp
label = OutTemp
extraTemp1
data_binding = pi_binding
label = BaseballRoom(1)
extraTemp2
data_binding = pi_binding
label = BaseballRoom(2)


I'd never mess with Cheetah hell to just build a graph, given any way to avoid 
it



-- 
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.