[OBSOLETE] Universal Virtual Device Type and Translator

This has got to be the sickest DTH ever…
The uDTH

Ever wished you could turn on a presence sensor with a switch?, or maybe take a lock command and send a motion event?

Basically this bad boy accepts these commands:

  • on
  • off
  • open
  • close
  • lock
  • unlock

and can turn them into these attribute states:

  • open
  • closed
  • present
  • not present
  • active
  • inactive

The following capabilities are presented on the command side:

  • switch
  • door control
  • garage door control
  • lock

The following devices are presented on the attribute side:

  • Contact
  • Motion
  • Presence
  • Door
  • Acceleration
  • Illuminance
  • Smoke
  • Water
  • Sound

You wire up an instance of this device to two separate apps, and off you go.

Add to your repo, and select the device MikeMaxwell : uDTH
the repo is
owner: MikeMaxwell
name: dth

For those without git integration:

Version updates:
uDTH 1.0.3 2016-05-18 added optional auto off
uDTH 1.0.4 2016-05-21 added LUX capability
uDTH 1.0.5 2016-08-29 added sensor and actuator capabilities
uDTH 1.0.7 2016-09-22

  • added smoke, water and sound thanks Scott!
  • added not used option to each device tile
  • fixed bug in illuminance not working
Combining physical devices into one virtual device
CoRE and Piston Rules Engine, first design steps
New stability for SHM. Integrated alarm in my future? Thoughts
IFTT Integration Questions
Virtual Motion Detector - Where do I start?
Multiple Sensors - Merge into a single virtual sensor
How to activate a virtual motion sensor with a virtual switch?
CoRE and Piston Rules Engine, first design steps
SmartThings + Scout Professional Monitoring Now Available
Device Handler for On/Off + Dimmer + Presence switch?
Smart Home Monitor - open status improvements
Setting a contact sensor's value
CoRE - Get peer assistance here with setting up Pistons
Multiple (two) hubs on one network?
ST Multi Sensor as Glass Break/Motion for SHM
Raspberry Pi Garage Door Status/Control
Abode Security and SmartThings via IFTTT
[OBSOLETE] ColorCast - Color Changing Weather Lamp
Controlling SmartHome Monitor with a switch?
How to use Tasker/Automagic/SharpTools to integrate with other apps
Home Insurance Discounts? Unmonitored, monitored? California
CoRE - Get peer assistance here with setting up Pistons
2 Hubs on one network
Turn off thermostats and fans when smoke
New Smartthings user, love it, few questions for ya on use as a security system
Door/temp sensor as a "thermostat"?
Challenge: get Google Home (or Alexa) to recognize sensor status as a switch status
Change labels of child device programatically?
Hue bulbs as motion sensor device driver?
Capturing Motion and door multisensor sequence to turn a light on based on direction of travel?
Yale Smartphone Alarm System integration
Converting a Door/Window sensor into an button
[OBSOLETE] MyQ Lite Door and Lamp Control (for Liftmaster/Chamberlain)
[OBSOLETE] Lowes Iris and XFinity CentraLite keypad DTH + Apps
Kuna Motion Detection with DD-WRT
Reverse an Iris contact sensor
[RELEASE] ActionTiles, the homepage for your SmartThings home!
Smart smoke detectors
My Smarthings works with Alexa, My fan works with Alexa, how do I get my fan to work with SmartThings?
Fibaro RGBW controller as a open close sensor instead of on/off?
Motion Sensor is a Door
Blink support discontinued!
Bosch ISW-ZDL1-WP11G: Cats keep Triggering it. Any ideas?
Fix for Android presence arrival problems
[DEPRECATED] Free Ecobee Suite, Version 1.2.*
Fix for Android presence arrival problems
Leeo Smart Alert - Integrate non Z-Wave smoke detectors with ST
Arming Alarm Via Amazon Echo?
How to Add Smart Alarm Events to the Smart Home Monitor Dashboard
SmartTiles v5.8: Deployed to Blue & Green Editions. Release notes, etc. (follow this Topic for updates...)
SmartTiles v5.8: Deployed to Blue & Green Editions. Release notes, etc. (follow this Topic for updates...)
Open/close a virtual door by opening/closing a virtual switch
Make Alexa wake up and say something?
How to Get Arlo Camera to start recording on Button Pressed?
[ST Edge] vEdge Creator: a virtual device generator for end users
[DEPRECATED] Blink Camera Device Handler with Motion Sensor, Live Video Streaming, Integration with SmartThings/SHM, Temperature, Signals and Push Notifications
FAQ: The Many Ways of Detecting Presence (2020)
[OBSOLETE] Node Red Bridge for X-10 Devices (Switches, Modules, Remotes, Sensors and Security Modules)
[RELEASE] ActionTiles, the homepage for your SmartThings home!
[RELEASE] ActionTiles, the homepage for your SmartThings home!
New(?) Way To Monitor A Dumb Deadbolt Lock
Fire Alarm Panel Monitoring with contact sensor—how to report as a different device class?
Switch Handler NOT populated for Universal DTH
Dry Contact with Specific Purpose?
Is there a way to easily just make lightning scenes without Core?
Abode contact sensors replacing ST (Iris) sensors
Using core to simulate motion?
Basement Lights Automation Help Needed
Virtual Device Ideas Thread
CoRE and Piston Rules Engine, first design steps
Changes to virtual contact sensor?
Ecolink window/door sensor (DWZWAVE2) as button device controller?
[RELEASE] D-Link Camera Manager (Connect) [Requires Classic App]
Guest mode?
Platform Update - Release Notes - 05/18/16
Z-wave repair showing ghost device

I’ve wanted to make this forever. I have contact sensors I want to act like motions… (they all should be by default IMO). If a door options, that’s motion!

Thanks for this!

1 Like

so you’re saying that setting this up will allow an opening door (contact sensor) to be seen as a motion action?

1 Like

Ok, I’m missing something. How do I wire it to my devices?

It accepts actuator inputs as these are commands. A device type can’t subscribe to other device events.
So this is more of a glue device to be used between two apps that don’t share a common device type.

1 Like

Ok… It’s a been a stupid long day for me…

example please?

1 Like

You could take the code and add it to a real device handler.
I can do this if there is interest with specific device types.
Converting an existing device type would be much easier that creating this one.
Just let me know which devices your interested in.

Take shm, the security section only accepts contact and motion sensors.
You could use another app to turn on this dth, and send a contact or motion event to shm.
You could use smart lighting to turn on this dth, then sent another type of event to any other app.
That type of thing.
It’s a virtual sensor who’s output is controlled by typical binary actuator commands.


Mike this is tooo cool, perfect for virtual presence and garage doors…Awesome, awesome work!

1 Like

Mike, can you add to every action if it’s already on, don’t turn it on, or if it’s off don’t turn it off? Or do you think I should do that via a custom app? I’d like to use Smart Lighting, but I notice that for motion, for example it fires the switch on constantly.

So for the inputs (on/off ect), do not send the output events unless the input state has changed?
If that’s the case, yea, let me know.

@SBDOBRESCU, I just pushed a patch for this, dorrrrr… this was the “intended” function all along.

1 Like

This is awesome! I see many uses for this… Thank you!

May I make a feature request for all those who connected their hard wired smoke alarms to open/close sensors and can’t use them in SHM? Capability for command “Smoke Detector”, attribute “alarmState”. (Hope I got this right and it is not more complicated than this…)

1 Like

Thanks Mike, couple more things. First would you be able to add versioning. Ive updated the device, but it still fires with every motion event see pic. Also, would it be possible to turn off the capabilities that are not used/enabled? I set one for garage control and it shows in the ‘Family’ section. This is esthetic more than functionality, really so no big deal if not possible.

alarm could be an input since it has commands (strobe, siren etc)
however contact only has attributes (open, close)
a device can read the attributes of another device (probably not intended), but it can’t subscribe to any device attribute changes like a smart app.
Now having said that, this DTH could in fact do this, but would require something to poll it, when the device is polled, it would then have a look at the contact sensor state, and then set the alarm attribute.

This isn’t ideal obviously, and the ability of one device to retrieve attributes from another device that’s been selected in the preferences section I believe is something of an unintended “feature”, that I’m guessing ST will prevent in the future.

The device capabilities that the device presents can’t be modified programmatically.
I can ignore any commands, but there’s no way to change them after the device is published.
The only way to remove them is to comment them out.

Can you tell me what you’ve got configured there?
is that a switch to motion converter?

I have the specific setup that you do, I hacked the contact DTH specifically to make it act like a smoke/CO device.
Depending on the contact that you have, these DTH’s may work for you too.
Let me know which DTH your contact sensors are currently using.

I love it. Turning what the security researchers call a risk, into a killer feature. Nice job Mike! This is awesome.


I use an old Schlage Sensor RS100HC V N N SL and a slightly modified a “z wave Door/Window Sensor” DTH. It has contact sensor, sensor, and battery capabilities (even though the Schlage sensor does not support battery)