eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 787 forks source link

Addition of discover information to ThingType XML #5518

Open cdjackson opened 6 years ago

cdjackson commented 6 years ago

In order to allow all data relating to a thing to be stored in one place, and handled consistently by the system, a "discovery information" section should be added to the thing-type XML file.

The discovery data should be defined in a binding independent way - I could suggest a similar construct as used in properties.

<discovery>
  <property name="discovery property">binding specific data</property>
</discovery>

This information should be made available to bindings through a separate service to the thing type registry.

Refer to https://github.com/openhab/org.openhab.binding.zigbee/pull/169#issuecomment-384926568

maggu2810 commented 6 years ago

Hm, I don't understand what this is about? Is there a short summary what the intention is and why we need it (or do I need to read the whole referenced issue)?

cdjackson commented 6 years ago

This is about adding discovery data into the thing-type files so that all information about a thing is in one place. As currently required, we have to put the thing description, and information used for the discovery in different places.

The idea is to add discovery data in the thing-type XML, and provide a service that can provide the discovery data to the binding.

kaikreuzer commented 6 years ago

What I am wondering is whether there is a chance to define at least some basic data structure besides key-value pairs for such information. Do we have any clue, what kind of structured information about a thing type could be useful for a discovery service in general?

cdjackson commented 6 years ago

Do we have any clue, what kind of structured information about a thing type could be useful for a discovery service in general?

I think it's likely to be very device/binding dependant, but I can give you examples of ZWave and ZigBee -:

The format of this information is very different for ZWave and ZigBee. ZigBee uses strings, but ZWave uses numbers. I think the easiest and most generic option is to provide a set of key/value pairs that can be used as the specific binding likes.