[OBSOLETE] Universal Virtual Device Type and Translator

Weird, something with search in IDE - maybe the quote character? It was there. Oh, and it works!

Don’t suppose you can include that in future versions so I can stay updated without making changes?

don’t have any plans to update it, and have no development time currently, just hanging around to answer questions at this point!

4 Likes

Thank you Mike!

1 Like

I’m using maxwell’s universal DTH from MikeMaxwell/dth/blob/master/devicetypes/mikemaxwell/udth.src/udth.groovy, which I absolutely love (and will donate).

However, I’m having one problem. I can use the Smartthings Android App and enable / disable the switch, but the switch is NOT showing as one of the current states in the IDE. I see “motion” and “presence” in the IDE but NOT switch, while I see "motion, “presence” and “switch” in the Android Smartthings app.

Also, when I look at the event logs for the device in the IDE, I never see switch events, only motion and presence.
I see in the reading that this could be an issue with the “switch” functionality NOT implemented in the handler. However, it looks right to me and I don’t see anyone else having this issue with the device handler.

I have enabled the "Switch (on, off), Motion, and Presence in the Smartthings Device UI, and I can see in the UI these three elements are enabled. (Since I’m a new user, I can only upload one screen shot). However, in the IDE, the “switch” is NOT a “current state”.

This is important to me, since the device will NOT properly integrate into ActionTiles without consistency between the UI and IDE.

this dth wasn’t designed to sent switch state events, you can easily add this to your version.

Find line 359 (sendEvent(name: “uDTH”, value: “on” ,displayed: false)), add this after it:
sendEvent(name: “switch”, value: “on” ,displayed: true)

Find this line(sendEvent(name: “uDTH”, value: “off” ,displayed: false)), should be around 370, add this after it:
sendEvent(name: “switch”, value: “on” ,displayed: true)

Thank you.

Thanks Mike. Love the universal handler. What is the link so I can donate to your opensource projects?

thanks for the feedback, no donations required!

1 Like

Just found this tread trying to make IFTTT work with virtual door sensor. Is there a way to have uDTH appear in smartthings app as a sensor, not a switch? Right now it appears as a socket, which can change open/close state if I accidentally tap it. I’m looking for a way to allow only apps (i.e. IFTTT) to change its status. For the ST app, it should appear as a door/window sensor and be read-only. Is there a way to do this?

Thank you!

Thanks for the Device Type. I have found it very useful. I am just trying to use it as a presence sensor using my FING box and IFTTT integration to identify who is home based upon be connected to Wi-fi. So far so good with the integration. I was wondering if you had given any thought to putting in pictures for icons?So i could pictures of each family member as the icon, versus a generic icon?

Thanks again!

1 Like

I installed the DTH…whats the next step to using it when I open the app?

Sorry for the stupid question.

You have to install an instance of it, like any other smartapp. Go to the marketplace tab then look under the “my apps” category. That’s where any smartapps that you publish from the ide will show up in the mobile app.

2 Likes

A quick question here. I am using the uDTH as a virtual switch for my Leeo Smart Alert sensor. I have two instances of the DTH, one for the Smoke/CO Alarms and one for the water leak alarm. Both of those are working great (this is an awesome DTH).

The issue I am having is that, even though I have the Lock function disabled in the “Device Inputs” section of the settings of the two virtual switches, they are still showing up as locks in the new Smart Locks app with an UNKNOWN status. Any suggestions on how to get those virtual switches to not show up as locks in Smart Locks?

Sorry if this was asked and I missed it:

I’ve added a virtual device to SmartThings and the Amazon Alexa app recognizes it as lock, but Alexa shows gets error when it tries to get status both in the app and via voice command.

Also, devices tied to the device handler show up on the SmartThings home screen under Home Solutions -> Smart Locks as always unlocked.

Is it possible to get Alexa to get the lock status?

Thanks for the device handler.

FYI, I have a work around for Alexa and here is the case I’m using:

I was able to get a single door status in Alexa by just using a Simulated Lock virtual device and the Enhanced Auto Lock Door automation tied to a single door sensor. This works well and Alexa can tell me if the door or window is locked (really closed) or unlocked (open).

I wanted a single “Lock” to check if all the doors/windows are closed, but the auto lock door routine only takes 1 sensor and while other automation functions like the Smart Lighting can take multiple sensors they only turn a switch on/off and not toggle the state of a sensor. This device handler is a good bridge because it accepts the switch commands as inputs and reports out a sensor status.

With this device handler I created a virtual device “AD” (all doors).
Then I added a “Smart Lighting” automation so that if any of the doors is opened (door sensors), then “AD” is switched to open/on/unlocked. When a door is closed, the routine closes “AD”.
Alexa can see the device but it doesn’t see the status right.
The work around is to add another virtual device (a Simulated Lock) and the automation “Enhanced Auto Lock Door”. The automation takes a contact sensor (which can be “AD”) and changes the status on the Simulated Lock. If Alexa sees the correct status from AD, I could junk the extra simulated lock.

Also, I need to find or write a different automation routine to combine multiple sensors into 1 state. The desired state is to shows open if ANY of the doors is open and closed only if ALL of the doors are closed.
Right now if I open 2 doors an close 1 “All Doors” shows closed, which isn’t desired.

Based on a previous answer Mike provided I was able to find a solution:

find this line in the code: sendEvent(name: “uDTH”, value: “on” ,displayed: false)
add this line under it: sendEvent(name: “lock”, value: “unlocked”, displayed: false)
then find this line in the code: sendEvent(name: “uDTH”, value: “off” ,displayed: false)
add this under it: sendEvent(name: “lock”, value: “locked”, displayed: false)

I’m trying to figure this out. I want to make a door switch a motion sensor to trigger a light. Reason being is that if it is registered as a motion detector I can have it shut off after x amount of minutes which isn’t easy as a regular door sensor

Do you mean you want a light to turn on in response to a door opening (or closing), and then wait x minutes before the light turns off?

There are better ways to do that.

yes, that is what I am trying to do. I want it so the light triggers on with a door opening and then turns off x amount of minutes later regardless of the door opening or closing again.

This wiki post explains how to do it with a virtual switch as the off timer.

http://thingsthataresmart.wiki/index.php?title=How_to_create_a_virtual_timer_for_a_light

And this post covers pretty much anything else related to creating automations. This could be done easily with WebCoRE, for example.

Somebody posted that and I did look at that page. However, it lists an older version of the smartthings app, before my time with ST, and in that app there is a power allowance option to set the minutes. The newer version does not have this feature that I could find.