Device Handler: Which value to show on main tile

Yep, I think I could have phrased it better. Those are the current working terms (vid standing for ‘Vendor Id’ originally, and my best guess for mnmn being ‘Mah Nà Mah Nà’ ) with the other two being the new ones that suddenly appeared.

1 Like

I am ok with Mah Nà Mah Nà! lol

Done! It now shows correctly! Awesome!

I took from my IDE the device handler ID (you can change it, let’s call it for now handler vid, zzz vid) and change it below.

{
“type”: “dth”,
“iconUrl”: null,
“dashboard”: {
“states”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
}
]
},
“detailView”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
},
{
“component”: “main”,
“capability”: “relativeHumidityMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
},
{
“component”: “main”,
“capability”: “battery”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
},
{
“component”: “main”,
“capability”: “sensor”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
},
{
“component”: “main”,
“capability”: “healthCheck”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
}
],
“automation”: {
“conditions”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
},
{
“component”: “main”,
“capability”: “relativeHumidityMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
},
{
“component”: “main”,
“capability”: “battery”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
}
],
“actions”: [
{
“component”: “main”,
“capability”: “temperatureMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
},
{
“component”: “main”,
“capability”: “relativeHumidityMeasurement”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
},
{
“component”: “main”,
“capability”: “battery”,
“version”: 1,
“values”: ,
“patch”: ,
“visibleCondition”: null
}
]
},
“vid”: “zzz”,
“mnmn”: “SmartThingsCommunity”
}

Change the zzz vid above in the json file with your own handler ID. (you can pick this up from the IDE → device handler → open ui and take it from the url, it should something like “3ce46925-p9iy-o087-a6a7-00bb6020be99”
Then you need to save it as config.json and download the cli from Releases · SmartThingsCommunity/smartthings-cli · GitHub.

Then, once you unzip it, just run the command

cli-win.exe presentation:device-config:create --input=config.json

It will create the json file and at the end of the command you will see the new vid. Copy that one (it should be different to the zzz vid above in the json, but still a vid, let’s call it a presentation vid, i.e. yyy vid).

Then go back again on the IDE and change your handler as such:
definition (name: “Xiaomi Aqara Temperature Humidity Sensor”, author: “bspranger”, namespace: “bspranger”, mnmn:“SmartThingsCommunity”, vid:“yyy”)
Put your presentation vid instead of yyy.

Alrighty then! Next figure out how to add this to device settings in App so user can select which value to show in main tile. Then update the App (or all device handlers or whatever) to include this. After that we have stepped a tiny bit towards more user friendly and usable system :wink: