Like many others, I'm going to set up a relay to control my garage door. I've been testing and playing with some virtual switches/sensors until my physical components arrive, and that works.
I started thinking now what will happen when I use the physical buttons (e.g. wife drives home and uses her remote to open the garage) or to integrate it into Alexa/Google Home (AGH).
Right now I have one rule that uses a global variable. I'm using that variable to determine the state of the "door", and to open/close it accordingly. What I started thinking about after was if I use AGH and tell it to "close the garage door", if the garage is actually closed, it will open.
My plan is to first split my current single rule into two rules. This way I can trigger each separately.
Instead of using the global variable though, would it be better to use a virtual switch and present that to AGH?
If I tell AGH to close the garage door, it would then check the status of the switch and only close it if it's actually opened, and vice versa. That would solve the AGH issue, but I would still have the physical issue.
If the wife uses the remote to open the garage, I'm guessing it would be best to add a contact sensor to help track the physical position and change my variable/virtual switch accordingly?
Just wanted to bounce ideas off the community to help me wrap my head around it since I'm currently working on like 3 different projects and my mind is all over the place.