Alexa Helper - Change mode or phrase with a switch toggle

Where’s the code for the latest version?

This app is awesome man!

P.S. Way to be super first class and give proper credit in the header block! :smile:

Hmm…the Mrs will be away for a few days. Perhaps it is time to work on getting this working.

No problem…All of my apps that use some of your sub-routines include your name. It is now my ‘framework’ for apps that have multiple slots (your idea!).

1 Like

But it is not obligated to do so.

If this were a standard Device Type and you we didn’t use a personal copy, then any upgrade of the Device Type could, reasonably, only support Command push(), since that is all that is required of a “Momentary Button”.

If we were going to have device types limited to what is required, we’d throw out half the capabilities people have suggested and a good percentage of the existing device types. :wink:

As far as what’s “reasonable,” from a physics and engineering standpoint it’s very reasonable that a momentary switch has an on and off state since it can be designed to complete an electrical circuit.

SmartThings is a continually evolving platform, there’s room for more than one momentary type. :sunglasses:

I agree that SmartThings has left us in a world of ambiguity due to the limitations of the implementation of “Capability” and the slow response to any requests for new official Capabilities https://community.smartthings.com/c/developers/new-capability-types

So, well, further discussion on this probably belongs in that above linked Category (New Capability Types), but that category has been totally ignored by SmartThings.

I can only say that, personally, this code of Momentary Tile doesn’t sit right with me. I can concede that Commands push() and on() can have similar semantics (i.e., the device is momentarily “on”), but suddenly off() has the exact equivalent meaning of on() … i.e., the device is momentary “on” and then it is off. Well… I find it disturbing that on() == off() anywhere in the world. It just doesn’t compute in my brain. That feels like saying “1 == 0”.

def push() {
	sendEvent(name: "switch", value: "on", isStateChange: true, display: false)
	sendEvent(name: "switch", value: "off", isStateChange: true, display: false)
	sendEvent(name: "momentary", value: "pushed", isStateChange: true)
}
def on() {
	push()
}
def off() {
	push()
}

The freaking code that I posted for Alexa turn on night mode with momentary button tile worked but failed to turn off all lights. Hue integration is again at its worst. The momentary switch triggers good night fine but I am guessing it still takes morre time as it is still trigerring a hello home phrase. Lights and switches number of on and offs for hues is totally completely off and bulb discovery number is horribly wrong when you click hue connect. I do not expect hue integration to be any better in v2 or whatever till they do what they have to do.

The family and living room switch under “lights and switches” shows the right number one minute. Incorrect numbers the next minute and all freaking off the very next time. @juano2310, my friend what’s going on with the connect? From near perfect few days back to total downhill! :frowning:

1 Like

Is using groups an option? Put the momentary and Hue light in there. Name the group good night. The non-Hue lights would be controlled by app. It is only a possible workaround?

Not sure… Every time the hue connect polls (5 minutes interval), I see that mostly it brings in the incorrect number of bulbs. Every time I look at Bulbs and switches, they are all off (even though on), incorrect numbers and at times the right number. Go figure! This leads to good morning to fail too if thinks at that particular minute the bulb was off via polling. I can guarantee no benefit with any version of the
ST hub as as long as they change this strategy for hue integration. Day one of launch will be overwhelmed with hue fans ( lights issues). 101 tickets opened.

There is no non-hue devices in the goodnight! Turns off couple of hues and changes the mode to night. Simplest use case.

I admit: this week we pulled the hue bridge out of smartthings altogether, and replaced it with virtual switches.

We use echo with the hue bridge to control the lights most of the time which gives near instant response.

We use SmartThings and the virtual switches, Plus IFTTT, to turn The lights on a schedule.

Solved the issue for us, although I don’t know if most people would think it was worth the trouble. :sunglasses:

Situation;

@juano2310

PS: NO BUTTONS IN THE APP TOUCHED

6 bulbs in family room
5 bulbs in living room

Good night turns them all off but one of each in these rooms and then the madness happens…

Who freaking changes it with no action whatsoever!
How did the family room turn itself off?

And now freaking rooms reversed. Who did it…

And again back to normal…

@JDRoberts will so appreciate your help on what you did? This hue integration is killing me since last September. One year to be precise! May I ping you?

Hi! This morning there was something weird going on with my hues but directly from their bridge. After going back in to the hue app and changing a couple of scenes it fix itself.
We haven’t change anything in hue. I did fix some error handling and I’m ready to deploy an update as soon as we have more QA available.
Also I will be getting an echo to debug if echo integration is messing things up.

One question, how about the individual states, in things? Do you see the same inconsistency that in lights and switches?

I am not using lights and switches at all, and I see the same inconsistency from the things panel. I sent support a screenshot of the log showing two lights going on and then off two minutes later on the status, although actually they physically stayed on the whole time. It was just the tiles changing. I’m assuming that was from Polling.

I only have one his light that I just started using recently, my wife is not a fan of non-switch lights so I have just been using regular switches. I setup the hue a week or two ago and it connected right away and worked fine.
I have not been using it and just tonight went to set something up. The light is still there but does not respond at all through SmartThings, the hue app works just fine.
I can see now what all the frustration would be with multiple lights that you depend on. I would love to see this fixed but I agree with @smart that the v2 hub will probably have no impact on this.
I would love to add more bulbs at a later point, I have not done so sooner because of all the continuing problems with hue and ST. I am going to play around with IFTTT and Virtual Switches like @JDRoberts mentioned as maybe a work around with this one light as a test.

Same behavior as @JDRoberts. Also, good morning triggered but failed to turn off 2 hues. The status of bulbs under things and ‘lights and switches’ are out of sync at times (mostly) and then shows tandom on and off status in there.