New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project (2022-03 Plugfest): TDs for Commercial Devices #267
Comments
I've been working on MQTT protocol binding template lately and I'm now starting to work on practical examples. I thought that using a real device would test the expressivity of the ontology. So I tried to describe Shelly Gas sensor following the documentation linked about. I'm posting some thoughts here. This is the final TD (expand if needed): Gas sensor MQTT TD{
"@context": "https://www.w3.org/2019/wot/td/v1",
"title": "Shelly Gas",
"id": "urn:dev:test",
"description": "Shelly Gas is a sensor that can measure combustible gas concentration and issue an alarm in the event of a gas leak. Shelly Gas operates on AC voltage.",
"securityDefinitions": {
"nosec_sc": {
"scheme": "nosec"
}
},
"security": "nosec_sc",
"properties": {
"status": {
"title": "Sensor status",
"observable": true,
"enum": [
"unknown",
"warmup",
"normal",
"fault"
],
"type": "string",
"forms": [
{
"href": "mqtt://broker.com/",
"mqtt:filter": "shellies/shellygas-<deviceid>/sensor/operation",
"op": "observeproperty"
}
]
},
"concentration": {
"title": "Gas concentration",
"observable": true,
"readOnly": false,
"minimum": -1,
"maximum": 65535,
"type": "integer",
"forms": [
{
"href": "mqtt://broker.com",
"mqtt:filter": "shellies/shellygas-<deviceid>/sensor/concentration",
"op": "observeproperty"
}
]
},
"gasAlarm": {
"title": "Gas Alarm",
"observable": true,
"enum": [
"unknown",
"none",
"mild",
"heavy",
"test"
],
"type": "string",
"forms": [
{
"href": "mqtt://broker.com",
"mqtt:filter": "shellies/shellygas-<deviceid>/sensor/gas",
"op": "observeproperty"
}
]
},
"valve": {
"title": "Valve",
"observable": true,
"enum": [
"unknown",
"closed",
"opened",
"not_connected",
"failure",
"closing",
"opening",
"checking"
],
"type": "string",
"forms": [
{
"href": "mqtt://broker.com/",
"mqtt:filter": "shellies/shellygas-<deviceid>/valve/0/state",
"op": "observeproperty"
}
]
}
},
"actions": {
"mute": {
"title": "Mute",
"forms": [
{
"href": "mqtt://broker.com/",
"mqtt:topic": "shellies/shellygas-<deviceid>/sensor/mute",
}
]
},
"unmute": {
"title": "Unmute",
"forms": [
{
"href": "mqtt://broker.com/",
"mqtt:topic": "shellies/shellygas-<deviceid>/sensor/unmute",
}
]
},
"changeValveStatus": {
"title": "Change Valve Status",
"input": {
"type": "string",
"enum": ["open", "close"]
},
"forms": [
{
"href": "mqtt://broker.com/",
"mqtt:topic": "shellies/shellygas-<deviceid>/valve/0/command",
}
]
}
},
} Some discussion points:
I'll now try to model also the door sensor and might we can compare it with your solution. |
Discussion:
|
I have the following commercial systems in my lab and want to write TDs for them and make them available on the VLAN for testing:
To do:
The text was updated successfully, but these errors were encountered: