"reveal your capabilities"
sure, here you are ..
{ // ...
"properties": {
"on": {
"type": "boolean",
"forms": [{
"op": "writeproperty",
"href": "https://myt.example.com:5683/temp",
"contentType": "application/json",
"htv:methodName": "POST"
}]
},
"status": {
"type": "object",
"properties": {
"brightness": {
"type": "number",
"minimum": 0.0,
"maximum": 100.0
},
"rgb": {
"type": "array", // ...
}
},
"required": ["brightness", "rgb"],
"forms": [...]
}
}, // ...
}
{ // ...
"actions": {
"fade": {
"title": "Fade in/out",
"description": "Smooth fade in and out.",
"input": {
"type": "object",
"properties": {
"from": {
"type": "integer",
"minimum": 0,"maximum": 100
},
"to": {
"type": "integer",
"minimum": 0,"maximum": 100
},
"duration": {"type": "number"}
},
"required": ["to","duration"]
},
"output": {"type": "string"},
"forms": [{
"op": "invokeaction",
"href": "https://cam.example.com/api/snapshot",
"contentType": "application/json",
"htv:methodName": "POST",
"response": {
"contentType": "image/jpeg"
}
}]
}
}, // ...
}
has you covered - let the device's digital twin provide WoT description
curl -u ditto:ditto -H 'Accept: application/td+json' \
'https://ddm-api-dev.beyonnex.org/ditto/api/2/things/io.beyonnex:srt-0815'
{
@context":["https://www.w3.org/2022/wot/td/v1.1", ...],
"title":"Smart Room Thermostat",
"@type":"Thing",
"id":"urn:io.beyonnex:srt-0815",
"base":"https://ddm-api-dev.beyonnex.org/ditto/api/2/things/io.beyonnex:srt-0815",
"version":{"model":"1.0.0","instance":"1.0.0"},
"links":[{
"rel":"type",
"href":"https://some-public.website.org/wot/models/srt-1.0.0.tm.jsonld",
"type":"application/tm+json"
},...],
"security":"oauth2_sc",
"securityDefinitions":{"oauth2_sc":{"scheme": "oauth2","flow":"code","authorization":"...",...}},
"forms":[{"op":"readallproperties","href":"/attributes","htv:methodName":"GET","contentType":"application/json"}],
"properties": {...},
"actions": {...},
"events": {...}
...
}
WoT is all about improved interoperability