WebThings Schema, Display UUID as Fixed Text Element

Good evening everyone.
I’ve made several BME680 Sensor Modules for a small non-profit and outfitted a RPi4 with the gateway installed to present a display of the environmental conditions within an assisted work warehouse. So far all is working as expected.
The senior operations manager has asked if each ESP8266-BME680 module, programmed with the WebThings framework, can display a unique UUID as they wish to extract and differentiate that data at a later stage for further processing and logging. The UUID implementation is straightforward but i can’t find an example of a Thing being described with a easily shown UUID. Any pointers where I can look for an example or a reference as to how to approach this request. The ThingProperty “text” displays as a truncated string, which can be edited. I need it to be shown as the full 37 character ascii string, (16 hex bytes), and fixed, not editable.

Thanks in advance.

Not sure this is the same identifier, but if you mouse over a thing, the URL shows a uniq id. I’ve used this id to trigger/set thing values by remote applications. As you stated, when I was looking for this id value I could not find it easily until I saw it when about to click on the GUI thing item…

image

Hi @Antonio,

I’m afraid the truncation is a UI limitation of WebThings Gateway which doesn’t have a quick fix, but is something we can improve in the future.

You can make a property of a thing read-only by setting "readOnly": true in its description. See https://webthings.io/api/#property-object

However, properties are really designed for attributes of devices which change, whereas a unique ID is more static metadata.

A thing has an id member which is used to specify a unique identifier, which is always a URI of some kind. You could include the UUID in this URI to identify a particular device. Those IDs are not currently displayed in the WebThings Gateway user interface (except in the URL bar and by hovering over a link to a thing as @EricEdberg noted), but they are exposed through the API if you want to make use of them in the future.

Alternatively you could just add a read-only property as described above.

Hope this helps

Ben

Hi Ben.

Thanks for the idea. I’ll give it a try.