Use certain Alexa to turn on items in that room

variables
triggers
piston

#42

Here is the piston that will make her happy:

IF any motion sensors change to ACTIVE,
Then
With Webcore
DELETE

LOL


#43

I have seen this time and time again


When I program for others, most of the time, I end up working with the husband
 But when the missus speaks up, she gets my full undivided attention.


You know the old cliché 
If momma ain’t happy, then ain’t nobody happy



#44

I agree with this. I will say that my wife is extremely tolerant of my hobby and even enjoys certain parts of it. However, she’s really happy about having control over actions (pistons) that affect her.

As an example, I have a “Gloomy Lights” piston that turns lights on/off in the living room and den during pre-set timeframes - based on external LUX levels, our presence and override switches. It works very well. However, although my wife liked it overall, when she was reading a book in the living room, she did not enjoy having the lights turn off when the LUX level increased. To me, it made perfect sense to turn the lights off when the LUX levels were sufficiently bright. Why would you need lights when it’s bright? To her though, she felt that it was a disruption when trying to read. Upon further discussion, she said that it felt like she couldn’t control the situation.

So, I gave her back control by adding additional logic to the piston for each affected room. If the lights in a particular room are turned on and set to 100% - normally via Alexa verbal command, the lights will remain unaffected (both on and off) by the changing LUX levels. Now, she feels like she has complete control of the lights when she wants it and loves the automation.

As you said, the ability to have control is the key.


#46

Excellent example @lflorack
 Thanks for sharing!

Most of my best pistons have “over-ride” methods to occasionally disable “normal” automations.


#47

So I have been playing with this a bit more lately, and I was trying to find a way to minimize the wait time. Below is what I came up with. I originally just had a straight 20 second wait. I have done some testing and this will execute about 5 seconds faster than just the 20 second wait. Someday if the system were able to react quicker it could save more, I think.

The problem I had though is when the global LastSpokenTo is already set to the echo you are speaking to. Then LastSpokenTo never changes so it waits the full 20 seconds. When the last echo is different it will toggle the ceiling fan in about 18 seconds, if echo is already correct it takes 25.

There is a 5 second wait in the ‘Current Echo’ piston. It waits 5 seconds before it does the get activity. That seems to be about the minimum to wait before that gets updated. I originally had the wait in this piston at 15 seconds to allow the global to update, that worked most of the time but not always. So I had to bump it up to 20.

The Piston ‘Clear Last Echo’ then sets the LastSpokenTo variable to a echo out in my garage that is hardly ever used. That way when I run one of these routine it is going to update. Not the cleanest method but the only one I could come up with. If I change the global in the routine that doesn’t work.
If anyone has any suggestions, please let me know.


#48

Excellent work that confirms my experience. Thanks.


#49

The trick is to send a “getdeviceactivity” command, which updates the
“lastSpokenTo” data and drops the reaction time down to around 5+ seconds.


#50

The get device activity is not the cause of the longest delay. I have a “getdeviceactivity” and I have a 5 second delay in the piston that determines activity. The longest delay is waiting for the global to be updated between pistons.


#51

Why are you using a global? Globals don’t get updated until the end of the piston, regardless of where you put them in the piston.

Also, I just realized I posted the wrong piston. In this piston, when I give the “Turn on/off Fan” command, it executes the getdeviceactivity, determines which echo received the command, and controls the fan assigned to that Echo. Very quick.


#52

Because I use the same routine among several pistons. I could make it faster by combining everything into one, but I prefer smaller pistons and the extra time is not a big deal to me.