WebThingsIO / zwave-adapter

Z-Wave adapter add-on for WebThings Gateway
Mozilla Public License 2.0
15 stars 20 forks source link

Additional Metadata #65

Open GarthDB opened 5 years ago

GarthDB commented 5 years ago

Can the ZWave Adapter add more information to the things? Specifically, I was wondering if it could things like the manufacturer or product name?

The larger context of the question: I started building a homebridge-plugin to add the gateway to Homekit, but there is data that HAP devices support that the Things API doesn't provide.

That information could be explicitly allowed in the wot spec, but could it just be tacked on as optional metadata?

dhylands commented 5 years ago

I've requested this as well here: https://github.com/mozilla-iot/gateway/issues/1396 Please add comments to that bug.

Currently the only way to add additional information is to create an additional property. So it would be possible to create a read-only string property called model (or product or whatever) and have it contain the model string.

The classifier could add these to all devices until such time as we get something better.

GarthDB commented 5 years ago

That's an interesting idea (using the read-only string properties), but it would be really nice if we could work toward a defined standard spec for this information added to the full spec.

benfrancis commented 5 years ago

Note that the W3C Thing Description specification currently has some additional types of metadata for a Thing we could add support for, or propose new ones.

The manufacturer and product name could be used as the default "name" ("title" in the W3C spec) for a device. We could also implement the "support" member which provides a URL for example.

Although this is not something we've implemented so far, the W3C spec also allows for "Context Extensions" to add additional metadata using external vocabularies.

GarthDB commented 5 years ago

@benfrancis just checking if I understand the Context Extensions, I could add a uri to a json schema that would describe/allow for additional properties?