Encounter a bug in Rule Machine 5.0

I played around with Hubitat for a few months and trying to slowly automate my home. When I tried to add actions in a simple rule using Rule Machine 5.0, I got the following error message

Unexpected Error
An unexpected error has occurred trying to load the app. Check Logs for more information.
Error: For input string: ""

Then when I tried to edit the rule again, I consistently received the same error message. I'm not sure how to avoid the error. I even tried to delete the rule and create the same rule again and got the same error at the same place. The error log is

"java.lang.NumberFormatException: For input string: "" on line 4150 (method selectActions)"

My rule is as simple as a sequence of actions like the following:

push('MOD-OnOff') on Lr-BL remoter
Delay 0:00:01
push('other cmd 2') on Lr-BL remoter
Delay 0:00:01
push('other cmd 3') on Lr-BL remoter
Delay 0:00:01
push('other cmd 4') on Lr-BL remoter
Delay 0:00:01
push('other cmd 5') on Lr-BL remoter
Delay 0:00:01

The error occurred when I tried to add one more action. It'd be great to get help from the community :slight_smile: Thanks!

A related question: is there a way to just type the rule or import the rule from text file instead of using the Web UI? The UI is good but it's slower when I know how to write the rule myself.

It would help if you could post a screenshot of the rule here. Also, what is this device 'Lr-BL-remoter'? Are you using Custom Action? If so, what is the parameter type you selected? It would also help if you could post a screenshot of the Logs where the error is showing up, so I can see the entire message (no copy/paste).

I tried to post screenshots but it was not allowed, probably because this is a new account and my first post. I can't also share links yet. I uploaded the screenshots to my dropbox account with download link "t/irtGi1WaMkZaADpS".

Lr-BL-remoter is a Broadlink RM3 Pro Plus IR/RF remoter that I used some shared device codes I found online to control. Yes, I use Custom Action, and the parameter type is string, which specifies the learned IR/RF code. Thanks for the help!

I downloaded the rule in dropbox. It can be downloaded here: t/kTmEkfE2yjj4w3TG (add www dropbox com before it). I get the error message when I try to edit the action to run.

You can post screenshots here now.

1 Like

Great, thanks! The screenshots are attached. Also the downloaded rule is here: https://www.dropbox.com/t/Rm2Uvd1uFcit03W3

I also tried a bit more to change the order of actions and managed to avoid the bug. A screenshot of the working rule is also attached in case it helps.



It looks like you maybe set the parameter type for the push command to be a number, and it's choking on a string. Please open the rule, and edit the custom action for the first action, and show that screenshot.

I'm pretty sure that I use the string type. I had entered the rule twice and saw the consistent bug. Here is the screenshot of editing the custom action.

It also seems that I got strange behavior when I have > 10 lines of rules and >5 custom actions like that. I didn't record screenshots, but it's something like what I entered for the last action, say, push('Epson-On') will also be inserted in the first action, say, change push('Projector-Screen-Up') to push('Projector-Screen-Up', 'Epson-On'). And when I deleted the 'Epson-On' in the first action, the 'Epson-On' in the last action also disappeared, i.e., change from push('Epson-On') to push().

Now I avoid the issue by breaking the rules into sub-rules and use Run Actions to call the sub-rules. It's stable so far so I'm kind of fine for now, but I suppose it's nice to get the (reproducible) bug fixed :slight_smile:

Are you on the latest build? 2.2.8.153. There was a bug that was fixed recently for parameters to custom actions. Please update and see if that fixes this, especially the changing of values for a parameter.. If you are on latest, let me know that, and I will dig into this issue. When I tried something similar to what you are doing I didn't get an error, but that doesn't prove anything.

Just checked. I have 2.2.8.152 here. Let me update to 2.2.8.153 and see if I encounter similar bugs again. Thanks!

Thanks. No difference between 152 and 153 for this issue. I will look into it.

I managed to get the other reproducible bug with screenshots for reference. In the following, I tried to add custom actions with different string commands, and at some point, the added string commands appeared in the first action command. When I tried to remove the first action command, the corresponding command in the last action got deleted as well.











I realize now that the fix for this issue is in the next release.

2 Likes

Great! Thanks!

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