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
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.
I did what Mike said a long time ago. I have various versions all for specific tasks with unused stuff commented out. Can’t recall the exact line but it’s near the top, capabilities, then one other spot iirc.
Thank you for sharing this uDTH! I’ve created a Virtual Switch and I’m trying to use IFTTT to trigger this switch whenever my phone connects to my home network. For some reason, it’s not turning the Virtual Switch on when connected. For the IFTTT recipe, I’m using:
Android Device > Connects to a specific WiFi network > My Network Name
Smartthings > Switch On > Virtual Switch
I’ve already authorized IFTTT to control the switch through ST IDE. Any ideas why it’s not triggering?
Pretty new to STs here. I got uDTH to show up under “My Device Handlers” from github on the ST IDE, but when going to my ST mobile app “Marketplace” > “SmartApps” tab > “My Apps” I cannot find uDTH. Any help is appreciated!
Note: On the ST IDE, uDTH is showing up as blue under “My Device Handlers” and doesn’t show up under “My SmartApps”