So I am getting errors in RM5 I didn't get in RM4 on any delay by mode. It is either causing a runaway rule or wreaking havoc on my lighting. Here is the rule and the related log...
There is probably something worth investigating in terms of the errors message, and perhaps HE support staff can comment on that.
My contribution would be to question what you are trying to achieve with the rule, not as some kind of criticism, more to work out whether something like motion lighting would be more appropriate, or to try and work out how best to adjust the rule to achieve what you want. My gut feel is there is something not quite right with handling the different scenarios that could occur, can't quite put my finger on it.
A couple of questions I have are:
Why trigger on any one of the motion sensors becoming inactive and then wait for all of them to become inactive? Again, not a criticism, just wanting to know what you are trying to achieve. One option may be to use the Built-in Zone motion sensor app to group the sensors together under a single aggregated motion sensor.
The delays seem fine, is there any reason the Away and particularly the Day mode ones are not cancellable?
What is the idea behind the livingRoomLightsTrigger? Is that to indicate that the lights were triggered by motion so the rule to turn them off needs to act on motion becoming inactive?
So the issue with the motion app is that I have multiple complicated scenarios and changes in scenes, etc. Furthermore I like to have everything in one place and not spread out amongst numerous apps making it hard to remember who and what is doing what. These rules worked fine in RM4 using conditional statements. I figured the predicates would actually save a minor amount of processing time by not evaluating the entire rule. Here is the sister rule to turn things on. Basically the rule turns on lights at night so I don't go bump in the night. It allows for me to override though if I have guests staying in areas that would trigger the rule... i.e. friends crashing on the couch at night etc. It also checks the mode to only run when night is triggered.
Predicates must be met of mode and override switch being off
Subscribed motion sensor is Triggered
Lights set to red and dim set level
Trigger variable set... similar to private boolean
Companion rule to turn off
Predicates of override swith off and trigger truest be met
Motion sensor inactive triggers rule
Rule makes sure related motion sensors all go off before completing rule as that room has more than one sensor and it's a large room.
Delay by mode then Triggered
Lights dim off.
Again this all worked in RM4 no problem. I appreciate the suggestions of different apps but have tried them and thry just don't quite do what I need not to mention not germane here as the issue is why isn't RM handling this like it's supposed to? What has changed that is throwing the error? The on rule runs just fine;
I still wonder whether you should set the triggers in the off rule to be that ALL the motion sensors are off... rather than waiting for that in the rule? Maybe the rule is being triggered multiple times because of the trigger being any one of them becomes inactive...? Maybe that's the change in behaviour?
I also wonder whether the wait for inactivity at the start of the off rule needs to be cancellable? Not sure whether it can....
Random comments...
Fair point re "why has this changed in RM5", regardless of my own inclinations to go with Motion lighting, though not strong, there is still a benefit to understanding why things behave differently in RM5, even if they are only different to your own expectations.
I still feel that the Zone Motion app would be a good addition to replace steps 3 and 4 in the rule to turn the lights off. I'm also wondering if that causes some of the problems, with different instances of the rule firing... I've never been quite sure how that all works, Bruce / HE staff would be the ones to answer that for sure.
I will look into zone motion. It was put in place after I wrote all my RM4 rules... so right now was adapting RM4 to RM5 with minimal change and then tweak and modernize. That is the only room that has multiple sensors so it doesn't explain the kitchen rule throwing the same error. Following logic of the multiple sensors retriggering, the rule would still arrive back at the wait statement each time until the condition is met. But either way that all worked... and yes your suggestions there would be better code. Unfortunately while it throws the Java error, it kills the rule cold. On the kitchen there is only one motion sensor so no wait statement or multiple triggers and still the same error on the delay statement. Me thinks its a bug. I'd love to get into why I don't use motion lighting but let's just say it was frustrating, and too constraining. I have a bunch of rules for lighting that have worked well and all interact well... well until now. I also have another unanswered post of a Java error thrown while writing a rule that startd by calculating time values and it crashes rule machine leaving the rule unrecoverable. Staff hasn't commented on that at all. I don't mean to be snippy as I know they are proud of their rewrite of RM and I hope the bugs get worked out... but it should have been labeled BETA while RM 4 should not have been relegated to legacy... yet. Thanks for your help! If the Java exception gets solved I will try the zone option for the motion sensors.
No worries. They at least still offer RM4 while RM5 is being bedded in.
Looking at it again, if you do want to play with it again, you could perhaps play around with removing and re-creating the Delay Per Mode. But can appreciate wanting to get He staff to review it and see why you are getting the errors, that benefits everyone.
@bravenel Bruce sir, do you happen to know what I am doing wrong here? It seems to be throwing this error on all my delays per mode. I deleted and rewrote the delay statement as @sburke781 suggested but I am still getting a Java error as soon as the rule executes. The rule then does not complete and seems to halt on the delay. I know for sure this is happening on one other rule... checking through my other ones now. Any help is appreciated.