SmartThings Community

How to: SmartThings_MyQ SmartApp using MyQ Sensors with IFTTT


#1

MyQ for LiftMaster and Chamberlain is not directly supported by Smartthings, so the only way to make it work is by using a SmartApp called SmartThings_MyQ created by brbeaird. SmartThings_MyQ SmartApp works great to open and close the door, but it does not have the ability to natively monitor the MyQ open/closed status. SmartThings_MyQ has a nice feature that allows the ability to add smart tilt sensors to a MyQ controlled garage door for monitoring open/closed status. Smart tilt door sensors can add up in cost depending on how many doors you have and they are not always reliable. Recently MyQ added a premium service feature to support various partner integrations with MyQ. Unfortunately, SmartThings was not one included in the smart partnership, but IFTTT was a selected partner. The service is considered a premium service and cost month or yearly. The cost is only $1/month or $10/year, which can be cheaper than buying smart door tilt sensors with the added bonus of accurate open/closed status. It comes with a 1 month trial.

This guide will explain the steps required to set up your MyQ door sensor status into SmartThings_MyQ SmartApp. If you have questions about setting up SmartThings_MyQ please search the SmartThings community or brbeaird’s Github for additional setup information.

Requirements:

Note1: SmartThings_MyQ SmartApp only supports the ability to add sensors for close/open status.

Note2: IFTTT only supports the ability to add SmartThings switches, locks, and siren/strobes for actions.

The SmartThings_MyQ and IFTTT device compatibility limitations (see Note1 & Note2) requires the need for an all-in-one "simulated (virtual) switch and contact sensor" device. Natively SmartThings does not have a device that can simulate a switch and contact sensor as one. Fortunately, SmartThings gives users the ability to create "device handlers" for use in SmartThings. This section will be the most custom part of the deployment, but since you already setup SmartThings_MyQ you will know most the steps required.

Step 1: Create Device Handler

Here you will create the device handler that will act as an all-in-one switch and contact sensor.

  • 1.1: Login to: https://account.smartthings.com and click “My Locations” and select the location name where the garage door resides.

  • 1.2: Click "My Device Handler"

  • 1.3: Click "Create New Device Handler"
    image

  • 1.4: Select "From Template"

  • 1.4.2: Checkbox: "Contact Sensor"

  • 1.4.3: Checkbox: "Switch"

  • 1.4.4: Click "Create"

  • 1.5: Now you will see all the pre-built code after clicking create. You need to replace lines 40-49 with the code below.

// handle commands

def on() {

log.debug "Turning Switch and Sensor On"

sendEvent(name: "switch", value: "on", isStateChange: true, display: true, displayed: true)

sendEvent(name: "contact", value: "open", isStateChange: true, display: true, displayed: true)

}

def off() {

log.debug "Turning Switch and Sensor Off"

sendEvent(name: "switch", value: "off", isStateChange: true, display: true, displayed: true)

sendEvent(name: "contact", value: "closed", isStateChange: true, display: true, displayed: true)

}

Before:

image

After: 

  • 1.6: Click "Save" and then Click "Publish" --> "For Me"
    image

Step 2: Create Device

This step will create your simulated switch/sensor device. You will build one for each garage door opener you have.

  • 2.1: Click "My Devices" at the top of the screen

  • 2.2: Click "New Device"
    image

  • 2.2.1: Here you will name your simulated switch/sensor device. I personally like to name mine with "DO NOT PRESS - Simulated 1 Car Garage Door Switch and Sensor", but you can name the simulated switch any name you would like. Also, the "Device Network ID*" just needs to be unique from any other device. I like to use the same name as the switch with no spaces.
    image

  • 2.2.2: Now under type, you will click the drop down and search for the name of the device handler you created in step 1.
    image

  • 2.2.3: Under Version select "Published" and under Location Hub select your location and hub information.

  • 2.2.4: Click "Create"

Step 3: Setup IFTTT Applet

Note: Premium subscription needs setup for MyQ + IFTTT before continuing. See requirements section for the link.

  • 3.1: Log into IFTTT’s website and click on “My Applets”.

  • 3.2: Now select "Services" and search for SmartThings

    • 3.2.1: SmartThings Not Connected to IFTTT?: If you have not connected IFTTT to your SmartThings you will do that at this point. During the setup process, you will select the simulated switch/sensor device you created in step 2. You will only need to select the one listed under “switch”. Don’t worry about selecting the one under “sensor”.

    • 3.2.2: SmartThings Connected to IFTTT?: If you already have SmartThings connected to IFTTT you will need to edit the settings and allow the newly created simulated switch/sensor device from step 2. You will only need to select the one listed under “switch”. Don’t worry about selecting the one under “sensor”.

  • 3.3: Click "My Applets" again

  • 3.4: Click "New Applet

  • 3.4.3: Click "Door closed"

  • 3.4.4: Select the door you want to monitor

  • 3.4.5: Click "+that"

  • 3.4.6: Search for SmartThings and select

  • 3.4.7: Select "Switch off"

  • 3.4.8: Select the device you added in section 3.2 and created in step 2. This will be your simulated switch/sensor device.

  • 3.4.9: Click "Create Action"

  • 3.4.10: Now go back to section 3.4 and complete these steps again for the "door open" applet. You will select "Switch On" for this applet. Also, if you have any other doors you will run through the same steps.

Step 4: Add Simulated Switch From Step 2 Into SmartThings_MyQ SmartApp.

This example will be explained using SmartThings app options on an Android device. Most steps should be similar or the same on other platforms. You need to have SmartThings_MyQ setup for this setup to be completed.

  • 4.1: Open SmartThings on your device
  • 4.2: Click "Automation"
  • 4.3: Click "SmartApps"
  • 4.4: Click "MyQ Lite"
  • 4.5: Once open click "Next" to go past the "Connect to MyQ" page and click Next past the devices page.
  • 4.6: Under options for the Sensor select the simulated switch/sensor device you created in step 2.
  • 4.7: Click next until you get to the same screen.
  • 4.8: Now go back to "My Home"
  • 4.9: Click the simulated switch/sensor device you created in step 2 and set the switch to "On".
    • 4.9.1: Look at your garage door status under “My Home” and check to see if the door now says “open”.
      • Note: This will not open the door. This is manually testing the status feature.
  • 4.10: Click the simulated switch/sensor device you created in step 2 and set the switch to "Off"
    • 4.10.1: Look at your garage door status under “My Home” and check to see if the door now says “closed”
  • 4.11: If the simulated switch/sensor device made the correct changes to your garage door, your simulated switch is working correctly within SmartThings.
  • 4.12: Now let’s test the if MyQ and IFTTT will update the switch. Note: This will make your garage door open. Click the open button on your garage door and wait to see if the status changes to “Open”.
  • 4.13: Close your garage door and check if the status changes to "Closed".

If the open/closed status updates correctly you are all done!


Chamberlain MyQ Trouble
(Glen King) #3

If you have an android control tablet, you can use it to monitor garage status. For free (almost)… I think AutoNotification costs a buck or something, and Sharptools gets a donation iirc.

You’ll need Tasker with AutoNotification, and Sharptools. The setup is simple. I’m doing this from memory so the steps are not ultra detailed, but should be enough to begin to get to where you want to be.

  1. Load the myQ app on the tablet, and get it running with your garage.
  2. In Tasker running AutoNotification, set up a new context. Choose Event, choose plugin, choose Intercept.
  3. Notification App = Chamberlain.

From there, build a new task built on that event. In the task, set it up to act on two things:
A. If %antext contains ‘closed’, do something
B. If %antext contains ‘open’, do something else.
Both the above are done via regex.

The something (and something else) can be your choice. I set up a simulated contact sensor, and Sharptools opens/closes it based on the above.
You could also have Tasker send an http get to a Webcore piston, using %antext to set an argument.

Additionally, if you have an Echo/Alexa setup there’s a chamberlain skill that works to open or close it by voice.


#4

Thanks for the information Glen_King! I considered doing something like that while back, but I would rather have everything running on the back end (cloud) and not relying on my phone or tablet. For $10 a year that isn’t much and it provides alerting without a local middle man (android tablet/phone).