How To: Set Notifications With MyQ Garage Door | SmartThings

How To: Set Notifications With MyQ Garage Door | SmartThings

Overview

In this example, we'll set a notification to go off when your MyQ Garage Door Opener is Open past a certain time and have the notification automatically turn off if the door is closed. This looks complicated as you'll read through it, but we promise it's not bad and it's very convenient once it's implemented.

The Inovelli devices compatible with this setup are any Red Series switch:


What You'll Need

  1. Inovelli Red Series Switch (On/Off, Dimmer or Fan/Light)
  2. MyQ Garage Door Opener by Chamberlain: https://www.myq.com/
  3. SmartThings Device Handler installed for your Red Series Switch (DTH can be found here: ST Device Handlers)
  4. MyQ SmartApp Lite (instructions below)
  5. MyQ Device Handlers (instructions below)
  6. IFTTT Account: https://ifttt.com/
  7. Premium MyQ Account (Free as of 05/31/2020)
Let's begin!

Step 1 - Install the Device Handlers & SmartApp

If you haven't already, please install the Red Series Device Handlers. To keep this article short, we're going to hyperlink to the instructions on how to setup a device handler: How-To: Install a Device Handler (SmartThings). Please remember to install both the Red Series Device Handler & Child Device Handler (for notifications - Do not publish this one like you would an Inovelli DTH).

Now for the MyQ instructions. First, let's give credit where it's due. The instructions and background info we followed were pulled from this thread: https://community.smartthings.com/t/how-to-smartthings-myq-smartapp-using-myq-sensors-with-ifttt/149601

However, we'll re-write them in-case it gets pulled from the ST Community.

1.1 - Installing the MyQ Lite SmartApp

Credit to Brian Beaird and other contributors to this SmartApp (Jason Mok, Barry Burke, RBoy Apps). Regardless of your setup, you'll need to install the MyQ Lite SmartApp. To read more about it and what's required and/or limitations, please see the README.
  1. Login to IDE and click on, "SmartApps"
  2. Click on, "New SmartApp" and then, "From Code"
  3. Go to the MyQ Lite Raw Code page and copy the code
  4. Go back to IDE and in the, "From Code" tab, paste the code and click, "Create"
  5. Then click, "Save" followed by, "Publish" and "For Me"

1.2 - Installing the Proper MyQ Device Handler(s)

This part, you'll have to do a bit of research on what MyQ make/model you have. In our case, we had a model with built in sensors, so we installed the Device Handler that included sensors. However, there is a different DTH that has no sensors included. Please check out the README for more info on what to install.

Let's install the sensor version (MyQ Garage Door Opener):
  1. While in IDE, click on, "Device Handlers"
  2. Then, "Create New Device Handler" and then, "From Code"
  3. Go to the MyQ Garage Door Opener Raw Code page and copy the code
  4. Go back to IDE and in the, "From Code" tab, paste the code and click, "Create"
  5. Then click, "Save" followed by, "Publish" and "For Me"
If you require additional DTH's, please follow the same directions above.

1.3 - Installing a Virtual Switch & Contact Sensor Device Handler

Here's where things get a little weird. Don't worry, it all comes together at the end!
  1. While still in IDE, click on, "My Device Handlers"
  2. Click on, "Create New Device Handler"
  3. Select, "From Template"
  4. Click, "Select Protocol" and select, "LAN/Other"
  5. Under, "Capabilities", select, "Contact Sensor" and "Switch"
  6. Then, fill out the, "New Device Handler Form" section
    1. Namespace = Input your name
    2. Device Handler Name = Name your Device Handler -- we used, "Simulated Switch and Contact Sensor"
  7. Click, "Create" -- This will take you to a page that has pre-built code -- you will have 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)
    }
  1. Here's what the lines should have looked like before lines 40-49 were replaced:
    image
  2. Here's what the code should look like after:
    image
  3. Click, "Save" and then click, "Publish" and then, "For Me"
You should now be all set with the Device Handler and SmartApp installation. Let's move on to the Virtual Switch/Sensor device and finalizing this setup.

Step 2 - Creating a Virtual Switch/Sensor

Basically, this is required to tie ST to the MyQ Premium app and IFTTT as there are polling limitations with the MyQ and ST apps. Long story short, it's semi-janky, but it does the job and it does it well. Trust us.

Here you will create a simulated/virtual switch/sensor device using the DTH we built in Step 1.3. You will build one for each garage door you have.
  1. In IDE, click on, "Devices" and then click, "New Device"
  2. Fill in the following fields:
    1. Name: Call it whatever you'd like
    2. Device Network ID: Make it unique to any other device
    3. Type: Select the Device Handler Name you created in Step 1.3
    4. Version: Select, "Published"
    5. Location: Select your Location
    6. Hub: Select your Hub
  3. Press, "Create"

Step 3 - Setting Up MyQ & IFTTT

Before you go any further, you'll need to sign up for MyQ's Premium Service (sign-in required). As of 05/31/2020, this is a free service, but it's required to tie into SmartThings.

Once signed up for MyQ's Premium Service, you'll need to connect MyQ to IFTTT. To do so, please follow these directions:
  1. Click on, "Connect MyQ to IFTTT"
  2. Enter your credentials and click, "Subscribe"
Now, head over and setup IFTTT:
  1. If you have not setup SmartThings and IFTTT, then click the search (magnifying glass at the top left) and type in, "SmartThings" -- click on, "Services" and then the, SmartThings tile
    1. Be sure to select the Virtual/Simulated device you created in Step 2 -- we just selected all devices
  2. If you have already setup SmartThings and IFTTT, you'll need to edit your ST credentials and search for the device you created in Step 2 
  3. Now, click on your profile pic (top right) and select, "Create"
  4. Click on, "+This" and search for, "MyQ" and select it
  5. Click on, "Door Closed", then the door you want to monitor
  6. Next, click on, "+That" and search for, "SmartThings" and select it
  7. Select, "Switch On" and the device we created in Step 2
  8. Click, "Create Action"
  9. Now, click on your profile pic (top right) and select, "Create"
  10. Click on, "+This" and search for, "MyQ" and select it
  11. Click on, "Door Open", then the door you want to monitor
  12. Next, click on, "+That" and search for, "SmartThings" and select it
  13. Select, "Switch On" and the device we created in Step 2
  14. Click, "Create Action"

Step 4 - Connecting Everything in SmartThings

Here's where we'll make sure everything works in your app prior to messing with the notifications.
  1. Open your SmartThings App (new app)
  2. Click on the three lines at the top left (menu)
  3. Click on, "SmartApps"
  4. Click on the, "+" sign and scroll down until you see the, "MyQ Lite" app and select it
  5. Enter your login credentials and click, "Next"
  6. Click on, "Which?" and select your MyQ garage door, followed by, "Done"
  7. Then click, "Next"
  8. Keep off, "Create on/off push buttons?" and click, "Next"
  9. Finally, click, "Done"
  10. Now, back in your SmartThings App, you should see two devices, "Your Garage Door Name" and, "Your Simulated/Virtual Switch/Sensor" on your home screen
  11. Click on the sensor/switch you created in Step 2 to test the Open/Close (this will not open and close your garage door -- it's merely to check the status of, "Your Garage Door Name" and if it updates the status correctly)
    1. If successfully setup, when you click on the sensor/switch created in Step 2, your MyQ (ie: "Your Garage Door Name") will update the same (ie: Open = Open, Closed = Closed)
  12. Finally, check to see if MyQ and IFTTT will update the switch portion -- this will open/close your garage door -- If you click on the button on your garage door, does the door open/close and the Simulated switch turn on/off?

Step 5 - Setting Up Notifications

The final step is to create a notification. In this example, we'll set a notification to go off if the Garage Door is opened after 9:00pm and before 6:00am. The notification will then turn off automatically if the garage door closes.

Remember, for this to work, you need to install both the Inovelli Device Handler and the Switch Child Device Handler (Do not publish this one). 

Notification Components

There are four (4) different components to every single notification:
  1. LED Effect Color: This is the color you want your notification to be
  2. LED Effect Level: This is the dim level you want your notification to be
  3. LED Effect Duration: This is how long you want your notification to last
  4. LED Effect Type: This is the animation you want your notification to be
To get a better visual of what the LED bar would look like, please click on this link (special thank you to Nathan Fiscus from our community for building this): https://nathanfiscus.github.io/inovelli-notification-calc/

NOTE: You can clear your notification manually from the switch by tapping 2x on the configuration button.

Selecting Your Notification

Once you've determined what you'd like your notification to look like, it's time to select it from within the app.
  1. Open up your SmartThings App
  2. Select your Inovelli Red Series Switch
  3. Click the three dots at the top right and select, "Settings"
  4. Scroll down to the, "LED Notifications" section
  5. Select your, "Effect Color"
  6. Select your, "Effect Level"
  7. Select your, "Effect Duration"
  8. Select your, "Effect Type"
  9. Go back to the home screen (where it lists out your rooms)

Setting up the Notification

Again, in this example, we'll be setting up a notification that alerts you when the garage door is opened past 9pm and before 6am. The notification will be a red chase notification at 100% intensity that lasts indefinitely (until you clear it). Once you've selected the effect color, level, duration and type and you're back to the home screen, please do the following:
  1. Click on the three lines at the top left of the screen (to access the menu)
  2. Click on, "SmartApps"
  3. Click on the, (+) sign at the top right to add a SmartApp
  4. Scroll down and select, "Smart Lighting" and select it
  5. Click on, "New Lighting Automation"
  6. Click on, "Which devices do you want to control", select, "whatever you named your Inovelli Dimmer Switch (Notification 1)" and click, "Done" (NOTE: You can select multiple switches here if you'd like)
    1. NOTE: Look for whatever you named your Dimmer Switch and then it should say, "(Notification 1)" next to it
  7. Leave, "What do you want to do?" as, "Turn On"
  8. Click on, "Select Trigger", select, "Open/Close" and press, "Done"
  9. Click on, "Which open/close sensors?", select your simulated switch and press, "Done"
  10. Click on, "Turn on when", select, "Opened" and press, "Done"
  11. Toggle, "Turn off when closed" to On
  12. Set, "After this many minutes" to 0 (or if you'd like a delay, you can select the time for a delay)
  13. Then press, "More options"
  14. Click on, "Only during certain times"
  15. Set your times
  16. Press, "Next", and ensure your setup looks like Figure 5.1
  17. Then click, "Next" again, and then, "Done"
  18. Test out your notification by opening your garage door past 9:00PM and 6:00AM
Figure 5.1: Smart Lighting Settings for Garage Door Notifications


That's it! It's not always this complicated, we promise. There just unfortunately isn't a clean way to do this with MyQ and SmartThings. If you need help, feel free to comment on the Community Post: How To: Set Notifications With MyQ Garage Door with SmartThings.