[2.3.0.113] Wait expression met on any illuminance change

I have a rule for motion lighting in my room where the lights will turn off when a certain illuminance is reached. The desired illuminance is set as a local variable (80)

However any change in illuminance (up or down) will trigger the wait expression.

dev:97 2021-12-01 09:33:47.224 am info Office Lights was turned off [digital]
app:497 2021-12-01 09:33:47.183 am info Action: IF (Office Lights is on) Dim: Office Lights: 0 --> fade: 2
app:497 2021-12-01 09:33:46.990 am info Office Motion Lighting: Actions stopped by Office Motion Lighting
app:497 2021-12-01 09:33:46.892 am info Action: Cancel Timed Actions: This Rule
app:497 2021-12-01 09:33:46.820 am info Wait over: Office Motion Sensor illuminance 62
app:497 2021-12-01 09:33:46.780 am info Office Motion Lighting event: Office Motion Sensor illuminance 62
dev:38 2021-12-01 09:33:46.711 am info Office Motion Sensor illuminance is 62 Lux
app:497 2021-12-01 09:33:26.150 am info Action: Wait for events: Illuminance of Office Motion Sensor is >= lux OR Office Lights turns off --> timeout: waitSecs
app:497 2021-12-01 09:33:26.130 am info Action: Fade Office Lights down to 0 over 1 minute with 3.0 seconds interval --> delayed: delaySecs(cancelable)
app:497 2021-12-01 09:33:26.074 am info Action: Set waitSecs to (delaySecs + 60.0)
app:497 2021-12-01 09:33:26.071 am info Action: END-IF
app:497 2021-12-01 09:33:26.068 am info Action: Set delaySecs to 120 (skipped)
app:497 2021-12-01 09:33:26.065 am info Action: ELSE (skipped)
app:497 2021-12-01 09:33:26.062 am info Action: Set delaySecs to 180 (skipped)
app:497 2021-12-01 09:33:26.059 am info Action: ELSE-IF (Mode is Evening) THEN (skipping)
app:497 2021-12-01 09:33:26.033 am info Action: Set delaySecs to 300
app:497 2021-12-01 09:33:26.030 am info Action: IF (Mode is Day) THEN
app:497 2021-12-01 09:33:26.025 am info Action: END-IF
app:497 2021-12-01 09:33:26.022 am info Action: Exit Rule (skipped)
app:497 2021-12-01 09:33:26.020 am info Action: Dim: Office Lights: 0 --> fade: 2 (skipped)
app:497 2021-12-01 09:33:26.016 am info Action: IF (Illuminance of Office Motion Sensor is >= lux) THEN (skipping)
app:497 2021-12-01 09:33:25.980 am info Action: IF (Office Lights is off) Exit Rule (skipped)
app:497 2021-12-01 09:33:25.911 am info Wait over: Office Motion Sensor motion inactive
app:497 2021-12-01 09:33:25.905 am info Office Motion Lighting event: Office Motion Sensor motion inactive
dev:38 2021-12-01 09:33:25.812 am info Office Motion Sensor is inactive
app:497 2021-12-01 09:33:06.798 am info Action: Wait for events: Office Motion Sensor inactive
OR Illuminance of Office Motion Sensor is >= lux
OR Office Lights turns off
app:497 2021-12-01 09:33:06.766 am info Action: Dimmers per mode: Office Lights
Day: 100
Evening: 70
Night: 20
app:497 2021-12-01 09:33:06.594 am info Office Motion Lighting: Actions stopped by Office Motion Lighting
app:497 2021-12-01 09:33:06.539 am info Action: Cancel Timed Actions: This Rule
app:497 2021-12-01 09:33:06.474 am info Office Motion Lighting Triggered
app:497 2021-12-01 09:33:06.462 am info Office Motion Lighting event: Office Motion Sensor motion active
dev:382 021-12-01 09:33:06.404 am info Office Motion Sensor is active

It should only match the expression when it is higher than the desired level. In this case 62 is < 80, so the expression should not have been matched.

I will look into this. Please, in the future use screenshots of logs not copy/paste.

I set up a rule with a similar Wait for Events as yours, and don't get the failure you are seeing:

And the logs of it running:

Notice that first I changed the sensor to 22 lux, which did not end the Wait. Then I changed it to 77 and it did end the Wait as it should.

Turn on Display current values in your rule so we can see what is actually there when it runs. Also, I'm running this one on an internal build, but this build hasn't really changed how this one thing would work. Next up for me is to put a hub on 113 like yours, and try the same thing again.

Update: I just did this same thing on 113 build, and it doesn't fail for me. So at this point I can only suggest that try to capture this again with Display Current Values on, and do a screenshot of the logs.

@bravenel Thanks for looking into it

I rewrote the motion lighting on Sunday, and this week the lights just kept turning off randomly. I was going crazy trying to figure out where I had gone wrong with the rule, but the logs definitely show that the wait is being canceled by the illuminance. Fortunately this is simple for me to reproduce as I just have to open of close my office blinds to get the lux to change. So I was able to capture fresh logs with current values for you.

Here is the rule (unchanged from before):

And a screenshot of the logs

Update: It just happened again with lux increase (still below the target) so I wanted to include these logs.

I have stopped and started the rule. I have clicked 'Update Rule', and I have rebooted the hub. All to no avail. I have an identical app in the bedroom that does work. Only difference there is that I don't have a lux variable, it is hard coded to 80, and I set the CT as well.

Well that's interesting. I don't know why it fails for you but works for me. See PM I'm sending you.

I have rewritten the rule from scratch instead of copying it from the motion lighting app for another room. This time I am using Wait for expression instead of Wait for event as that is what I really wanted but I hadn't changed it because I am afraid of editing conditions in 2.3.0, doing so has aggravatingly corrupted entire rules with An unexpected error has occurred on a number of occasions.

Anyhow, the new rule has been working perfectly all day and I haven't had any lights turn off unexpectedly. I've stopped and renamed the old rule in case you want me to test anything out.

2 Likes

Download the Hubitat app