Need help with combining two pistons into one


#21

Yes I do when either is turned on, but I don’t want two messages when both are turned on. So no matter what combination is turned on or off only one message.


#22

Ok, I’ll throw something together in a few minutes.


#23

Thank you.


#24

Give this a try and let me know if it works the way you want it. If not, post up what’s not working and we’ll fix it.

The messages are the same for On and Off so you’ll have to edit them to the messages you want.


#25

Disregard the piston above - I figured out why it wasn’t working… it doesn’t like when the dates are blank at the beginning and always returns false.

With this piston, if you click TEST, it will populate the variables with a time in the past that will allow the on/off commands to be spoken if any lights are switched on or off. There’s also a new variable at the top to let you choose how long you want the lockout to prevent repeat messages if lights are cycled more frequently.


#26

OK, can’t test it until I get home tomorrow, but I did a test log. Here is the result, does it look correct? Again thank you for the assistance in this.



#27

Yep, looks good! The last two commands in the log was the setting of the variables so they have valid dates and times in them… Should be good to go.


#28

OK will test tomorrow when the wife isn’t around. Unless of course I get called in for a meeting. Thanks again. I will post the results.


#29

I started testing and so far it seems to be working. Occasionally I turn on a room and get no voice, but I will continue testing to rule out other things like network.


#30

Glad it’s mostly working! If you turn on a light and don’t get an announcement, if you could post the logs it’d be helpful to sort out what’s going on. My first thought is the lockout duration we have in there… but if all the lights were off for more than 5 minutes there shouldn’t be any issue.


#31

Yes I agree the lockout might be the problem. I will check tomorrow morning lockout time just to test. Thank you.


#32

@michicago Thank you I think it is working as expected. I believe I have to make one change which is to move my wait command to before the speak command as words are getting chopped in the beginning of the sentence. The reason for this is I use EchoSistant and when you say (EXAMPLE) “Alexa turn on the lights in my family room” She responds with turning on the lights, then my piston speaks. Does that sound like the problem?


#33

Glad it’s working! If you run into more glitches with it, post up here and we’ll get it figured out.

Your theory on the chopped up audio makes sense to me - it might be speaking a command and then have to process the incoming message at the same time and get a bit overwhelmed.


#34

Do you think moving the wait to before the speak command would help?


#35

I wish I knew, but I don’t use Sonos, Alexa, or any speaking home controls to offer any advice. It seems worth trying from what you said though.