Import from basic rules to Rule Machine results in error when rule runs

I had a rule that turned off multiple lights just after midnight each night. The rule would turn off a few lights at a time and then delay before turning off the next batch. Some of the lights were not turning off, so I decided to import the rule to Rule Machine to then play around with the delays and sequence to see if I could get it to be more reliable.

Two odds things happened. First, after import, some of the delays were converted to "Wait for event: -> elapsed time: 0:01:00" and some of the delays were converted to "Delay 0:01:00". I changed them all to be "Delay 0:01:00".

The second thing is that each time it runs, it throws this error:

Hubitat Error Logged: When time is 12:02 AM, turn off Lights with delay: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.toDouble() is applicable for argument types: () values: []
Possible solutions: toUnique(), toUnique(), toSorted() on line 5131 (method allHandlerT)

I deleted and re-imported the rule a second time with exactly the same results. I'm going to just recreate it from scratch in Rule Machine. I expect that will resolve the error, but this may be a bug in the import process. I exported both rules and can provide them to support if they would like to take a look at them.

While Bruce or someone may have to look at your actual import problem, this part is an important distinction. All waits, including "Wait for event," are cancelled if/when a rule is re-triggered. A "Delay" is not, unless you mark it "cancelable?" and also run a "Cancel Delayed Actions" action somewhere at an appropriate point elsewhere in your rule (often towards the beginning or in the other half of an IF THEN/ELSE if the rule is set up that way).

It's likely the import process would choose one or the other, depending on your selections in Basic Rule, though the "Wait" type is really the closest thing I can think of to anything Basic Rule offers (though there is likely some odd case I'm not considering off-hand) -- and no matter how you do it, cancellation by some means is probably what most people want in rule actions, though there are odd cases where you may need the finer control that "Delay" offers.

@bertabcd1234 Thanks for explaining the difference between the wait and delay. I wasn't entirely clear on what the distinction was. In this case, wait vs. delay shouldn't make a difference as the rule is triggered by a time of day and won't be retriggered until 24 hours later - long after all the delays or waits have expired.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.