Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding data from a second database #51

Open
zagamuffin opened this issue Mar 21, 2022 · 2 comments
Open

Adding data from a second database #51

zagamuffin opened this issue Mar 21, 2022 · 2 comments

Comments

@zagamuffin
Copy link

What is the correct syntax for adding in data from a second database to charts in this skin? I had a look around this area - https://neoground.com/docs/neowx-material/dev.index - but don't see a reference to using additional databases.

Thanks,
David


The second database is defined in the config file (wmr88.conf in this case, not weewx.conf) as follows -

[DataBindings]
    [[bresser_binding]]
        database = bresser_sqlite
        table_name = archive
        manager = weewx.manager.DaySummaryManager
        schema = schemas.wview_extended.schema
    [[wx_binding]]
        database = archive_sqlite
        table_name = archive
        manager = weewx.manager.DaySummaryManager
        schema = schemas.wview_extended.schema

[Databases]
    [[bresser_sqlite]]
        database_name = bresser.sdb
        database_type = SQLite
    [[archive_sqlite]]
        database_name = wmr100.sdb
        database_type = SQLite

I tried including a chart in index.html.tmpl as follows based on the syntax for the standard Weewx -

 //  $getChartJsCode("bresserTemp", "bresserTempchart", "area", "($data_binding='bresser_binding').inTemp", "($data_binding='bresser_binding').outTemp")

But it failed with this, indicating that the syntax I used was incorrect -

Mar 21 15:00:30 raspberrypi weewx-wmr88[658] ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/neowx-material/index.html.tmpl failed.
Mar 21 15:00:30 raspberrypi weewx-wmr88[658] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/neowx-material/index.html.tmpl
Mar 21 15:00:30 raspberrypi weewx-wmr88[658] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'has_data' while searching for 'day.(data_binding='bresser_binding').inTemp.has_data'
@thzzlan
Copy link

thzzlan commented Oct 21, 2022

I tried to add a second database to neowx-material too, and sadly it also did not work for me. The error I got is a different one though:
Oct 21 15:31:18 raspberrypiweewx wee_reports[6721] ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/neowx-material/index.html.tmpl failed. Oct 21 15:31:18 raspberrypiweewx wee_reports[6721] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/neowx-material/index.html.tmpl Oct 21 15:31:18 raspberrypiweewx wee_reports[6721] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'clear' while searching for 'obs.label.(data_binding='bewoelkung_binding').clear' Oct 21 15:31:18 raspberrypiweewx wee_reports[6721] ERROR weewx.cheetahgenerator: **** To debug, try inserting '#errorCatcher Echo' at top of template

I tried adding a label too, but I kept getting this error.
Is there any way to use a second database with this skin?

@zagamuffin
Copy link
Author

zagamuffin commented Nov 28, 2022

Hi thzzlan - I was never able to get it working, which is a pity. I'm just starting to work with weewx again after a break of a good few months so I may have another crack at it.

I see there is some discussion of it here - https://groups.google.com/g/weewx-user/c/b_2UsXGKKjQ - but it doesn't get any further than confirming what we have seen with our own efforts - unable to use data from two databases.

I think our two errors are related in as much as Cheetah is trying to reference something (a property I think in this case) that doesn't exist or else is referenced incorrectly. Mine can't find or determine whether inTemp "has data" today and yours can't find or determine whether obs.label "is clear".

Yours - Reason: cannot find 'clear' while searching for 'obs.label.(data_binding='bewoelkung_binding').clear'
Mine - Reason: cannot find 'has_data' while searching for 'day.(data_binding='bresser_binding').inTemp.has_data'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants