Delays and Conflicting Events

I have a heater in the garage (I use as a shop) that Iā€™ve set up ecobee rules for. In the event a garage door is open, the heater turns off. It turns back on again when the garage door closes. Letting the sun heat the world.

Iā€™m now trying to make the heat the most efficient. I set the heat to change at day mode change between 55* and 65. Works great. Now I want to add one more tweak - when Iā€™m in the garage, I want the heat to jump up to 67*.

Iā€™ve been using the garage lights to be the occupancy trigger. When theyā€™re on, set heat to 67. Off, back to the lower heat (Iā€™ll convert to mode specific later).

IF (Shop Ceiling Lights(on) is on(T) [TRUE]) THEN
Delay 0:10:00
IF (Shop Ceiling Lights(on) is on(T) [TRUE]) THEN
Thermostats: Garage Ecobee --> Heat: 67
END-IF
ELSE
Thermostats: Garage Ecobee --> Heat: 62
END-IF

The issue Iā€™m having is there are situations where someone turns on the lights for only a few minutes which causes the heater to cycle on barely before the lights are turned off again. So, initially I entered a delay...but now Iā€™m wondering how delays work.

Iā€™m assuming a delay doesnā€™t cancel if an opposing event is triggered so for now, I then check to see if the lights are still on before turning the heat up. Is there a way to cancel a pending delay from a previous event?

Thanks,

Matt

Correct, the rule re-triggering does not cancel any delays. But you can mark the "cancel?" (displays as "cancelable" once in the actions list view) option on that delay and use a "Cancel Delayed Actions" action when appropriate, which will cancel delays marked as such. "When appropriate" here would probably be when the switch turns off, and if your trigger is only "on," you'd need to make it "changed" instead and put the "Cancel Delayed Actions" inside an ELSE you can add before your last END-IF (so it will run when the lights change and become off). That being said, if your trigger is "on" now, I'm not sure why you have that outer conditional in the first place--it isn't a check you need to make there since you know the lights are on, otherwise the rule would not have triggered. (EDIT: Nevermind, I missed the ELSE after!)

Alternatively, you can use a "Wait for event" and choose "elapsed time," which cancels itself upon the rule retriggering (so potentially fewer clicks than "Delay," though you can achieve the same outcome with both). But you'd still need to make sure your rule gets triggered at the appropriate times, so with an "on" trigger alone it wouldn't do that (but it would with a "changed" trigger, it would).

The trigger event is ā€œswitch changedā€ so the first logical condition is to evaluate the state of the switch = ON. The else condition (fall through) would handle the OFF state of the switch.

I see the wait for but a set amount of time doesnā€™t appear to be an option.

Does it work from one event into a historical one thatā€™s currently in wait? I need to see how to implement a cancel delay. Iā€™m not sure I get it. Iā€™ll go look for an example.

Thanks.

Oops, missed the ELSE! Yes, that makes sense. For "Wait for elapsed time," choose "Wait for event," then choose "elapsed time" as the capability (rather than a regular device capability like motion, switch, etc.). You'll then be able to configure the amount of time. If you don't see this option, you aren't on 2.2.4 or newer, which is when this feature was introduced.

I'm not sure what you mean with the "historical" wait. Any event on the platform matching a trigger for your rule will (in addition to, as expected, running the rule actions from the beginning again) cancel any in-progress waits for that rule. For examples on "Cancel Delayed Actions," I'd look at the docs--there is one as one of the first examples. But in many cases now (the feature is new), a "Wait for elapsed time" will save extra clicks to get the same result.

Ok, I get it now. The cancel delay is used to cancel an pending delay in a previous event.

I think it will work well in my use-case perfectly. In the event someone turns off the lights within 10 minutes, the ELSE condition will be hit, the previous delay will be cancelled, and the thermostat will be set (potentially back) to the non-occupied temp of 62*.

IF (Shop Ceiling Lights(on) is on(T) [TRUE]) THEN
Delay 0:10:00
IF (Shop Ceiling Lights(on) is on(T) [TRUE]) THEN
Thermostats: Garage Ecobee --> Heat: 67
END-IF
ELSE
Cancel Delayed Actions
Thermostats: Garage Ecobee --> Heat: 62
END-IF

Did I use it correctly?

That looks good to me! Just make sure you checked the "cancel?" box on that "Delay 0:10:00" action (marking it eligible for cancellation), otherwise the "Cancel Delayed Actions" won't actually do anything.