schedule that has multiple conditions and actions

Posted on
Fri Jul 26, 2013 8:47 pm
esprits300 offline
Posts: 49
Joined: Apr 29, 2012

schedule that has multiple conditions and actions

Hello. I have a question on how to or if this is possible, id like to set a schedule that has multiple conditions that act differently with multiple actions. example. i have a weekday schedule which is an umbrella for all my commands. it has lights on, HVAC set, Alarm enable, etc etc. What id like to do is setup a hold. so if i set hold on the hvac, it wont change the temp. problem is if i add that in the conditions, the whole thing will fail and i don't get the lights and alarm to work. make sense? now the obvious fix is to setup each item i want in its own schedule BUT that is both a lot of work (I'm my case) and not clean looking and crazy to manage. i cant seem to find this and ive tried combos of triggers, schedules, action groups, etc but no go. anyone have a solution for this? thank you!

Posted on
Fri Jul 26, 2013 11:03 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: schedule that has multiple conditions and actions

I do this all the time using Indigo variables and embedded scripts within the actions that have special conditions (most of them in AppleScript because they're usually shorter to type, but some are in Python because there are some things you can't do with AppleScript).

For your example, in the action that conditionally sets the HVAC, you could do something like...
Code: Select all
set ts to device "Main Thermostat"
if value of variable "MyHVACVariable" is "true" then
   set hvac mode of ts to heatCoolOn
   set fan mode of ts to fanAutoOn
   set heat setpoint of ts to 68
   set cool setpoint of ts to 75
end if

If you didn't want to write as much code, you could create the same variable in Indigo, then create a trigger that executed when that variable's value changed to "true". The Action Group code would then be shortened to
Code: Select all
if <whatever condition you wanted here> then
   set value of variable "MyHVACVariable" to "true"
end if

Posted on
Sat Jul 27, 2013 7:37 am
jay (support) offline
Site Admin
User avatar
Posts: 18255
Joined: Mar 19, 2008
Location: Austin, Texas

Re: schedule that has multiple conditions and actions

I think your tradeoff is this: a single schedule with your conditional logic specified in code (as nathan suggests) or multiple schedules, one for each independently controlled part which doesn't require code but is a greater number of schedule. I suspect if you break it up into the discrete parts that need separate conditions you'll find that it's not really that many different schedules.

[edit] and while it may seem like it has the potential to me a lot mf maintenance, it likely won't once it's working but will only require slight tweaking. Good HA, while always growing, usually just gets out of your way so that it doesn't need a lot of maintenance.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Jul 27, 2013 8:55 am
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

Re: schedule that has multiple conditions and actions

I'll also add that you can use the duplicate button to copy an existing schedule, then you just need to change the conditional and action panels. And don't forget you can use the folders for organization.

Image

Posted on
Mon Jul 29, 2013 6:19 pm
esprits300 offline
Posts: 49
Joined: Apr 29, 2012

Re: schedule that has multiple conditions and actions

thanks for the replies. I actually had sometime i liked setup a while ago, but it got ridiculous. I had 4 schedules a day, then weekday/weekend and it worked fine. then all of a sudden daylight savings happened. so 8 schedules turned into 16. that was way way to many for me. one wrong change and frankly i got lost. i did all kinds of different ways and setups and nothing was simple. of course it all worked but making one small change was disastrous without 2 days of planning! i dont want a system that complex. thats just silly (to me for my application). i have been hoping this would be added as a feature but the lack of discussion on the site lead me to believe it was just me having the issue :( so i just had to ask. right now i have 8 schedules and just manually update them at daylight savings and it works pretty simply. i have to take some time twice a year but its a FAR cry from setting up 16 and remembering small changes. i was doing things like tracking my iphone and if i was home and it was 7pm make sure the garage door is shut - for instance. problem is in DST its an hour off AND i change my schedule to be a little later in DST so i HAD to have 2 schedules. i just abandoned the idea, but if it is possible at some point, what would be nice is an option in the schdule to tie a condition to an action, and then be able to make multiple action/conditions under one schedule. i guess for now ill test that code and see if its really that simple (i try to stay away from custom code and make it as basic as possible). thanks again!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 14 guests