Was this helpful?
Like Post Dislike Post
Table of Contents

    Integrating SmartThings with Alexa Routines

    Integrating SmartThings with Alexa Routines
    Table of Contents Show More

    At present, one of the toughest tasks involves triggering Amazon Alexa routines by utilizing any device or condition from Samsung SmartThings.

    Currently, you have the option to connect Contact and Motion Sensors to Alexa for the purpose of activating Alexa Routines. But what happens when you want to start routines via a Leak Sensor, or need to account for variables such as temperature, humidity, and light conditions? Or think about setting off actions at a certain time of day when someone is at home?

    Let’s talk about it!

    Ways to Trigger Alexa Routines with SmartThings

    These are the kinds of requests I get each and every day on Automate Your Life. So, I went out and found a solution.

    Now, full credit to BJ Pierron who wrote this Device Handler code for a specialized device type that will allow you to do this.

    The simulated Alexa Switch code for SmartThings is provided by ‘bjpierron’: https://raw.githubusercontent.com/bjpierron/SmartThings-Alexa/master/devicetypes/bjpierron/simulated-alexa-switch.src/simulated-alexa-switch.groovy

    Simulated Alexa Switch by BJ Pierron

    /**
     *  Copyright 2015 SmartThings
     *
     *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
     *  in compliance with the License. You may obtain a copy of the License at:
     *
     *      http://www.apache.org/licenses/LICENSE-2.0
     *
     *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
     *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
     *  for the specific language governing permissions and limitations under the License.
     *
     */
    metadata {
    
        definition (name: "Simulated Alexa Switch", namespace: "bjpierron", author: "bjpierron") {
            capability "Switch"
            capability "Sensor"
            capability "Actuator"
            capability "Contact Sensor"	    		
        }
        
        simulator {
    		status "open": "contact:open"
    		status "closed": "contact:closed"
    	}
    
        tiles {
            standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {
                state "off", label: '${currentValue}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
                state "on", label: '${currentValue}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#00A0DC"
            }
            main "switch"
            details(["switch"])
        }
    }
    
    def parse(description) {
    }
    
    def on() {
        sendEvent(name: "switch", value: "on")
        sendEvent(name: "contact", value: "open")
    }
    
    def off() {
        sendEvent(name: "switch", value: "off")
        sendEvent(name: "contact", value: "closed")
    }

    Now, to implement all of this, it would help if you watch the video below. Check it out!

    How to Trigger Alexa Routines with Anything from SmartThings

    What can trigger an Alexa routine?

    A voice command, an alarm, a scheduled time, or a smart home device interaction can trigger an Alexa routine.

    Routines save you time by grouping together a bunch of actions so you don’t have to ask for each one individually. You can activate routines via voice, time, or with your smart devices, and more.

    You should check out the Featured Routine in the Alexa App to find out more!

    Why won’t Alexa do my routine?

    The reason why your Alexa Routine may not be working is, perhaps it wasn’t enabled.

    So, to enable the Alexa Routine, here are a few fixes you should try:

    • Make sure your device isn’t muted.
    • Test your Alexa Routine.
    • Check the trigger phase.
    • Check the devices listed in the routine.
    • Reboot your device.

    If you’re planning to buy Alexa at Walmart, I have created this short guide for you. Read it!

    In Summary

    You can trigger Alexa Routines with SmartThings via voice, time of the day, or a smart device. Make sure your Routine is activated to ensure it’s going to work.

    I suggest watching a few video tutorials to learn how to integrate the Routine into SmartThings. Also, feel free to reach out to us if you need help!

    Was this helpful?
    Like the post Dislike the post
    PREV
    NEXT

    Share this post

    7 comments on “Integrating SmartThings with Alexa Routines

    1. Automate Your Life
      Aur-El April 1, 2022

      Thank you so much guys! I was able to modify the code to also acts as a motion sensor, now i can use all my Echo paired Zigbee devices into the smarthings app.

    2. Automate Your Life
      Mike January 12, 2022

      I tried the above fix. I was able to get the device handler and the device uploaded. When I go to the app the simulated switch does not show in routines. It does show up as a device. There is a note at the bottom of the list of available devices that says devices without available conditions aren’t shown. Any suggestions?

    3. Automate Your Life
      Ankur January 5, 2022

      Thanks Alan, appreciate your work – this is super helpful. This works well with almost all devices. The only routine I am not able to run is getting Alexa to open garage door or driveway using a YoLink controller (i.e. as a trigger switch instead of a passive switch). This may be an Alexa restriction. Because when I go to create an Alexa routine where ST virtual switch triggers a YoLink controller in Alexa, it shows that my only option is to CLOSE the YoLink garage/driveway controller, with no option to OPEN.
      So it’s great if I forgot to close the garage and need to close it. But not if I lost my physical controller and want to open it from ST app.

    4. Automate Your Life
      Tom April 27, 2021

      This is nice, simple, and just what I needed! THANKS!!

      1. Automate Your Life
        Alan Varughese May 22, 2021

        You’re welcome Tom!

    5. Automate Your Life
      John November 19, 2020

      Works GREAT!!!! I’m new to the smart game. I have a lot of different products that are all now work with Alexa now!

      Thanks

      1. Automate Your Life
        Alan November 19, 2020

        That’s great John. It’s exciting to see everything start to work!

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Send feedback to automate your life

    Describe your feedback



      We appreciate you taking the time to share your feedback about this page with us.

      Whether it's praise for something good, or ideas to improve something that isn't quite right, we're excited to hear from you.

      Live Smart