I found that a input call can specify device.deviceTypeName. Can anyone give an example of what such a call would look like?
Letâs say youâve written a custom device type handler named âMy Cool Device Typeâ. Letâs also say your device does not expose âstandardâ capabilities like âswitchâ or âcontactSensorâ. So how do you select this device in your smart app? Turn out you can select devices using their device types instead of capabilities like this:
input "myCoolDevice", "device.myCoolDeviceType", title:"Which Cool Device?"
So does this mean that, for example, I could discriminate between "capability.momentary"
devices, and limit it to virtual ones by using "device.momentaryTileButton"
?
Yes, but the caveat here is that you can only select devices that have namespace that matches your appâs namespace. E.g. you cannot select devices published in âsmartthingsâ namespace.
aahâŚso I see a bit of an issue here. IF the device type contains a space, like many of the devices do, then they donât seem to be listed. I created a device type call âA B Câ and listed âdevice.A B Câ in the input method call but nothing listed. I changed to âABCâ and it worked. I was thinking of using device.typeName to list existing device types, but those spaces screw everything up. is there a workaround?
ummâŚI created the following:
definition (name: âblahmanâ, namespace: âsmartthingsâ, author: âSmartThingsâ)
it has the smartthings namespace and the device was listed.
Yes, you can have spaces in the device type name, like I showed in my example:
âMy Cool Device Typeâ â âdevice.myCoolDeviceTypeâ
Notice the lowercase âmâ.
No, canât do that. It has to be in your âprivateâ namespace.
So it doesnât look at the namespace the app is published under, just your âprivateâ namespace?
what about things like âSmartSense Open/Closed Sensorâ, what would be the device type name for that?
I tried device.smartSenseOpen/ClosedSensor but that doesnât work
I believe they have to match, but you also have to âownâ it, i.e. you cannot select devices published by someone else (i.e. smartthings). Even if you self-publish your app in âsmartthingsâ namespace, you cannot bind it to devices published by ST. Documentation is not very clear on this though.
EwâŚ
SmartThings device selection loses all itâs âswap-out / swap-inâ brand/model agnosticism when you use deviceTypeName instead of Capability name. Of course, with the Capabilities Taxonomy being stagnant, I guess it is not surprising that these special cases are desired.
Essentially, itâs a âbackdoorâ for creating custom devices that donât fit existing capability taxonomy. Thereâs nothing wrong with that, imho. I love backdoors
Just an update on this.
You can create a new device, based using the existing simulated devices that are already published by ST.
IDE/My Devices/Add new Device, then select the simulated device of choice.
I selected Simulated Motion Sensor.
Then in the smart App
type : "device.simulatedMotionSensor"
Note the casing as pointed out by @geko , this appears to be the key (and missing documentation ingredient @Jim )