While copying an action from one location to another in a rule it has broken itself

Every time I load the rule I now get the error below - any idea how to fix it as it looked totally fine in the actions view....

Running 2.3.4.153

Any idea how to debug this please? Its probably my most complex rule (not massive but such that I cant remember all the little tricks I used while writing it) so would be annoying to start from scratch.

I can export to Json, and I can clone, but the result always has the same problem, so I clearly need to fix something... but how do I know where to start?

I tried updating to 2.3.5.104 but it doesnt seem to have helped. :frowning:

Updated again to latest version but still having the same error. Is there a way to recover a role from JSON? Or at least work out what is causing the failure?
@bobbyD or @support_team please can you help with something for me to investigate?

Once the rule became broken, there is most likely no way to recover it. By far the best thing to do is to recreate the rule, in terms of time spent.

Please post here a screenshot of the first few lines of Application State from the App Status page (gear icon). I'm looking for the object called actions.

Ok, will try and work out how I did a few things, but that actions hashmap does also contain some prompts if I read it. Would still be keen to make sure it doesnt happen again!

{44={wait=null, delay=, modes={}, method=getEndIf, indent= , rule=null, cond=0}, 45=null, 46=null, 47=null, 26={wait=null, delay=, modes={}, method=getSetVariable, indent=, rule=null, cond=0}, 48={wait=null, delay=, modes={}, method=getSetVariable, indent= , rule=null, label= Set AlarmArmingRuleRunning to false , cond=0}, 27={wait=null, delay=, modes={}, method=getSetVariable, indent=, rule=null, label=Set AlarmArmingRuleRunning to false , cond=0}, 28={wait=null, delay=, modes={}, method=getSetVariable, indent= , rule=null, label= Set AlarmArmingRuleRunning to false , cond=0}, 29={wait=null, delay=, modes={}, method=getSetVariable, indent= , rule=null, label= Set AlarmArmingRuleRunning to false , cond=0}, 30={wait=null, delay=, modes={}, method=getDefinedAction, indent= , rule=null, label= refresh() on Visonic Alarm , cond=0}, 31={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=6, label=IF (<b>NOT</b> Visonic Alarm alarmStatus(<span style='color:black'>Disarmed</span>) *contains* Disarmed<span style='color:orange'>(F)</span><span style='color:orange'> [FALSE]</span>) THEN , cond=0}, 32={wait=null, delay=, modes={}, method=getEndIf, indent=, rule=null, label=END-IF , cond=0}, 11={wait=null, delay=, modes={}, method=getExitRule, indent= , rule=null, label= Exit Rule , cond=0}, 33={wait=null, delay=0:00:10, modes={}, method=getDelay, indent= , rule=null, label= Delay 0:00:10 , cond=0}, 34={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=7, cond=0}, 13={wait=null, delay=0:05:00, modes={}, method=getDelay, indent= , rule=null, label= Delay 0:05:00 , cond=0}, 35={wait=null, delay=, modes={}, method=getEndIf, indent= , rule=null, cond=0}, 14={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=4, label=IF (Chris Pixel 3, Carol Pixel 4a, Chris Pixel3-Wifi, Carol Pixel4a-Wifi any present<span style='color:green'>(T)</span><span style='color:green'> [TRUE]</span>) THEN , cond=0}, 36={wait=null, delay=, modes={}, method=getExitRule, indent=, rule=null, cond=0}, 15={wait=null, delay=0:10:00 (cancelable) (cancelable), modes={}, method=getDelay, indent= , rule=null, label= Delay 0:10:00 (cancelable) , cond=0}, 37={wait=null, delay=, modes={}, method=getIfThen, indent= , rule=8, cond=0}, 16={wait=null, delay=, modes={}, method=getEndIf, indent=, rule=null, label=END-IF , cond=0}, 17={wait=null, delay=, modes={}, method=getMsg, indent= , rule=null, label= Notify Chris Pixel 3, Carol Pixel 4a: 'Alarm will arm soon' , cond=0}, 18={wait=null, delay=, modes={}, method=getElse, indent= , rule=null, label=ELSE , cond=0}, 19={wait=null, delay=, modes={}, method=getExitRule, indent= , rule=null, label= Exit Rule , cond=0}, 2={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=2, label=IF (Chris Pixel3-Wifi, Carol Pixel4a-Wifi all not present<span style='color:orange'>(F)</span> <span style='color:darkblue'>AND </span> Visonic Alarm alarmStatus(<span style='color:black'>Disarmed</span>) = Disarmed<span style='color:green'>(T)</span><span style='color:orange'> [FALSE]</span>) THEN , cond=0}, 4={wait=null, delay=, modes={}, method=getEndIf, indent=, rule=null, label=END-IF , cond=0}, 7={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=3, label=IF (Chris Pixel3-Wifi, Carol Pixel4a-Wifi all not present<span style='color:orange'>(F)</span><span style='color:orange'> [FALSE]</span>) THEN , cond=0}, 8={wait=null, delay=, modes={}, method=getEndIf, indent=, rule=null, label=END-IF , cond=0}, 9={wait=null, delay=, modes={}, method=getElse, indent= , rule=null, label=ELSE , cond=0}, 41={wait=null, delay=, modes={}, method=getIfThen, indent= , rule=9, cond=0}, 42={wait=null, delay=, modes={}, method=getMsg, indent= , rule=null, cond=0}, 21={wait=null, delay=, modes={}, method=getRuleActions, indent=, rule=null, label=Run Actions: Xiaomi 1 Alarm Trigger , cond=0}, 43={wait=null, delay=, modes={}, method=getExitRule, indent=, rule=null, cond=0}}

Thanks!

Thanks. I found the source of this problem, and it will be fixed.

3 Likes

Not sure if 'fixed' will stop it from happening again, or actually bring the rule back to life. But will save some time on the weekend to try one or the other!
Thanks!

The fix would bring the rule back to life, and prevent it from occurring in the future.

3 Likes

@bravenel Thank you for deploying this fix so quickly, great to be able to remind myself what I had done and have taken a screenshot so I can recreate the logic next time around.

Curiously since the fix I now get a different error as in the screenshot. The rule line that I think should run next (based on what I can see in the logs) is just a simple Hub variable set. Ive clicked edit on each line in case it isnt saved correctly but still giving an error. Anything else to try or just recreate the rule?

I would need to see the rule actions screen shot.

Thank you!

Largely as before, but a few small changes in ID, presumably from me trying to edit/save - thinking that is probably what is needed to fix it....

{44={wait=null, delay=, modes={}, method=getEndIf, indent= , rule=null, cond=0}, 26={wait=null, delay=, modes={}, method=getSetVariable, indent=, rule=null, cond=0}, 48={wait=null, delay=, modes={}, method=getSetVariable, indent= , rule=null, cond=0}, 27={wait=null, delay=, modes={}, method=getSetVariable, indent=, rule=null, label=Set AlarmArmingRuleRunning to false , cond=0}, 28={wait=null, delay=, modes={}, method=getSetVariable, indent= , rule=null, label= Set AlarmArmingRuleRunning to false , cond=0}, 29={wait=null, delay=, modes={}, method=getSetVariable, indent= , rule=null, label= Set AlarmArmingRuleRunning to false , cond=0}, 50={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=10, cond=0}, 51={wait=null, delay=, modes={}, method=getEndIf, indent= , rule=null, cond=0}, 30={wait=null, delay=, modes={}, method=getDefinedAction, indent= , rule=null, label= refresh() on Visonic Alarm , cond=0}, 52={wait=null, delay=, modes={}, method=getSetVariable, indent= , rule=null, cond=0}, 31={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=6, label=IF (<b>NOT</b> Visonic Alarm alarmStatus(<span style='color:black'>Disarmed</span>) *contains* Disarmed<span style='color:orange'>(F)</span><span style='color:orange'> [FALSE]</span>) THEN , cond=0}, 32={wait=null, delay=, modes={}, method=getEndIf, indent=, rule=null, label=END-IF , cond=0}, 11={wait=null, delay=, modes={}, method=getExitRule, indent= , rule=null, label= Exit Rule , cond=0}, 33={wait=null, delay=0:00:10, modes={}, method=getDelay, indent= , rule=null, label= Delay 0:00:10 , cond=0}, 34={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=7, cond=0}, 13={wait=null, delay=0:05:00, modes={}, method=getDelay, indent= , rule=null, label= Delay 0:05:00 , cond=0}, 35={wait=null, delay=, modes={}, method=getEndIf, indent= , rule=null, cond=0}, 14={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=4, label=IF (Chris Pixel 3, Carol Pixel 4a, Chris Pixel3-Wifi, Carol Pixel4a-Wifi any present<span style='color:green'>(T)</span><span style='color:green'> [TRUE]</span>) THEN , cond=0}, 36={wait=null, delay=, modes={}, method=getExitRule, indent=, rule=null, cond=0}, 15={wait=null, delay=0:10:00 (cancelable) (cancelable), modes={}, method=getDelay, indent= , rule=null, label= Delay 0:10:00 (cancelable) , cond=0}, 16={wait=null, delay=, modes={}, method=getEndIf, indent=, rule=null, label=END-IF , cond=0}, 17={wait=null, delay=, modes={}, method=getMsg, indent= , rule=null, label= Notify Chris Pixel 3, Carol Pixel 4a: 'Alarm will arm soon' , cond=0}, 18={wait=null, delay=, modes={}, method=getElse, indent= , rule=null, label=ELSE , cond=0}, 19={wait=null, delay=, modes={}, method=getExitRule, indent= , rule=null, label= Exit Rule , cond=0}, 2={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=2, label=IF (Chris Pixel3-Wifi, Carol Pixel4a-Wifi all not present<span style='color:orange'>(F)</span> <span style='color:darkblue'>AND </span> Visonic Alarm alarmStatus(<span style='color:black'>Disarmed</span>) = Disarmed<span style='color:green'>(T)</span><span style='color:orange'> [FALSE]</span>) THEN , cond=0}, 4={wait=null, delay=, modes={}, method=getEndIf, indent=, rule=null, label=END-IF , cond=0}, 7={wait=null, delay=, modes={}, method=getIfThen, indent=, rule=3, label=IF (Chris Pixel3-Wifi, Carol Pixel4a-Wifi all not present<span style='color:orange'>(F)</span><span style='color:orange'> [FALSE]</span>) THEN , cond=0}, 8={wait=null, delay=, modes={}, method=getEndIf, indent=, rule=null, label=END-IF , cond=0}, 9={wait=null, delay=, modes={}, method=getElse, indent= , rule=null, label=ELSE , cond=0}, 41={wait=null, delay=, modes={}, method=getIfThen, indent= , rule=9, cond=0}, 42={wait=null, delay=, modes={}, method=getMsg, indent= , rule=null, cond=0}, 21={wait=null, delay=, modes={}, method=getRuleActions, indent=, rule=null, label=Run Actions: Xiaomi 1 Alarm Trigger , cond=0}, 43={wait=null, delay=, modes={}, method=getExitRule, indent=, rule=null, cond=0}}

There is no rule posted in this topic.

Sorry Im not clear what you need when you say actions screenshot then?

I thought you meant this

This is another screenshot.

The rule always ends up leaving the Hub Variable AlarmArmingRuleRunning as true as the error is happening at some point in the rule.

Be sure Action logging is on for the rule, and then post the a screenshot of the full set of logs for when it runs. Also, what hub release are you running? It would help if you update to the latest release before doing these steps.

Thanks, yes running latest 2.3.5.121 on a C7 hub.

Here is a screenshot where I have just recreated it

This one is nasty. Will need you to send me an export of this rule. See PM...

For anybody who experiences a similar problem in the future the fastest and best solution is to copy all the steps in the rule, publish the clipboard, then create a new rule, finally you should be able to paste all the steps into the new rule.

I know a more permanent fix is being looked at from the amazing hubitat team, but the solution above is likely a good solution to a wide range of rule based problems (problem here was some null actions that weren't visible in rule editor, but were stuck in the background - you could see the nulls in the copy tool).

There is indeed a bug fix coming for at least some of this.

1 Like

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