| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
SmartThings device handler for virtual switches that double as open/closed sensors, which can be useful for automating Routines via Amazon Echo (aka Alexa).
SmartThings "Routines" can be used to automate various switches and modes. Routines can be automated by time, motion sensor activity, and open/closed sensors, but not switches. Amazon Echo (Alexa) can be used to turn on/off switches, but cannot currently trigger SmartThings routines directly. There are a number of ways to solve this, but most involve multiple SmartApps or virtual devices. For me, the "easiest thing that works" was to create a Virtual Switch that is also an Open/Closed Sensor. Adding this to "Things" means that we can now use Alexa to trigger the switch AND use the same switch's open/closed sensor to trigger a routine.
To use, you will need to copy this code once to make a device handler. Then, for each routine you want to automate, you will need to create an instance of the virtual open/closed tile and configure the routine to use it.
To create a device handler (Do this one time only):
To create a device instance and automate a routine (Do this once for each routine you want to automate with your Echo):
Automatically reset the switch from another routine (Optional):
Test the setup:
| Back | FazBrowse Home | New Git URL |