Adding a Belchertown chart with a data_binding value

160 views
Skip to first unread message

weather list

unread,
Mar 3, 2020, 8:27:28 AM3/3/20
to weewx...@googlegroups.com
Following the excellent instructions I’ve managed to add a new chart but cannot work out how to get the data I need into it.

The value in question is from an SDR device mapped to leafTemp2 (I’m running two instances of weewx: weewx.conf and sir.conf), so I usually use it as ‘$latest($data_binding='sdr_binding').leafTemp2’, for example.

In my new chart, that doesn’t appear to work:

[[chart6]]
title = Water level
[[[($data_binding='sdr_binding').leafTemp2]]]
yAxis_tickInterval = 6
name = Water level

How do I retrieve that value for the chart?

Pat

unread,
Mar 4, 2020, 8:12:02 AM3/4/20
to weewx-user
Yes, this should be supported. It's similar to the ImageGenerator settings... try this

 [[chart6]]
      title = Water level
      [[[leafTemp2]]]
          data_binding = sdr_binding
          yAxis_tickInterval = 6
          name = Water level

weather list

unread,
Mar 5, 2020, 2:48:41 PM3/5/20
to weewx-user
Doesn't seem to work in that format, or as:

[[chart6]]
      title = Water level
      [[[leafTemp2]]]
          $data_binding='sdr_binding'
          yAxis_tickInterval = 6
          name = Water level

The contents of leafTemp2 are in the form: 62.9921259843

Perhaps all those decimal places cause issues? I am unsure how to eliminate them.

The sensor map is thus:

[SDR]
    # This section is for the software-defined radio driver.
    
    # The driver to use
    driver = user.sdr
    log_unknown_sensors = False
    log_unmapped_sensors = False
    [[sensor_map]]
        leafTemp2 = depth.*.TSFT002Packet    # height in cm

The logs show no errors.

Console output of sir.conf:

REC:    2020-03-05 14:40:00 EST (1583437200) dateTime: 1583437200.0, ET: None, extraTemp2: 82.74, interval: 5, leafTemp2: 62.9921259843, maxSolarRad: 750.99796387, rainRate: 0.0, usUnits: 1

LOOP:   2020-03-05 14:44:57 EST (1583437497) dateTime: 1583437497, leafTemp2: 62.9921259843, maxSolarRad: 731.5138454, rainRate: 0, usUnits: 1

Pat

unread,
Mar 5, 2020, 4:17:17 PM3/5/20
to weewx-user
This is working for me. I have a test database setup to capture Lightning strikes. I also have the ability to send adhoc strikes for testing. 

Here we can see my tests are being saved:

Mar  5 16:14:08 serverlab weewx[12374] INFO weewx.manager: Added record 2020-03-05 16:14:08 EST (1583442848) to database 'lightning.sdb'
Mar  5 16:14:08 serverlab weewx[12374] INFO weewx.manager: Added record 2020-03-05 16:14:08 EST (1583442848) to daily summary in 'lightning.sdb'


Then using this graphs.conf config:

    [[lightning_binding_test]]
        title
= Lightning Binding
        data_binding
= lightning_binding
        yAxisLabel
= ""
        time_length
= year
        xAxis_groupby
= day


       
[[[distance_km]]]
            name
= Lightning Distance KM
            type
= column
            yAxisLabel
= Lightning Count
       
[[[distance_mi]]]
            name
= Lightning Distance (mi)
            type
= column


I get these results which are from my tests (image attached). 

Notice how my data_binding is below the 2 square bracket section. Then the 3 square bracket observations match the column name within that custom database. 
2020-03-05_161615.jpg

weather list

unread,
Apr 21, 2020, 11:58:31 AM4/21/20
to weewx-user
Finally getting back to this, and this still does not work. It creates the graph x and y axes and time stamps properly but doesn't seem able to read the data.

[[chart6]]
        title = Water level
        data_binding = 'sdr_binding'
        time_length = week
        type = spline
        [[[leafTemp2]]]
            name = Water level

The sdr_binding works properly in the inex_hook_after_station_info.inc thus:
$latest($data_binding='sdr_binding').leafTemp2

I am puzzled.

vince

unread,
Apr 21, 2020, 6:00:47 PM4/21/20
to weewx-user
On Tuesday, April 21, 2020 at 8:58:31 AM UTC-7, weather list wrote:
Finally getting back to this, and this still does not work. It creates the graph x and y axes and time stamps properly but doesn't seem able to read the data.

[[chart6]]
        title = Water level
        data_binding = 'sdr_binding'
        time_length = week
        type = spline
        [[[leafTemp2]]]
            name = Water level



Mine work fine without the quotes in your example

Note - I'm working off a pre-release hand-patched Belchertown, so I can't speculate if Pat typo'd something after that, but try it without the quotes and see if that helps any.


weather list

unread,
Apr 22, 2020, 10:52:25 PM4/22/20
to weewx-user
Vince,

Thanks, removing the single quote doesn't help. Feels as I'm making an obvious error here and can't see it.
Reply all
Reply to author
Forward
0 new messages