Question about the apply of DTH (stale DTH issue)

After I modify the DTH file, or change the DTH for a device, I found that if the device is not re-bound, the modified display effect may not take effect on the device. Often part of the old display effect is retained-so that we can not be sure whether it is the DTH effective problem or we have a problem with the preparation of the DTH file. Is there any good way to make the DTH file effective immediately on the device?

Only sure-fire way I know of is to keep creating totally new versions of the DTH (copy/paste into a new one like “TestHandler2”) and then set your test device to that new handler. Kinda sucks but at least that reliably works.

:joy:I have heard of this method a long time ago, and I have been looking forward to an efficient method. Nevertheless, thank you very much for your reply!

You can also solve this problem by creating a presentation(=vid) and specify that vid in the preexisting DTH.

Background information:
If you don’t specify vid in the DTH, then it will use automatically generated presentation based on the capability defined in the DTH.

The problem is, once auto-generated presentation is created, it is bound to the name of the DTH, and it never gets updated even if you change the capability list in the DTH. That’s why you’re having this problem.

2 Likes

Thanks! Does this mean that if the interface is updated, I only need to update the previously created VID (presentation) to achieve the purpose of the update? Can updating the content of the presentation corresponding to a VID achieve the purpose of updating the interface?

If you change the content of the “custom presentation”, vid(=the uuid string) will change.

You will create a vid by using following command.

$ smartthings presentation:device-config:create -j -i deviceConfig.json

Let’s say that you change the content of the deviceConfig.json, then
vid, as the output of the command above, will change.

Yes, I just tested it. As long as you make good use of the VID and the interface is updated, update the VID. The new interface effect is synchronized to the device-this VID should be designed to solve the above problems.