[OBSOLETE] Universal Virtual Device Type and Translator

And my first use case went in! When my teenager comes home and opens door, flip uDTH presence on, but only if uDTH lux is equal or greater than 50 (meaning he is not already home). Works very well. Thanks Mike!

1 Like

Thanks so much for this, this is totally a game-changer now for IFTTT integration. I was able to use my Dog’s Whistle GPS Tracker, which sends emails to GMAIL, to then have it flip the switch side of the virtual device off and on, based on email subject and from information to setup a presence device for the dog. No more secondary SmartThings Presence Sensor on his collar now!

4 Likes

Great device handler.

Any chance you would be able to add acceleration as a command it accepts? I’d like to turn it into motion.

I’d like to have SHM see the acceleration on a ST multisensor. I use them on european ‘tilt and turn’ windows and would like SHM to monitor if they are moved when open and in the tilt position.

Acceleration is an attribute, active in active. There isn’t a command for acceleration, so this isn’t possible using this device type.
A switch has commands, on off, and attributes, on and off.
Attributes represent the state of a device, a command is something you tell a device to do, which also changes its state. The acceleration capability has no commands.

Thanks for the reply. Had no idea until you explained it, but makes sense.

This is incredible. the idea was given for using this and CoRE as a delay for SHM.

Using CoRE to tie all door contact sensors into one virtual device, and using SHM to monitor that single V device.

Possible?

Yea, not up to speed on all the piston lingo, so can’t tell you exactly how to do it.
CoRE would take the contacts, and turn them into an on/off action against a uDTH instance, uDTH would present that switch input as a contact output that you would use in SHM

Just posted this topic in dev thread: Do you think your Universal DH would work for my situation? What I have is working, I just wonder if it would solve my “problem” (its not really causing any issues…yet) below.
Thanks Mike.

I have an issue I’m not sure how to solve.
Back story: I have a hard wired alarm system with door and window sensors and one, very good motion sensor. I purchased many boxes of GoControl kits (2 contacts and 1 motion). I decided to play with the idea of hard wiring the contacts into my alarm panel, one contact per zone. Well, it worked. Very well I might add. So I got cocky and added one to the motion zone. It too worked. But as you might guess, in SmartThings app, instead of showing “motion or no motion” it showed “open or closed”. Not a big deal but I thought I might try and fix it. I edited the device handler and changed every instance of open to motion and closed to no motion. I updated the handler and it worked. Except for one thing. In SHM, I have two instances of the device. 1 that reads open or closed,(it thinks its a contact) the other motion/no motion. This does not show as a device anywhere else but in the SHM under Right Now tab and it shows up on SmartTiles. It does not show in the IDE at all. Even in the log of the device it only shows one instance of the device as motion/no motion. Any Idea how to get this “Ghost” out of those two areas? It really does no harm. I should also mention that where it does show as a contact, it does not respond to anything. In other words, it does not register as open or closed. It does nothing.
Anyone have any thoughts on this? Let me know if you want to see the DH and I’ll post.

did you remove capability “Contact Sensor” from the definition section of modified DTH?

Thanks for the quick reply.
I did.
definition (name: “Z-Wave Motion Sensor Relay”, namespace: “smartthings”, author: “James”) {
capability "Motion Sensor"
capability "Sensor"
capability "Battery"
capability “Configuration”

Basically, what I did was use the Z-Wave Door/Window Sensor DH found in the Create New Device Handler Templates, did a text search for open, close, contact…and changed them to what I wanted.
I’m no coder by any means. Most of this seems fairly straight forward. But there is much I have no idea what I’m looking at.
I’m wondering since I had already added the device as a contact, then changed it to a motion with a new DH, if that basically orphaned some code in my online cloud or hub? Your basic FUBAR

I’ve done just what you did without issue.
Given the device only shows up in SHM, I would switch over from all devices to selecting the actual devices then maybe back again, and see if the contact drops out of SHM.

Well, I did what you said. It did drop off when going to all devices. I learned that when you switch back to individual devices, it keeps your last setup. So I didn’t have to re-select my devices. Bad news is, it also kept the “ghost” contact sensor. I think we’re on the right track here. Somehow need to reset SHM and start from scratch. This also shows up in Smarttiles, but I’m not worried with that till v6 is out. It’s too much of a PITA right now working with the login thing.

On a side note, the more I look at your uDTH and read others use cases, the more my mind is exploding. I’m thinking about all the trouble I can get into with this. See what I can screw up now.

1 Like

How do I use this device type? I have added it to my Device Handler. Now what do I do to use it?

You turn it on and off from a smart app, it then pretends to be a motion detector that you then can use in another smart app (as one example).

So more than a month later, I cobbled together a script that checks other members of the household’s IP address and I was able to use the uDTH to create a more reliable virtual presence using this and CoRE’s IFTTT capablity. This rocks! :clap:

2 Likes

I still haven’t figured out how to use it with an app. I am missing something very basic.

My use case is pretty simple compared to what others are probably using it for.

So the obvious first step would be go to the github page and copy the raw code and then in IDE create a new Device Type Handler, select From Code and paste the code you got from the github repository. You may be familiar with these steps already but it might be useful for someone else that comes along.

I then went to Devices and created a Virtual Device, with my choice of Name, Device Network ID and pick your Location and Hub. Under the Type drop down is where you select uDTH, once done, click Create and you’ve created your virtual device using udth.

Now on the ST App on your phone, you’ll find the new device you created, launch it and click the gear, then you’ll be presented with the options of what you want the device to do. In my case I selected the input of ON/OFF and then for the device to report Present/Not Present to create a virtual presence based off a switch.

This switch I turn on/off with CoRE or any other smart app that can flip a switch :slight_smile:

I hope that helps.

2 Likes

And that is the step I was missing. Thanks.

Hi all
I’m trying to get this to work with CoRE as and on/off switch.
But in CoRE and make a Condition, I select Switch, and then the created device using this DH.
Then in Comparison I select “is”, and in Value I select “on”.

But even if the virtual switch is “On”, then CoRE condition evaluation says “false”.

So it’s like CoRE doesn’t understand if the switch is on or off.

Any ideas?

So it to work, BUT not as I wanted.

I enabled en motionsensor capability, and then in CoRE tested on that, and that worked.

But why doesn’t the switch itself?
Or isn’t it suppose to?