Currently Alexa does not allow to open/close garage door for security reasons (for example stick head in open window and yell “Alexa open the garage door”).
But if I wanted to create a virtual switch with a code name could that work using reactor to trigger the garage door?
How do you create a virtual switch compatible with Alexa?
ok so in the middle of programming Reactor, I got stuck with circular reference between Switch on/off and garage door open/close because of this logic:
If Garage Door = Open, then Switch = On
If Garage Door = Closed, then Switch = Off
If Switch turned from Off to On, then Open Garage Door
If Switch turned from On to Off, then Close Garage Door
Unstated is that there’s a door sensor in the mix here that provides the actual status, correct? You’re then using the switch both to mimic the door state and control the door.
Group “Switch State Control” - NUL
Group “Door open” – AND – sustained 30 seconds
Door sensor says door is open
Switch status is OFF
Group “Door closed” – AND – sustained 30 seconds
Door sensor says door is closed
Switch status is ON
Activity “Door Open is True”: Set switch to ON
Activity “Door Closed is True”: Set switch to OFF
So basically, if the sensor and the switch disagree for 30 seconds, the switch gets set to whatever the sensor thinks the door state is. The delay may seem odd, but remember that the closure of the door isn’t instantaneous–it takes time to go from one state to another, and then for whatever sensing to relay home the new state of the door.
Then the switch actions:
Group “Door Control” – NUL
Group “Switch On” – AND
Switch status is ON
Group “Switch Off” – AND
Switch status is OFF
Activity: “Switch On is TRUE”: command door to open
Activity: “Switch Off is TRUE”: command door to close
You could also do this with sequences, but you’d still have to be careful about the timing of door movement, since, again, opening and closing isn’t instantaneous, and “open” and “closed” aren’t really that–they’re probably actually “closed and not in motion” and “not closed and possibly in motion either direction”.
You also need to allow time for the sensors to respond.
Can you add a delay into sequences?
For example such as a x sec. delay between each event in the sequence or even different delays within the sequence event?
Sure, but it doesn’t prevent you from having to assume that the door is open based on how long it hasn’t been closed. That’s really the fly in the ointment. Add a sensor for when the door is in the fully open position and the game changes completely, and gets a lot easier.
I’ve made the above Reactor sensor and it behaves as expected when using through vera. Now trying to get the new virtual switch to show up in Alexa. Thanks again!
That I do not know. Alexa has a thing about locks, so that’s probably not a path to success. Maybe create a routine in the Alexa app? I’ve heard you can do such things, but I have not done it.
The Alexa app lets you set routines. you can set a phrase like “open garage door”. I do find open is a key word to Alexa, so some times Alexa does get confused, but works 90% of the time. Try setting a virtual switch as an open/close blind, as I think Alexa will allow you to say open without a routine.
That’s brilliant! @w1se , Switchboard will let you make a virtual window covering. It supports the same Target and Status as any other switch (among other things). You should probably turn off Switchboard’s “motor emulator” by setting the virtual cover’s RampRatePerSecond variable to 0.
Ok I tried the Switchboard virtual blind, and everything works in Vera. For some reason however, Alexa will not find the virtual blind. (I did a luup reload, changed the name, added to vera through “manage alexa”, and it still can’t find it.) It found the first virtual switch no problem.