small problem with database binding

71 views
Skip to first unread message

angry tux

unread,
Mar 17, 2020, 4:01:20 PM3/17/20
to weewx-user
Helllo,

I'ḿ a bit lost with creating some statistics for the data from two databases.
when I use:

$week($weeks_ago=2).grid_energy.max.formatted    it works perfectly directly with the skin template (SMA)

if I try to use it in another skin with:
$week($weeks_ago=2)($data_binding='SMA_binding').grid_energy.max.formatted   gives me error messages.

While:
$week($data_binding='SMA_binding').grid_energy.max.formatted   gives correct data. So, the binding works well.

What is wrong with the syntax? I tried several constellations, but could not find an solution.

Regards

gjr80

unread,
Mar 17, 2020, 5:03:07 PM3/17/20
to weewx-user
Hi,

Looks like your syntax is wrong, you need to follow the syntax detailed under ‘Aggregation periods’ in the Customization Guide (http://www.weewx.com/docs/customizing.htm#general_aggregation_periods)

Gary

angry tux

unread,
Mar 18, 2020, 5:50:40 AM3/18/20
to weewx-user
Hi,

Thats what I tried in different ways, honestly, I never learned to code, just puzzle around as good as I understand. But for this I don´t get it whats wrong. Is there nobody with a hint?

Regards

gjr80

unread,
Mar 18, 2020, 6:10:22 AM3/18/20
to weewx-user
Nothing to do with coding, I gave you a big clue. Here is a bigger one, have a look at what you tried that did not work:

$week($weeks_ago=2)($data_binding='SMA_binding').grid_energy.max.formatted

Now have a look at the tag syntax from the link I provided:

$period($data_binding=binding_name, $optional_ago=delta).statstype.aggregation[.optional_unit_conversion][.optional_formatting]

Do you notice a difference? How many sets of brackets () did you use and how many in the tag syntax ?

Gary

steeple ian

unread,
Mar 18, 2020, 9:54:53 AM3/18/20
to weewx...@googlegroups.com
Try
$week($data_binding='SMA_binding', $weeks_ago=2).grid_energy.max.formatted

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/38cdc20c-04aa-46d1-ab4f-33fb65fecf8b%40googlegroups.com.

angry tux

unread,
Mar 18, 2020, 12:19:42 PM3/18/20
to weewx-user
Thanks a lot to both of you, it surely works.
Sorrry to bother, I saw the hints for bindings and the aggregation, but I have overlooked how to combine them.
Great to have this examples :-)

Regards



Reply all
Reply to author
Forward
0 new messages