Conversation
Added the possibility to add additional tags to power measurements.
|
Hi, Thanks for the contribution. However, I'm going to put this one on hold for a little bit. As you might already know, we're working on incorporating metrics in the core product. This means that the system will out of the box be able to gather various metrics and deliver them to any plugin that might be interesting. This also means quite some changes for this plugin, as it will change from being gather-and-push to push-only. This PR will still be viable after the change, as extra metadata can always come in handy. It's just that I want to reduce possible merge conflicts. Let's revisit it as soon as the metrics land. |
|
Hi @pdcleyn, version 2 of the plugin has landed in the meantime. Knowing that you make extensive use of this functionality (and most likely the code in this PR), I would like to check with you on how to get this merged in. My proposal would be to incorporate this on the new version of the plugin in a slightly more generic way, so basically tags can be added to any metrics that is processed by the plugin. A suggestion would be to slightly change the new "tags" configuration entry you added to sth like "additional_tags". I think it would be more uniform to replace "name" by "id", since that one is more likely to be available by more metrics. Next to "id", I think it makes sense to add an optional filter for "source" and "type". Leaving these empty matches all sources/types. |
|
This all makes perfectly sense. However, I selected "name" iso "id" as this is what is also visible in other elements on the Openmotics UIs. It is not that trivial, AFAIK, to match the "id" and the "name" based on whatever information available within the OpenMotics WUI, i.e., when looking at the 'Engergy' page, you can find the module's ID, e.g., E13, but have no reference any more to the actual id, while a name is visible and has more context. Another observation made while having this code operational now for a while, is that the UI way of configuring the additional tags is fine for a couple of sources, but once you extend the number of elements, it is not the most user friendly way of working. I'm thinking of adding a file based way of configuring the additional tags. |
|
The ID should typically be this E number and the id of the CT connection; e.g. "E13.5". But indeed, a name might be more convenient. You're indeed right that for a larger setup a configuration file might be easier. Plugins support a possibility "webgui" that allows them to add a page with whatever functionality desired. This could e.g. contain a textbox where a json config file could be parsed and stored. |
|
@khenderick is there any documentation available about this new metrics handling? I can't find the metrics interface documented in http://wiki.openmotics.com/index.php/Gateway_plugins and it seems that even the readme files for the plugin has not yet been updated. |
|
That's correct, I'll update the docs as soon as possible. |
Added possibility to add arbitrary tags to power measurements