House state logic question

Posted on
Wed May 17, 2017 6:33 pm
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

House state logic question

I suspect this is a simple issue, but I'm not exactly sure how to make this work.

I have multiple "house states": Weekday, Weekend, Holiday, and Vacation. Most of these are self explanatory, and are automatically changed based on a schedule. Vacation is used when we leave town.

So I have a series of things that are triggered when the houseState is changed to Vacation:
-- Alarm armed to max
-- certain lighting schedules changed
-- outdoor speakers disabled
-- etc, etc, etc.
-- the light by our exit door is even blinked to show that Indigo received the change and executed the commands (I thought that was a nice touch)

That is all easy to do with a single trigger on "variable houseState changed to vacation".

But I am having trouble figuring out how to reverse these changes when the house is taken out of Vacation mode and changed to one of the other states.

I can't just trigger on "variable houseState becomes not equal to Vacation", right? I assume that means "the variable just took a value of anything other than Vacation," and not, "the value changed away from the value Vacation." Am I correct on that?

Because that would execute every time the houseState changed to anything other than Vacation (such as the change from weekday to weekend on Saturday morning).

And I don't think I can put a conditional on the tridder like "houseState becomes not equal to Vacation, execute actions if houseState is equal to Vacation", because the state would have already chaged to something else before the conditional was checked, and therefore the conditional would never be met.

I think I am missing some easy solution to detect a change away from a particular variable value, irrespective of what the variable value becomes.

Thanks.

Posted on
Wed May 17, 2017 8:05 pm
aldera offline
User avatar
Posts: 188
Joined: Aug 30, 2016
Location: Michigan, USA

Re: House state logic question

Hi,

I'm still pretty new at this but couldn't you just create a trigger for each state, (Vacation, Holiday, etc.)? Then select the "becomes equal to" option for each state you want to trigger on. Wouldn't that work for you?
Attachments
1.jpg
1.jpg (59.28 KiB) Viewed 2690 times

Posted on
Wed May 17, 2017 8:28 pm
Sharek326 offline
User avatar
Posts: 377
Joined: Jul 20, 2014
Location: Lansford, PA

Re: House state logic question

I have something similar to what you are doing although I don't use as many States. I mainly use Home, Away, Night and Vacation.

Home is an everyday state that fires the same time each morning and basically wakes the house.

It turns on the coffee pot
Adjusts Heat / AC
Makes Cameras go Passive
Opens Blinds etc

Away is when I go out but not on vacation
turns off the lights
Arms Alarm
Makes Cameras go Active

Night Basically Puts the house to sleep
Similar to away with some changes

Vacation is similar to Away and Night with some changes

Each has a trigger with a button on my control page that updates HouseStatus in my Variables which then fires the action group

Home also has a scheduler set for it to wake the house automatically at 8AM regardless

Posted on
Thu May 18, 2017 7:05 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: House state logic question

I had exactly this question, I think, but regarding parsing weather states. The answer someone offered was:

Trigger is "becomes not equal to Vacation,"

Then conditions test the house mode it changed to. And that can test for multiple modes.

Or am I missing something from your case?

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Thu May 18, 2017 9:06 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: House state logic question

If you want a trigger that says "when the previous value of the variable was 'vacation' but now it's something else", there's nothing built-in to do that. Can you thoroughly describe the use-case for such a trigger in as much detail as possible? Maybe there's another approach to the logic.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu May 18, 2017 1:38 pm
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: House state logic question

Can you thoroughly describe the use-case for such a trigger in as much detail as possible? Maybe there's another approach to the logic.


Thanks... here goes:

I drive up in my driveway after a vacation. I want to change my house mode to one of the other three possibilities in my system (weekend, weekday, or holiday). That part is easy, it's built in as a pop up on one of my control pages. I click on it and it changes.

But I want that change (away from Vacation mode to any of the other modes) to trigger several things:

1) Disarm the alarm
2) Re-enable the outdoor speakers (via an insteon module)
3) resume lighting schedules consistent with us being home.
There are a few other things, but you get the idea. They can all be in a single action group.


These are things which are specific to re-occupying the house after a vacation. They should not be triggered by, say, me changing the house to Holiday mode when off for a few days, or on Saturday morning at 12:00 AM when the house switches from weekday to weekend mode.

Right now I just do them manually... change the house mode on the control page, disarm the alarm, turn on the Insteon module on the outdoor Sonos amp, etc. But it seems like there should be a way to have Indigo notice that I have left the Vacation state and resumed any of the other states.

I guess I could create an END VACATION button on my house state pop up page, so I'd get it down to 2 clicks-- change the state then click END VACATION to trigger the needed actions. I was just trying for something a little more elegant than that.

It's also possible I am being unduly influenced by my recent reading of the big Steve Jobs Biography...

Posted on
Thu May 18, 2017 3:02 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: House state logic question

I think you're probably overloading what that single variable means: occupancy, special types of days, etc. This, in and of itself, isn't necessarily bad, but it has led you to this point. You might want to reconsider what the potential values of that variable actually mean. I have two different variables that represent occupancy (home, away, vacation) vs day types (weekday, weekend, holiday). I then use those two variables together to determine what things need to happen.

For instance when occupancy becomes home, it's likely you'll want to disarm the alarm (and some of those other things). That may (or may not) be effected by the day type, but you get my point - they represent two different "things". Once you start making your automation logic this complex, it's likely you'll need to write some scripts to help coordinate things (thereby creating a smallish state machine).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri May 19, 2017 6:21 am
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: House state logic question

I think I figured it out. Will work on it this weekend.

Trick is to create a second (boolean) variable called Vacation that can lag the main house state. It'll become true when the house is put into vacation mode.

Then, I can trigger the "home from vacation" actions on any change of the houseState variable, but condition it on Vacation being true. In the set of actions, I'll add in one to reset Vacation to false.

I think that will work.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests