Been playing around with this new API and I have a few questions that perhaps the readers of this thread can answer. My goal is a rudimentary web version of the ST app, where everything happens on the client side (angular in the browser). Basic device info is fine, and I have pretty html per device showing name, hub-name, group-name, and how much battery is left if battery-powered etc. But the capabilities/status/actions are a bit more tricky. For example here is the capabilities list of my presence dongle:
“capabilities”:[{“id”:“battery”},{“id”:“presenceSensor”},{“id”:“tone”},
{“id”:“signalStrength”},{“id”:“sensor”},{“id”:“actuator”},{“id”:“healthCheck”}]
and the corresponding status:
{“components”:{“main”:{“battery”:{“battery”:{“value”:25,“unit”:"%"}},
“presenceSensor”:{“presence”:{“value”:“present”}},“tone”:{},
“signalStrength”:{“lqi”:{“value”:100,“unit”:"%"},“rssi”:{“value”:-28,“unit”:“dBm”}},
“sensor”:{},“actuator”:{},“healthCheck”:{“checkInterval”:{“value”:null},
“DeviceWatch-DeviceStatus”:{“value”:null}}}}}
A good visualisation of this device would be to display “presence” as the primary value and perhaps “signalStrength” as secondary value. And there should be a “beep” button as that action is hiding behind the “tone” capability, but the similar “sensor” and “actuator” capabilities are just tags. But I don’t understand how I can get to that knowledge without hard coding lots and lots of information from the docs. There does not appear to be API calls for this at all, unless I’ve completely missed a vital part of the new docs. Trusting the order of the object inside “main” seems a bit dodgy, and it does not solve the actions.
To look for additional info, I ripped the SmartThings CLI out of the MacOS SDK blob and installed it on my Linux-box. It had quite a few additional API calls to a different Samsung web service for more OIC/OCF type info(*) but nothing that helped me with this. However the cli did have a number of files with device type asset info in a format I perhaps could import, but strangely enough not a complete set. Button was missing for example.
Bright ideas anyone?
*) Sample output:
$ /home/ok/cli/st describe device-status -i --resource-model --resource /st//capability/temperatureMeasurement/0
{
“rt”: [
“oic.r.temperature”
],
“temperature”: 19.7,
“id”: “0”,
“units”: “C”,
“if”: [
“oic.if.baseline”,
“oic.if.r”
]
}