Use certain Alexa to turn on items in that room

variables
triggers
piston

#32

And finally (regarding webCoRE), I mostly control my two ceiling fans with a piston for each fan that watches/reacts to temperature range changes with TOD, presence, furnace/AC modes and override switch conditions. Both pistons are identical with a couple different variable values.

Here’s the temperature ranges I use (changeable via variables in each piston):
image

And, here’s the piston for the Master Bedroom:


#33

There was a bug, so it’s not going to be quite as clean as I had hoped. It worked but using one simulated switch as a trigger for each room was an issue. If I turned on a fan in one room and then moved to another and wanted to turn it on. I would need to turn it off and then back on so the simulated switch would change.

So I opted for another approach which I will not be able to test until tomorrow probably. I will create a Alexa command probably just call it Ceiling Fan, which will toggle the RoomFan simulated switch. Then I will determine which room and then toggle the state of the Fan in that room. So after I say Ceiling Fan or whatever I end up calling it the fan in that room will turn on if off and off if on.

After I get that working I will post it if you want. I have the piston written but I still need to create the Alexa routine and test. that shouldn’t take long but I won’t get home until late tonight so it will be Thursday before I can check it out…


#34

One loophole for this is to:

  • Create two SimSwitches. (IE: FanOn and FanOff)
  • Alexa routine = “Alexa, turn on CeilingFan” turns on both SimSwitches
  • Alexa routine = “Alexa, turn off CeilingFan” turns off both SimSwitches

Then, webCoRE’s piston can be something like this:

If FanOn changes to on
Then 
    Do cool stuff
    Turn off FanOn  (to reset itself)
END IF

If FanOff changes to off
Then 
    Do cool stuff
    Turn on FanOff  (to reset itself)
END IF

With this method, the SimSwitches or voice commands cannot get out of sync.
You will always be able to say one command to get the proper results.


#35

I thought about that, as that is what I do with my automated shades. I have a on and a off switch for each shade. On is a change from off to on on the ON switch and off is a change from on to off on the OFF switch. I was trying to do it with just one. My current method seems to be working.

I got home a bit early and was able to try it. My routine toggles the RoomFan switch when I say Ceiling Fan and then my Piston toggles the state of the Ceiling fan in the room I said it. Not quite as clean as saying turn it on or off, but still pretty good.


#36

I am going to be working on this in the next couple of weeks. I just moved, so I am a bit behind. I hope you will be around to assist me as, I really want to get it going.


#37

Not a problem. I spend an inordinant and unhealthy amount of time on these forums anyways, lol :stuck_out_tongue:


#38

So my ceiling fan piston works really well and it got me to thinking. I should try this with other things. I have Leviosa Shades in several rooms and using this technique I can now just say raise or lower shade and it raises or lower shade in the room I am in.

My wife did not seem impressed, however.


#39

If you EVER achieve that with a smart home, please let us know HOW:)))))))))
Your “How to post” will be the most visited and liked.


#40

This may be a bit challenging…

I find that most women use computers as a tool to accomplish something else…
While men typically see a computer as a “toy” and/or an extension of the self.


When it comes to getting our wives more excited with SmartHomes, the best advice I can give is to approach it from her perspective. If you know she likes her bubble baths, brainstorm with her, bounce ideas off of her, but let her have total control of your latest piston.

If something bothers her around the house, try to envision a piston that will make her life easier…

She won’t care about the programming logic that you add to the piston, but if we really listen to their requests, and take it to the next level, you can rest assure that she will at least like that part of her SmartHome. (one step at a time, LOL)


Over time, there will be more and more pistons hand crafted specifically for her…
She will come to expect & rely on them… (and may get frustrated during errors)

In my opinion, all of this is positive, and heading in the right direction.


#41

You must know my wife!


#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.