SmartThings Community

FAQ: An Overview of Using Custom Code in SmartThings (SmartThings Classic)


#24

JDRoberts, how do I remove a custom device handler created in error?


#25
  1. make sure there are no devices assigned to that device type handler

  2. choose My Device Handlers and click on the details button to the left of the device type handler that you want to delete. This will bring up its details page.

  1. there will be a delete button at the bottom of the details page


(Jeff) #26

So I copied the DTH code and published it to my library. When I go the to device in the IDE and edit it, I don’t see anywhere to link the device to the handler. First time using any of this, so thanks in advance for the help.


#27

The process for steps DTH five and six has changed slightly since this was written and I can no longer edit the first post.

DTH5a) Select “My Devices.” This will show the list of your devices.

DTH5b) click on the display name of the device that you want to assign to your new device type handler. This will open up its details page.

DTH5c) click on the “edit” button at the bottom left of the details page.

Now you can complete DTH6) and edit the device details so that it uses your new device type handler.


(Jeff) #28

Thanks @JDRoberts.
I didn’t realize the new DTH was at the bottom of the list. I thought I was changing the device itself under the type* scroll box. Then I saw the new codes name at the bottom. Much appreciated.


#29

How do you “Edit the Device so that it uses that device type handler”. I have created the DTH and published it. When I select the device that should use it I don’t see a way to specify the DTH.


#30

See the update in post 27, two above yours.


#31

When I go to edit the device I don’t see any option to specify the DTH.

The fields are Name, Label, Zigbee ID, Network Device ID, Type, Version, Hub and Group


#32

SmartThings keeps changing its own terminology. It can definitely get confusing.

“Type” = “Device Type” = “Device Type Handler”= “Device Handler” = “DTH” = “DT” = “DH”

All the same thing.


(Deepak Krishnan) #33

@JDRoberts. Greats post!
Can you help with how to attach a child DTH to a device and also is it possible to have 2 DTH for 1 device? I saw a post earlier where a developer provided 2 DTH and recommended to attach both to the same device…


#34

It is not possible to use two device type handlers at the same time for a single device. I suggest you post a reply to the post you are referring to and ask the developer for more clarification.

Parent and Child Device Type Handlers are created when a device type handler is identified as a “composite” device. The device type handler for the parent device will have code that automatically creates a “child instance” for each child device. It’s easiest to understand this by looking at an example.

Consider the Zooz Power Strip. The strip is a composite device with five individual sockets. The parent device type handler will create the child instance for each of the five sockets when the power strip is paired to your smartthings hub.

So when you choose a device type handler for the composite device, then you will automatically get the device type handlers for its children. You only pair the power strip once to your account, but you will end up with an individual device tile for each of the individual sockets under the parent device in the SmartThings mobile app. This will allow you to turn each socket on and off individually. :sunglasses:

IMG_3761

For more information, see the developer documentation:

http://docs.smartthings.com/en/latest/composite-devices/index.html


(Deepak Krishnan) #35

Thanks @JDRoberts. i think the other post was misleading…Im trying to get the qubino 2 way relay as well as the on/off thermostat to work. managed to get the relays working with child device added but the thermostat is still a struggle.


(Cara Rynerson) #37

After some confusion, I figured out that IDE stands for the developer site I’m already in.

In what way do I edit the device to use the handler I just published?


(Cara Rynerson) #38

A little more digging, and I found the answer.
Click edit
Select Type
Scroll to the bottom of the drop down menu to find the custom handler and select it.
Click update


(Robin) #40

I created this video to guide users through the install process for the custom smartapps and device handler needed for webCoRE, but the principles explained can also be used for other smartapps and device handlers shared in a GitHub repository.

It also explains how to setup GitHub integration for those of us on the ST EU servers.


(Scott Cline) #41

Great post


(Michael Deffendall) #42

Thanks @JDRoberts. Just diving into the ST world. Most of my smart devices were from Lowes and was using their Iris system. I have successfully moved most of my Iris gear over to ST. The only thing I haven’t found a DTH for is the Iris Smart Wifi switch. (https://support.irisbylowes.com/link/portal/30143/30206/Article/835/Iris-Wi-Fi-Smart-Switch). I saw some articles about it but I don’t think anyone’s completed anything yet.

My first project to install was the Automated Garage Door Opener app. It absolutely blew my mind away. I’m an old time techie and many many moons ago dabbled in programming so I found it very fascinating. And the more research I did on a topic, it seems I ran into a post by @JDRoberts. :slight_smile: So thank you for all you do for this community. It is very much like the computer user communities that existed “back in the day”.

Thanks again and best wishes.

Michael


(Michael Deffendall) #43

I just came up with a work around for the Iris Wi-Fi Smart switch. See how I did it here.


#44

March 2018 Update

There are now two mobile apps:

“SmartThings classic”

“SmartThings (Samsung connect),” which we are abbreviating STSC in the forum.

The process described in this FAQ will only make sense if you are using SmartThings classic.

At the time of this writing, STSC will not support custom device type handlers at all.

It will support custom smartapps, but only if you first add them through the SmartThings classic app.

We have not been given a timeline for when custom code will work with STSC. :disappointed_relieved:


#45

Very useful for understanding custom code, smart app and device handler. I was struggling to configure monoprice zwave motion sensor through my smarthings app. I tried to change the battery and unpair / repair countless of time, but it was always disconnecting randomly. One of my colleague sent me this link and I went through all post and comment. Changed device handler to Go control motion sensor and i didn’t have any problem since last 4 days… Kudos to you guys and making life little easier.