Vid vs. ocfDeviceType?

Still going through the migration pain and trying to update some custom DTHs. I’m sure this information is scattered about, but can someone explain the difference between vid and ocfDeviceType as far as the new app is concerned.

More specifically, what attribute determines what device attribute the new app displays on the mini-tile for a device? For example, I use @storageanarchy 's excellent ecobee suite, but the remote sensors display as motion sensors, and I would like them to show temp, etc… Thanks!

Don’t waste your time - I have tried for 2+ years to fix the sensor display in the new SmartThings app. It can’t be done because SmartThings hasn’t created definitions for a Temp & Motion sensor, only Motion & Temp…

Sorry

2 Likes

TL;DR - “vid”.

When used in a Groovy DTH the ‘ocfDeviceType’ affects the icon used for a device when it isn’t explicitly defined in the ‘vid’.

The ‘vid’ is an identifier that seems to have been an acronym for ‘vendor ID’ - a code uniquely identifying a particular device belonging to an organisation or manufacturer - but is now a backcronym for the more community friendly ‘visualization ID’, or similar. It does the same job either way. It is used to identify a particular ‘device presentation’ (also known as a ‘presentation resource’ or ‘UI manifest’) which is a JSON file, about 100k big, that defines how the device should appear on the dashboard, detail pages and when building automations. It includes all the internationalization of texts which is why it is that kind of size.

The app will download the ‘vid’ and use that as the basic instructions for what appears. The actual design and rendering is performed by a ‘plugin’. It has been observed, often by me when I am particularly grumpy, that the plugin sometimes has a rather liberal interpretation of the instructions.

Anyway, to get the attribute you want on the dashboard tile you need to use a ‘vid’ that puts it there. That means copying one from a device handler that has the same capabilities and does what you want, or building one if you know how (it isn’t difficult, just not particularly common knowledge yet). Once you have a suitable tool installed - the CLI is particular helpful - you can get it done in five minutes.

3 Likes

Thanks @orangebucket for the explanation. Would you be so kind to link or point me to the page(s) in the developers documentation that I can reference to create a vid using the CLI or any alternative methods (ie… examples, DTH’s with a temperature vid…

1 Like

The CLI is available on the SmartThingsCommunity repository.

The particular process you go through is described in this post:

1 Like

Thanks @orangebucket for this help… I am reading the vid presentation section right now!

I also found this link for referencing existing vids, trying it now in one of my custom DTH’s for Ambient Weather Station which has been crushed in the new UI…

https://vid-selector.glitch.me/

Damn. That sucks. All this time I thought you just loved laggy ecobee motion ;). Thanks for the speedy reply big cat.

If you are trying to migrate your existing groovy DTH to the new platform using custom capabilities, please create a new topic here with the app name

https://community.smartthings.com/c/developer-programs/projects/

BTW. Still confused. But the best description I’ve read. Many thanks. The new app ecosystem has a long way to go; especially for weekend devs like myself.

Also @kurtsanders this is a better getting started guide for the CLI

1 Like

Please do go and create a topic in the projects section outlining what you are trying to do then. We can only improve with feedback and we do want to keep our community developers happy and healthy.

And yet why can’t a bona fide kick ass pro like @storageanarchy get the new app to do what it should?

(yeah, I’m cranky post migration)

I don’t know what this means

And that means we have gaps. We haven’t had the CLI or custom capabilities available for two years so I don’t think this is related. @storageanarchy can elaborate more and we can try to get a resolution.

It means that something that should be super basic, like choosing the primary attribute for a device is absurdly complex or cannot evidently be accomplished. Take a look at his DTH, are we missing something?

Perhaps even it would be preferable to let the user choose the primary attribute for a device. And maybe also store that to a cloud along with all the room/favorite preferences (that aren’t currently stored) so that if you ever have to reinstall the app or something goes array you aren’t saddled with hours of re-customization.

I realize that you guys are trying to move to something bigger, greater, and more mature, but the road so far has been paved with potholes and manure.

3 Likes

@storageanarchy. I was able to get the temperature to display on the sensor tile by changing the DTH code to:

    vid:          	"generic-temperature-measurement",        // for the new Samsung (Connect) app
    ocfDeviceType:	["x.com.st.d.sensor.temperature", "x.com.st.d.sensor.motion"],
    cstHandler:     true, 

… and manually changing the DTH in the Graph API to the stock ecobee sensor and then back to your DTH (which I assume causes the cache to reset). Only issue I’m having now, it motion is no longer displayed in the device details, but I really don’t care about that. Guessing my ocfDeviceType array isn’t correct to display both. They must have done some sort of back end fix to get the temp vid to work.

@swamplynx Try using:

       mnmn:         	"SmartThingsCommunity",          // for the new Samsung (Connect) app
        vid:          	"4a31c6b1-57cf-3591-bc17-dfb07e1d9641",        // for the new Samsung (Connect) app

I think that should get you temperature on the dashboard and both temperature and motion on the detail.

Yeah, I think you need to pick one or the other for what you want the icon on the dashboard to be.

1 Like

Thanks! That did it! How did you figure out that sorcery? From the CLI?

Yup. The CLI is fine right now if you’re just arranging stock capabilities. Custom capabilities are another story at the moment… seemed promising when they were working though.

1 Like

One other quick Q @philh30. Is writing my own JSON and using the CLI The only way to generate the VID, or is there a visual means through new Dev Dashboard?

I feel like a n00b all over again and will obviously have to eventually dive into the new API fully for my own DTHs…

I think it’s the CLI and the API right now, but I’ve only messed with the CLI.