Using Alexa to control a switch, when it is already on or off


#1

1) Give a description of the problem
I have set up 4 pistons that work for the most part. Is it neat and tidy in one piston? No but just sorta getting the hang of things. However when someone changes the state of the lights outside the switch, when using this switch you end up in a scenario where the lights don’t do what you expect. Ie. if you turn on the lights manually, and then use the “switch” to turn them off, if the switch is already off the trigger is not fired.

The other pistons turn the lights on, but at different levels depending on time.

2) What is the expected behavior?
I would like the switch to run the “off” trigger even if it is already off. Thus if someone uses alexa to turn the switch off, you get the expected result no matter how the lights got turned on.

3) What is happening/not happening?
It will turn the lights off if the switch is in the on state, but not turn the lights off if it was already in the off state.

4) Post a Green Snapshot of the pistonimage


#2

I’m sorry, but I’m confused. If you want the switch to turn the lights off when the switch is already off? If the switch is off, why aren’t the lights off? If you want the switch to be the master of the lights, you should only tie the switch to the lights and then only control the switch either through alexa or whereever. Otherwise, if you are turning the lights on in another way, then you need to turn the switch on when the lights are turned on. Something that is off, can’t be turned off again because it won’t report a status change to ST. It’s not a momentary button. it’s a switch.


#3

I am a bit confused as well… I am assuming that your switch is a Simulated Switch, and sometimes people change individual bulbs to get out of sync with the switch. If this is indeed what you are experiencing, then read on.

ST is ‘smart’ enough to not waste energy sending an off command to a device that is already off. If you want to force an ‘off’ to be sent regardless, you can try this:

Edit the piston, and click on the Title of the piston. Then the cog wheel in the bottom, and then Disable ‘Command Optimizations’.

This will let the Simulated Switch send the off commands to all of the bulbs.


There is one important thing to note though. If the SimSwitch is off (regardless of the bulbs status), then telling Alexa to turn off SimSwitch will do nothing, because Alexa sees the SimSwitch is already off. You can either
(A) Turn on then back off the SimSwitch to resync… or
(B) Program webCoRE to automatically turn off the SimSwitch whenever the bulbs are off

If you choose option (B), you will have to be careful with your programming so as not to create a loop.


#4

Copy that. So I am already half way there (the command optimization is currently disabled)

And option A) is what I currently have to do. I am in the scenario you described where the sim switch is off, and the bulbs are set to an on state via another form of trigger (manual “wife” change…) and then the command to “turn off the kitchen lights” does not function. Despite alexa saying “okay”.

I completely overlooked option B. I will look into that now, being careful to not create a loop.

That sounds like the solution. Thanks!


#5

OK, I have a crazy question, and depending on your answer, there may be a super easy solution.

Do you use the SimSwitch to turn on AND off the lights?
Or only off as seen in your original post above?