-
Notifications
You must be signed in to change notification settings - Fork 780
[Core] Added item metadata infrastructure #4390
Conversation
@beowulfe, I would like to validate that approach with you.
Alternatively, it could even try to derive some information when no meta-data on the group is specified:
-> auto derive a Thermostat service with the following capabilities:
This would give you the full flexibility to do mappings to the HomeKit definitions. We should imho try to keep support for a common semantic tag library in the add-on, so whenever there is a good mapping from ESH tags to Homekit, that could be automatically derived without requiring from the user to specifically add homekit information. What do you think about this approach? Would that work for you? |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/new-binding-hue-emulator-amazon-echo-integration/7944/193 |
Hi, did you do any steps forward in this issue in the background? |
really cool stuff. Took a look and it would be great to have this officially available. I think the docu part is important next to the unit tests. Great job! Any idea, when this can go into core? Do you need support with testing this? BR Mehmet |
* | ||
*/ | ||
@NonNullByDefault | ||
public class MetaDataKey { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this would be a good candidate for the cleaned up (Generic)UID base class usage. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - didn't have it on my radar either...
Signed-off-by: Kai Kreuzer <[email protected]>
...as a common base class for unique, name-spaces IDs. In contrast to the UID class, the AbsstractUID class is bindings agnostic, i.e. it can be used for namespaces other than the binding ID. Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
Signed-off-by: Simon Kaufmann <[email protected]>
As agreed with @kaikreuzer I continued this PR in order to push forward this topic. Thereby I
Yet missing is the adaption of the Paper UI. |
@digitaldan & @beowulfe: I have just rolled this change out to openHAB - so the metadata infrastructure should be available for Alexa & Homekit integration in the openHAB IDE (after refreshing your target platform). Please note that you are the Guinea pigs for that - if you run into any issues, please report them! Here you can find an example service that uses metadata - you'd have to do something similar to get access to it. |
@kaikreuzer you forgot me. Since the Google Assistant integration should also use the metadata approach. Can you point me on some example on how this will look like in a concrete example. @digitaldan & @beowulfe Yes please! Lets arrange for some "common" convention to have a not-complicated way to use this in the real world integrations. Thanks & BR |
I didn't, I just thought you do not want to be a Guinea pig 🐷 !
I gave an example DSL in the comment above and a link to the code that consumes this data just before. Some short documentation had been [added here] - that's all there is right now. |
Awesome! One thing that adds a decent amount of complexity to the HomeKit addon is the code that tracks items in a Group that need to be composed to form a HomeKit accessory. If I was to abstract that out from HomeKit, so we only have one implementation instead of many, where's the right place for that? |
@kaikreuzer fantastic
So is this available in the nightly builds then? |
nevermind, I see that it is :-) |
@beowulfe I am not quite sure what kind of methods/features you have in mind for this. Could you elaborate on it / give an example? Is it something that could be potentially added to the |
@kaikreuzer - that might work. Let me get something working and I'll start a PR for discussion. |
Hi @beowulfe @digitaldan BR Mehmet |
@marziman yes we have this already implemented in the v3 version of the Alexa skill, see https://github.com/openhab/openhab-alexa/tree/v3 . @marziman and @beowulfe while we have a specific metadata syntax for Alexa v3, we have been discussing keeping a more basic form that would keep things simpler for most users, and is similar to the syntax we have in tags. We would like to have consistency with homekit and google on this. We are proposing to support the following "labels"
I realize this is probably the wrong thread to discuss such things, but wdyt as a starting place? See https://github.com/openhab/openhab-alexa/tree/v3#labels-concept for more info on "labels". @jsetton has been working on this as you can see at openhab/openhab-alexa#68 |
Your proposal is pretty cool on Google Assistant side. We currently use these tags:
So this fits to the proposal. Fine from GA side, and I would like to switch to the metadata style these days. @beowulfe: Is that fine for you, too? Just need to setup my installation and need to try it out. BR Mehmet |
Those look great to me as well. Thanks for pulling those together @digitaldan |
As much as I would like to take the credit, @jsetton came up with those :-) |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/additional-key-value-attributes-field-for-genericitem/48037/5 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/what-kinds-of-devices-does-the-google-integration-support/61661/1 |
3 similar comments
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/what-kinds-of-devices-does-the-google-integration-support/61661/1 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/what-kinds-of-devices-does-the-google-integration-support/61661/1 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/what-kinds-of-devices-does-the-google-integration-support/61661/1 |
Fixes #3692.
This PR introduces a
MetaDataRegistry
which can be queried for item-related meta data. The meta data can be add-on specific and thus it is always referred to with a namespace.There is a
ManagedMetaDataProvider
, which allows adding meta data through the REST API, but add-ons are also free to implement their ownMetaDataProvider
, if they have other sources for that information.Wrt textual configuration, it uses the existing infrastructure for "binding configurations", i.e. the
{ ..}
part of item files. Any such definition for which there is NO reader available will end up in the meta data registry through theGenericMetaDataProvider
.As an example, this allows to do definitions like:
Note that also the new configurations can be used to provide key-value maps if necessary.
The item endpoint of the REST API has been extended to directly include meta data for given namespaces in an item response, so that it should be easy for external clients to get hold of the data.
Still to do:
Signed-off-by: Kai Kreuzer [email protected]