Help turning virtual switch "on" when it thinks its already on for garage automation

hello, i have this rule running. and it seems to Run OK. the issue though is as you can see by the screen shots the switch is "on" but the doors are actually shut.

This is because the doors were shut in a way other than the virtual switch. so now if i tell Alexa or GA to turn on that switch it thinks its already on and does nothing.

So the way this works is in conjunction with IFTTT and my Meross garage door openers. IFTTT looks at my real garage doors, and the fake garage doors in HE and makes them follow. if one open or closes, the other open or closes.

So i need to modify this somehow so that if the garage door closes it triggers that virtual switch to turn off at the same time. OR if the garage opens trigger that virtual switch on at the same time so that it follows. i keep ending up stepping on my own toes though. what is a simple way to do this so that it doesn't get out of sync and behave wrong.

Edit: should i add the garage doors as triggers and add turn on or turn off switch to a part of this?

that might do it, try it and test. Also know that virtual switches can be set to turn themselves off in the device page (useful feature I stumbled on)

the problem with it turning itself off would be I might still be out in the garage and it Turing off will shut the doors when i dont want them to.

Ill try the triggers with garage. then tell it when the door opens turn on the switch and when the door closes turn off the switch.... Trying to think if that creates scenarios i dont want.

Edit: i think i have to re-write the IF statments somehow. it wont do anythign if the door shuts but the virtual switch is stil on.

Use two virtual devices. One of them to raise the doors and the second to close them. Make them both momentary.

AH maybe that is the answer. i just wrote this. do you think this will do it?

Bad idea. This has the danger of creating a cycle of the doors opening and closing.

interesting, how? and how can i modify it. I might still do the momentary thing. just want to understand how this would break so i dont repeat the disastor another time.

The only safe and reliable way to do this is to put a sensor on the door. The Samsung SmartThings Multisensor will do this for you and it's very inexpensive. Then you'll have exact status of the door and can set the switch to reflect it.


Run through the scenario of your two rules interacting.

@SmartHomePrimer is correct. Any door sensor will work. I use a GoControl contact sensor modified to work as a tilt sensor.

1 Like

So if the new rule turns the switch off when the door is shut. and the old rule sees the door as shut it wiill tell meross to close the door. but meroos will see the door as shut and not do anything. I think the danger would be if they step on eachoether. im still new at this so im struggling.

You wrote what needs to be done. Without direct status reporting, it's just unreliable, no matter what you do. The SmartThings Multisensors are on sale for $18. Grab two of them and put one on each door so you'll always know its exact status. These sensors will give you tilt angle, contact open/close, acceleration and temperature.

Grab a set of Innr Zigbee outlets as well so you can be sure the multisensors get a good signal out there.

Screen Shot 2020-06-11 at 12.32.28 PM

But the Meross wifi garage door opener does has status. and knows when its open or close. so the IFTTT rule is triggering based off that. the only issue is the virtual switch comming out of sync with that because there was nothing resetting the switch if it is ON but the doors get shut without it. The virtual door on the hubitat i have built is updated by the meross via IFTTT.

Then you can set that as an additional trigger and then an OR condition in your rule. So when manually controlled, it will follow the status. But I'm telling you from experience, cloud connections get out of sync. I did something similar to this when I had an August lock. For the most part it worked, but every so often it got out of sync.

You are more fortunate in this situation, that you can add a local, and reliable sensor that will tell you the ACTUAL door status, not just the assumed status based on the last received update from the cloud.

I'll look at adddiing a sensor next time I can afford it. I'll play with this for now

This is exactly what I do so I know the state of the Door in HE and control garage lighting based on time of day (between sunset and sunrise only)

Not sure of your budget, but the Samsung Sensors are available new for $17.99 in Amazon and refurb/used for even less. I've had pretty good luck with Amazon Warehouse items. For the most part, it just appears packaging is damaged and the product inside looks perfectly fine. If not, it can easily be returned like any other purchase. Prime membership is both a blessing and a curse! LOL!!

Samsung SmartThings GP-U999SJVLAAA Door & Window Multipurpose Sensor

1 Like