-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Specify data_binding on a per tile basis #71
Comments
Yeah, I also stumbled upon this when working on the weewx-DWD integration. This extension also creates a new database for the forecast data. But besides the example for weewx-DWD:
I could not find any information about this in the weewx documentation. Is this somewhere documented that you can set this per graph or something? I am wondering what the ''default support' for setting the data_binding in weewx is. This will definitely be included in the next 2.3.0 release. |
Good question. I saw this mentioned in quite a few plugins, so I assumed that it is something that's documented ... but it doesn't look like it is? Searching for Apparently you can also specify the binding directly in the template by doing something like this:
Also mentioned in multiple places here. |
First, Thanks for investigating this!
As far as I see, the most relevant logic for our use case is in https://github.com/weewx/weewx/blob/80160d81402e9549a93806473855144e00f9f022/bin/weewx/imagegenerator.py#L91 (imagegenerator.py). But since the skin does not use the imagegenerator (because the graphs are rendered via javascript), the class is not used by the skin. From a quick investigation it looks like weewx uses the data_binding defined in But since weewx-wdc also supports setting the observations for the stat and tables tiles, besides the graphs, I think this should be configured globally per observation(?). Something like this:
With this,
Oh yes, I was aware of the direct usage in templates. |
After writing the last comment, I noticed this does not work out for every use case: For example, the forecast extensions (I used weewx-forecast and weewx-DWD) also provide a new data_binding. But these extensions do not necessarily add new observations, they simply reuse existing ones (a forecast includes outTemp, windSpeed, barometer and so on). So using an obs like
|
Well, I need to correct myself. This will hit in v3, since this is part of a bigger refactoring of the general diagrams configuration. See #73 |
@nifoc It would be really helpful for testing if you could provide me with your default database along with your weewx-aqi database. Personally, I do not use any extension that uses its own data binding besides the forecast extensions. But with these it isn't easy to test because values are always in the future, I guess (I already implemented custom data_bindings in https://github.com/Daveiano/weewx-wdc/tree/71-specify-data_binding-on-a-per-tile-basis and its basically working but its giving me a strange error on the month-%Y-%m and year-%Y pages so I wanted to double check if this is from the forecast extensions data structure or something else). Do you use any other ease-to-set-up extensions with a own data binding? I found that the purple-air sensors for weewx-aqi are quite expensive (If you consider I just want them for testing :D) |
Sent the AQI database via email :) Fairly certain you won't need the default DB just to test another
I don't, sorry! But I think you should be able to (for example) just specify a different default DB as new, different data source. Something like this (in addition to the normal
And just use an existing |
Thank you very much! Great idea with the second "test database"! I simply ran my local installation with the Simulator (mode: generator) driver to get some test data :) This is looking good now, will drop in 3.0.0 like I said :) |
Is your feature request related to a problem? Please describe.
As far as I'm aware, the skin currently always uses the same
data_binding
. In practice this means that it can only display data stored in the default (wx_binding
) database.Some plugins (e.g. weewx-aqi)store their data in a separate database, which - as far as I know - can currently not be queried/displayed.
Describe the solution you'd like
Introduce a
data_binding
attribute (like in the weewx defaultskin.conf
) that can be used to specify the "source" of a specific field.This should work with stat and diagram tiles (I personally don't use the table and I imagine it would be harder to make it work with that tile type, too).
Describe alternatives you've considered
N/A
Additional context
weewx DataBindings docs
weewx Data Bases docs
weewx DataBinding programming interface
weewx Multiple bindings docs
The text was updated successfully, but these errors were encountered: