Virtual garage door device with separate open/close switches?


(Simon Knight) #1

Hi,

I have 2 electric garage doors which are controlled with a Konnected setup. I have an ESP8266 board and 2 relays for each door, one controls the “open” switch, and one controls “close” for each door. Each door also has a wired open-close sensor.

In the smartthings app, these appear as 6 devices: an “open” momentary switch, a “close” momentary switch, and an open/close contract sensor for each door.

I would like to set up a virtual garage door controller that monitors the open/close state, and is able to open/close the door depending on the current state (i.e. close when open, open when close). This will enable me to use the controller via google assistant/alexa and within routines.

I have found a number of virtual garage door devices that look like the exact thing I need (e.g. New smart app to link the virtual/simulated garage door device with two actual devices or Ridiculously Simple Virtual Garage Door) but they only work with garage doors controlled by a single open/close switch. Is there a virtual device handler that will allow separate open and close switches?


(JIm) #2

I am in ;the process of doing that with my garage door. Got tired of the tilt sensor not working most of the time. i am writing a very simple smartapp to do that. I would be happy to share it with you. Just don’t have it quite done yet.


(Simon Knight) #3

That would be fantastic! I have looked at creating a virtual switch that opens when on, and closes when off, which I could then sync to the sensor using one of the existing smartapps, but I am not sure how to get the virtual switch working properly…


(JIm) #4

Let me understand exactly what you have.

There is a contact sensor that indicates door closed.
There is another contact sensor that indicates door open.

There is a switch to open the door. I assume momentary.
There is another switch to close the door, again I assume momentary.

You want to create a simulated switch that you can activate which will then open or close the door depending on where it currently is.

Does that sound correct?


(Simon Knight) #5

Not quite, but close. There is only one sensor that is closed when the door is closed. For the switches, you are correct - one momentary button opens, a second closes, operated by separate relays.

I would like a single simulated switch that is open when the door is open, closed when the door is closed. Toggling the switch will either open or close the door depending on current state. Ideally (as with some of the existing virtual devices), if the door is opened manually (from the controls in the a garage) the sensor will detect and automatically update the switch status.

Hope that makes sense - essentially what already exists in some of the smart apps, but I have separate open/close relays.


(Larry) #6

No, make one virtual.switch that has open for open and close for close. Use smart lighting to set the 2 actual switches. Then use this one switch as the garage switch.


(JIm) #7

I don’t use smart lighting so not sure how that works. But will it keep track of the current state of the door based on his sensor?


(Simon Knight) #8

OK - I know I am being dumb here - I have created a simulated switch for the door, but can’t work out how to bind it to my 2 existing open/close switches? Do I need to use CoRe to set up some rules, or is there another way?


(JIm) #9

If you use webcore then do an if switch changes to on then execute the open. Do another if switch changes to off then execute the close.


(Larry) #10

i recommend using smartlighting not core or webcore it will run local if using smartlighting… it is a built in smart app… same idea though.


(Larry) #11

actually i stand corrected… i was trying to get one switch so that yhou can use the smartapp for a garage door. but it wont work. while this will give you one switch, the garage apps expect there to be one switch that both open and closes ie toggle when turned on … just like the one switch/button on your garage wall. There is no way to get this functionality through a virtual switch. As long as you have two switches one for open and a different for close… this wont work without rewriting the virtual garage door app. I could make a custom version but it would take some time.


(JIm) #12

That’s what I am working on. Mainly for my own use. It will look at both an open and closed switch and control the door accordingly. Just haven’t had time to finish it up. I don’t have my switches yet so it hasn’t been a high priority. I will try to get it for Simon soon. The logic to do it is pretty simple. But getting a display of what’s going on gets harder. But I about got it, I think…


(Larry) #13

it would be pretty easty to rewrite my virtual garage door smartapp to do this. The big issue would be testing since I dont have this configuration and most dont… I dont really want to try to debug and test it remotely if i made a custom version… I can code up a custom version in about 15 minutes but you/he would be on his own installing and debugging it.


(Larry) #14

here is the code try it…


(JIm) #15

Don’t really have the time to delve into it, but it looks like it will do what Simon was asking. Mine is a little more complicated as I am using both open and closed switches on the door. Also putting in closing and opening states. Pretty much have mine done, just waiting for my new switches to show up.

But Simon you should be fine with Larry’s.


(Simon Knight) #16

So I had a play last night and with a bit of trial and error, I got everything working with virtual switches and WebCoRe. For each door, I have a virtual on/off switch. I then use a rule to push the garage open button if the switch changes to on, and to push close if it changes to off. To keep things in sync if the door manually opens, I change the virtual switch state if the contact sensor state changes. Webcore code below:

Thanks for your help!