A Satisfying Solution for Philips Hue Scenes, SmartThings, and the Amazon Echo

Yup. The Alexa Helper SmartApp will give you a ton of flexibility for each Alexa Switch. You can control different devices based on the on or off events of the Alexa Switch.

what’s the momentary button tile code for on your github? isn’t there already one built into smartthings?

Neat…I had no idea. I’m running the Alexa switch but wasn’t seeing that. I’ll have to double check my code to make sure I’m on the latest…either that or have more caffeine, I had an early morning!

Yes…that one is for integration with Alexa Helper…with that code it allows the actual app to create the switch instead of creating it via the IDE. That is the only difference outside of the GUI changes.

so i need to install alexa switch and your momentary button tile code as well?

@MichaelS

So I do see the different On/Off control! Cool! Apparently, I’ve even used it before to create a virtual switch of ‘Lockdown’ to control my Front Door Lock. Like I said…it’s been a long day. Sorry about that!

1 Like

It is up to you…if you are using Alexa Helper, it recommend it as it will keep you from having to go to the IDE to create the switches. However, if you are comfortable with that then the momentary switch code is optional; you can use the ST code…I DO recommend the Alexa Switch code, however, to give you the ‘stateless’ abilities of the switch/dimmer.

great, trying it now, thank you so much for your help, it is extremely appreciated.

if i create a momentary button tile, will alexa let me send ON and OFF commands to it? i don’t want it to have a state.

ok i guess that wont work. i made a momentary button tile (naked Toggle) using your app and set ON to run my ‘all lights on’ routine, and OFF to run my ‘all lights off’ routine. when i tell alexa to turn Toggle On, the lights turn on then off… same when i tell Alex to Toggle Off.

will try the Alexa Switch virtual switch now… but my concern is that it will have a state, so if i tell alexa to turn it off and it is already off then it wont work? since i may have lights ON that are controlled by the ‘all lights off’ routine.

The momentary button toggles from off to on to off, so it will trip the on and off pieces of the scenario if those are set up. Quite honestly you can use an Alexa Switch for what you are looking for as it ignores the state it is in and simply passes the commands through.

great, trying it now :slight_smile:

ok something isn’t working right. i made a virtual switch called Toggle (alex switch) that supports on/off… when i tell alexa ‘turn on toggle’ the All Lights On routine works and all the lights turn on. when i tell alexa ‘turn off toggle’ the blue circle on the echo swirls but nothing happens and she doesn’t say OK and nothing happens.

pressing the switch on/off in smartthings app works like it should though.

it does work when i put the ‘toggle’ alexa switch into a group on alexa though! so i made a group called Pickle and say ‘turn on pickle’ and she says OK and it runs the all lights on routine. and saying turn off pickle runs the all lights off routine fine.

odd why it needs to be in a group to work?

I run into this more and more…seems some of this stuff is running into key word issues with Alexa. Try “Alexa, Toggle off”

yeah toggle off does the same thing. just blue swirl then she says nothing. also i made another virtual switch called Solar Shades, and made a Blinds group. if the Solar Shades alexa switch is already ON and i say ‘alexa, turn on Blinds’ she goes ‘that command doesn’t work with that device’ but still runs the ON command … any ideas?

oddly enough this group has the opposite problem. it works fine when i take it out of a group and just control the switch directly. shrug

seems to be working now so i’m happy.

hey michael, i’m using your alexa switch [virtual switch] for a group on echo called All Lights …to turn a routine ON [all lights on routine] and OFF [all lights off routine]. i found a bug though: if the switch is off and you tell alexa “turn off all lights” she will give an error message and say “that command doesn’t work on this device” but the command still works [which is what i want] …because lets say i have turned some lights on in those routines from a wall switch or something, then i want to turn them off via alexa, i’ll tell her Turn Off All Lights… but since the virtual switch is off she gives that error.

any ideas? it works normally if you tell her to turn the switch off and it is ON. or tell her to turn the switch on and it is OFF. then she just goes “OK!”.

Alexa can be finicky with the names of things…somethings work one day and sometimes they stop. I am not aware of any feedback from ST to Alexa on the switch state. In fact, I have another routine in the morning that turns on my Sonos directly, and all I say is “Alexa, turn off Sonos” and it works even though the switch is off…I really don’t think it goes out and checks the status of the switch, so what you are describing is ‘strange’.

Are you 100% sure you can reproduce that? You are saying your group “All Lights” is the Alexa Switch or the Echo group. If it is the Echo group this makes even less sense…the Echo group can neither be on or off, so it ignoring its own group would be strange as well.

Can you clarify this, including where you think the ‘bug’ is (i.e. my app or in the Alexa);?

i think i got it working properly now, i took the alexa switch out of a group (named all lights) on the echo and it seems to be OK now and lets me turn it off twice without giving that error. btw you rock :slight_smile:

Great…good to hear you got it working!

I am getting the following error when trying to create the smart app “pushtype momentary button”

No signature of method: script14618786421441651075380.metadata() is applicable for argument types: (script14618786421441651075380$_run_closure1) values: [script14618786421441651075380$_run_closure1@76e6e64d] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)

I installed Hue (ReConnect), but I’m struggling to get scenes built in the Philips Hue mobile app to load into the Hue (ReConnect) SmartApp. Hue (ReConnect) successfully discovers my Hue bridge and Hue bulbs, but does not discover Scenes. I’ve tried toggling the scenes on and off, and I’ve created new scenes, but no luck so far. In the DEVICE events, I see that the following:

displayed false
eventSource DEVICE
isStateChange true
isVirtualHub false
linkText Hue Bridge
name sceneList
rawDescription
translatable false
unixTime 1468866112609
viewed false