I have created two simple virtual switch types that I could not seem to find in the forums but they made things much simpler for my personal setup, particularly when integrating with Echo. I will preface this by saying I don’t know anything about the groovy language (I program in C and C++). The UI part of the second switch is messed up, but I don’t ever use it directly, so I haven’t messed with it. If anyone wants to clean up the second one, have at it.
The first is just a switch that is normally closed. I have a number of lighting groups/scenes that have lights which can be controlled individually. I created a setup where my lighting groups/scenes each have a normal momentary button tile so I can turn them on at any time regardless of the current lighting state. But if I want to turn off an individual light, I have a normally open switch that will always allow me to turn that one off directly.
This worked fine, but when it came to activating and switching Harmony activities, things got a little more complicated. If I commanded Echo to turn on my TV, I could have a momentary switch do this, and return to the off position. However, this does not allow me to command that activity off now, since the switch it already off. I could have made it a non-momentary switch, but that would have made things even worse. What if I turned on the TV, then switched to (turned on) Roku, then switched to (turned on) Music? Now I have 3 switches in the on position, and if I turn off just the last one, the others are not ready to be turned on again. I initially created a normally on switch so that I could “turn off entertainment” and it would end the current activity, but I still didn’t care for this.
So I created a double-pole momentary switch for each activity. It can be turned on or off, but will return to a non-connected state. This works well for the lights also. For example, I have a switch for “all lights,” and no matter what scenes/groups are on I can always turn “all lights” on or off because the switch will always return to the middle state.
Maybe there is a better way to accomplish this, but I did not come across one. If you want to use this or modify it, have at it.