With the move to 2.0, I have resolved to simplify things and take advantage of SmartThings apps and integrations as much as possible. Since none of these can talk to HAM Bridge, I have set up a number of virtual switches that do that.
The problem is presented in the following scenario:
A virtual switch, when turned on, calls HAM Bridge to run a script that turns on a home theatre system, and starts a source playing. When turned off, just the opposite (it turns everything off).
The problem I am working with is that if the switch is currently in the off state, then an OFF event is not sent from a Routine that is set up to turn that switch off, and I need it to be due to the possibility (heaven forbid) that someone turns it on manually.
My current workflow is something I consider little better than a kludge at synchronization that I wonât bore you with. The ideal solution is just to have the virtual switches receive and execute the OFF handlers even though they are off. I have other switches that do this with filter events false, but these donât behave the same.
Thoughts? Am I missing something simple, or is this just not going to happen with the âTurn these switches offâ in the default SmartApps?
I used to run into this all the time with hello home actions in the previous version of the app.
I found the easiest way around it was to make two virtual switches, both momentary, one that I used for turn on and one that I used for turn off. That way they could never get out of sync with any other method of controlling the device because theyâre always off and ready for the next on instruction.
Depending on if your integration goes both ways, can your system send a command to Smartthings to turn that switch on? For example, all my Harmony activities have an action that turns on a virtual switch labeled âOffâ. That way even if I Smartthings/Echo didnât initiate the activity I can still end it by turning that switch off (or telling Alexa "turn off the system/harmony/etc). Again Iâm not sure what abilities your bridge has, but that works well for harmony.
@JDRoberts has the right solution. Momentary Button Tiles have the very cool property of looking like a switch thatâs off, that automatically turns itself back off after you turn it on. @JDRobertsâs solution simply inverts the sense of one to get the same feature for off.
Yes⌠and that is the âkludgeâ I have currently implemented. And while it has the advantage of preserving state info in the interface, it involves changing a lot of code in my various iRule remotes, giving up local control, and I really donât need the state info (plus it does not address some manual operations).
Yup, that looks to be the simplest way to skin this cat. Thanks!
In your case that does sound much more complicated. I do use momentary switches for all my âonâ activities. I have one âoffâ binary that turns the system off through IFTTT. I mainly did that to avoid havin to say something clunky to Alexa like âAlexa, turn on ____â when trying to turn off the entertainment center.