I saw that you updated your DTH, now the generateEvent
function is working and the events of Temperature are received.
The “checking status” message could be shown because the device is missing its presentation/VID, to create it, please follow these steps:
- You need to set up the SmartThings CLI, to do so, get the latest release and follow the steps mentioned in the documentation.
- Your DTH must be saved and published.
- Then, generate the device config presentation. You need to use the DTH ID which is at the end of its URL, eg. https://graph.api.smartthings.com/ide/app/editor/xxxx-xxxx-xxxx
smartthings presentation:device-config:generate dthID --dth -j -o=devConfigPres.json
- Go to the
devConfigPres.json
file and modify the views configuration according to your needs. In this example, the temperature will be displayed in the dashboard and all capabilities will appear in the details. Custom attributes such as windowFunction
are not added because they don’t belong to a capability.
{
"type": "dth",
"dashboard": {
"states": [
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": []
}
],
"actions": []
},
"detailView": [
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "refresh",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "thermostat",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "sensor",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "actuator",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "thermostatOperatingState",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "healthCheck",
"version": 1,
"values": [],
"patch": []
}
],
"automation": {
"conditions": [
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "refresh",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "thermostat",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "sensor",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "actuator",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "thermostatOperatingState",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "healthCheck",
"version": 1,
"values": [],
"patch": []
}
],
"actions": [
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "refresh",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "thermostat",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "sensor",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "actuator",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "thermostatOperatingState",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "healthCheck",
"version": 1,
"values": [],
"patch": []
}
]
}
}
- Save the file and create the presentation:
smartthings presentation:device-config:create -i devConfigPres.json
- Take the values of the vid and mnmn properties and add them to your DTH definition eg.
definition (name: "Evohome 2.0", namespace: "Andremain", author: "Andreas Christodoulou", vid: "7bf24038-29fb-383c-b863-a748e9a43af4", mnmn:"SmartThingsCommunity")
- Save and publish your DTH, then, create a new device using this handler.