Here follows a tale of blood and sweat and tears… and ultimately - sweet, sweet triumph that made it all worthwhile.
[I’m going link to this post from a few places where I asked for advice over the past few weeks, so that anyone researching those threads discovers the solution that worked, at least, for me. **And if you don’t want to read the step by step story, the quick solution is: Hue (Re)Connect** (and probably Hue Lights & Groups & Scenes (OH MY!) but I didn’t test it) **and a special “stateless” momentary button tile device type and super simple smartapp developed by** @Sticks18 ]
While there are many other things I want to start digging into now, the primary reason I first bought SmartThings was to bridge access between my Amazon Echo and the scenes I created with Philips Hue. Not only to bridge the two, but to do so elegantly (by which I mean, when I changed from one scene to another, I wanted the lights to respond immediately, simultaneously, and reliably).
I ran into two major hurdles… First, the immediate, simultaneous, and reliable requirements. Part of the problem is that I have 40+ Hue bulbs, and I have many scenes that incorporate most or all of them. The other part of the problem is that few of those bulbs share the same settings (color/saturation/level) with any others in the scene. It’s not that I have gaudy color configurations with reds and blues and purples and greens; it’s that the lamp on the bookshelf gives a more pleasing light when set at a slightly warmer color temperature than the lamp on the table, or that the lamp in the corner gives a nice splash of color while others do the heavy lifting of lighting the room.
When you have a scene that requires that many settings, most SmartApps fail to make the switches reliably. More than 50% of the time, a bulb or two would not change at all, or else would change partially but not completely. That may be fine for some, but it’s eminently frustrating to me, as it mars the beauty of the house lighting that I worked diligently to create. So, Smart Lighting was out, and while Rule Machine is absolutely exceptional at so many things, this wasn’t one of them.
And this is where I give a shout out to the incredible helpfulness of the community. So many people worked with me, and had recommendations for me, and took the time to help me when I grew confused. First of all, @MichaelS wrote a stripped down app that was my first go at things; it was based off of a lighting app he wrote, but I asked for his help with something bare bones. This ran into the same reliability problems (which I think have to be due to either the ST hub or the Hue Bridge trying to process so many commands at once).
Next, it was @Fuzzyligic, @SBDOBRESCU, and @bamarayne who pointed me toward Hue (Re)Connect. Some had issues with it in the past, but others said it had worked nigh flawlessly for them, and with a large number of Hue bulbs. So I gave it a shot, and I am thankful that I did! (During installation, I realized that the directions for installing it and using it could be much better… I got confused a few times. Now that I’ve done it, if anyone is looking into it and gets lost like I did, just let me know and I’ll share what I learned.)
Hue (Re)Connect makes the transition from one scene to another absolutely flawlessly. Thus far, I think I’ve had 1 missed bulb in some 100 or so scene changes. And beyond that, all the bulbs change at once, and it happens without any lag or latency. It’s just been a glorious experience.
The app saves each scene as a momentary button tile, which in my opinion, is ideal. And it just left bridging the gap from Amazon Echo to these various devices.
Now, I could have shared the devices directly with Alexa. And then I could say, “Alexa, turn on the ambient lights.” But I wanted the functionality of being able to have an “On” and an “Off” option for each phrase. And direct linking to a momentary button tile wasn’t going to give me that option.
I also could have used a simulated switch, but this raised another problem. If I turned Scene A on, later turned on Scene B, and finally wished to return to Scene A again (or alternatively, if I turned Scene A on, someone used the physical light switch, and I wished to turn Scene A on once more), a simulated switch wouldn’t allow me to do that, as it would continue to read Scene A’s state as having remained On the entire time. Thus, I’d issue the command to my Echo, “Alexa, turn on Scene A,” she would respond with, “Okay,” but nothing would happen.
The solution came by way of @Sticks18 who created a “stateless” switch device type, sort of a hybrid between a momentary button tile and a simulated switch, and a simple SmartApp that would allow that device to have two actions linked to it, one for On and one for Off. No matter whether I just turned Scene A on 5 seconds before, I can issue the command to do so, and Alexa sends the command. It doesn’t check for what state the switch is in. The same is true with Off commands.
Finally, for my lights that aren’t Hue bulbs, I used that program that @MichaelS wrote to tie them to momentary button tiles as well, and then use those tiles in @Sticks18’s program just like the Hue scenes. I group them in in Amazon Echo’s app, so that a single command calls that group name, and they all function seamlessly.
And now, I have a beautifully functioning system. It’s lightning fast and incredibly reliable. Not only that, but it’s built to be simple. Which, to my mind at least, means there are fewer points of possible failure. I don’t have to rely on polling the lights to see what their status is already, or on delays to mark switches’ states as off or on. It just works.
I’m thankful to everyone who helped me discover it, and I hope that this may help anyone else who’s in the same boat that I was.