Wait for action question

@bravenel Apologies if this has been asked before, I couldn't find the answer:

If a rule is waiting for an action, and then the hub is rebooted... is it still waiting for the action after the reboot or is the whole thing reset?

Thanks

Rule's don't wait for "actions", they wait for trigger events or conditions. It will still be waiting for whatever it was waiting for before the reboot. If it was waiting for a certain time, and that time passed, then it would have missed that time.

Has this changed, or do waits within rule still run after a reboot?

I am running into a problem with a very simple rule - the wait just never gets completed. The rule is triggered in the evening and I have a wait until Day mode to have it complete. Between the two, there is always a reboot.

In the morning, the variable is still true and the fan remains on Auto, so I know the wait didnā€™t trigger...

Has anyone else seen anything similar?

Look at the App Status for the rule. See what subscriptions it has.

1 Like

Iā€™m assuming this is the Subscriptions you are referring to? Should it have more?

Once the rule is run next, I assume I should see a schedule added here?

That is what I'm talking about. At that moment, the rule was not waiting for a mode change, correct?

When it is waiting for a mode change, it would show an event subscription for your hub-name (Location), with value "mode".

Okay, Iā€™ll check again once the rule has been run later tonight to ensure that I see this subscription and will let you know if I donā€™t see it.

Thanks for your help with this! It is very much appreciated!

How does auto mode affect your fan's behavior, does it adjust fan speed based on temperature?

Yes, the warmer the temperature in the room, the higher speed the fan is set to, but only when it is in auto mode - controlled via a Rule in RM which detects when the fan is in Auto. I have created a second virtual fan to control the speed in auto mode, and this virtual fan (as well as the main one) sends the RF commands form a BroadLink RM Pro.

If I could write drivers, I would try to automate the behaviour directly within it (and have it send the commands too...) as I suspect it may be more efficient... But unfortunately, Iā€™m not there yet...

I am trying to get it to switch to auto mode automatically when someone walks in the room in the evening - otherwise, it stays off. Right now, it switches to auto without issue, but I am running into problems getting it to switch back using the Wait command...

I may have found the culprit. Is it supposed to behave that way?

The first time the rule is run, the Subscription is added:

But I suspect it gets removed the second time the rule is triggered and I have it exit as I donā€™t want to re-set it to auto in case I had to manually change it to something else.

Here is a screenshot of the event subscription (showing no change...) after the 2nd event trigger;

I had turned on all logging before the rule got triggered:

app:17932020-05-30 21:57:46.599 infoAutomation - Set Master Bedroom Fan to Auto when the temperature is high and motion in evening Exited

app:17932020-05-30 21:57:44.965 infoAutomation - Set Master Bedroom Fan to Auto when the temperature is high and motion in evening Triggered

app:17932020-05-30 21:57:44.788 infoAutomation - Set Master Bedroom Fan to Auto when the temperature is high and motion in evening: mZone-Person walks in Master Bedroom motion active

app:17932020-05-30 21:56:51.652 infoAction: Wait for events: Mode becomes Day

app:17932020-05-30 21:56:51.284 infoAction: Set Fan Speed: Master Bedroom Ceiling Fan to auto

app:17932020-05-30 21:56:51.194 infoAction: Set switchedToAuto to true

app:17932020-05-30 21:56:51.181 infoAction: IF (NOT Mode in Evening, Night FALSE) Exit Rule (skipped)

app:17932020-05-30 21:56:51.013 infoAction: IF (Variable switchedToAuto(false) = true FALSE) Exit Rule (skipped)

app:17932020-05-30 21:56:50.254 infoAutomation - Set Master Bedroom Fan to Auto when the temperature is high and motion in evening Triggered

app:17932020-05-30 21:56:49.647 infoAutomation - Set Master Bedroom Fan to Auto when the temperature is high and motion in evening: mZone-Person walks in Master Bedroom motion active

Waits are cancelled when the rule is triggered. This is the only thing that makes sense, otherwise you could have the same rule waiting and running at the same time (bad).

Probably, you need to rethink the flow of things and attendant logic.

When you post logs, use screenshots instead of copy/paste to make them easier to read.

1 Like

Yea... That seems to be it. I changed it to a more normal if condition and got the same result (See screenshot below).

I thought this was a perfect use case for the ā€œWaitā€ state though... It is too bad that it isnā€™t. Out of curiosity... why would it be bad if it was there multiple Wait conditions?

As a workaround. I will add a second trigger that fires when the mode changes to Day and capture that condition in an else if statement that I will add instead of the wait.

Also, thanks for the tip about the Log. I have sometimes had to share some very long logs, so got into the habit of doing a copy/paste...

In case it may be useful to someone in the future, here is the resulting rule:

Is your other rule able to trigger once the local variable here switchedToAuto is set to true? If so, what is the statement "Set Fan Speed: Master bedroom ceiling fan to auto" actually doing since auto mode is a virtual concept?

The variable is just there to prevent it to run more than once an evening. This allows me to turn off the fan manually or set it to a specified speed after it triggered, and the RM wonā€™t switch it back to Auto.

My other rule is triggered by temperature changes or if the fan is set to auto, and will exit if the ā€œmanualā€ fan is not set to ā€œAutoā€.

Hereā€™s a screenshot:

Sebastien, thanks for the explanation and sharing your rules. Pretty neat setup.

1 Like