RM IllegalArgumentException at line 719

app:1012020-06-20 10:44:52.868 am errorjava.lang.IllegalArgumentException: Maps with null keys can't be converted to JSON on line 719 (useVar)

App 101 on my device is Rule Machine itself:

(Yes, I'm aware that the variable is used by a oddly large number of rules, and I'll be asking for suggestions for better ways to do it when I get it working so I can be crisp in what I'm trying to achieve.)

Please post the App Status page for Rule Machine.

Is this the App Status page?

What step did you make that caused the error?

I'm not sure, sorry. The automation I'm trying to get running doesn't work, and so I've been massaging the rules that use the "kitchen automation state" global variable for some time, and I'm not sure when this error cropped up.

However, I suspect the problem is related to the "handle physical switch" rules.

image

When I hit the switch, the rule doesn't appear to fire, and the variable doesn't change.

[dev:108](http://192.168.0.108/logs/past#dev108)2020-06-20 05:03:02.673 pm [info](http://192.168.0.108/device/edit/108)Living Room Motion Sensor is inactive
[dev:10](http://192.168.0.108/logs/past#dev10)2020-06-20 05:02:45.948 pm [info](http://192.168.0.108/device/edit/10)Cooking lights is 99% [physical]
[dev:10](http://192.168.0.108/logs/past#dev10)2020-06-20 05:02:45.945 pm [info](http://192.168.0.108/device/edit/10)Cooking lights is on [physical]
[dev:206](http://192.168.0.108/logs/past#dev206)2020-06-20 05:02:39.762 pm [info](http://192.168.0.108/device/edit/206)Office Motion Sensor temperature is 72.99°F 

...but the error doesn't appear. I did trigger run the rule "action" via the "run actions" button and the rule runs and functions and sets the variable correctly, so that is probably about me still not really understanding how events work.

Given that the rules don't work anyway, my plan was to delete them and start over, so if there's something you'd like me to try to repro, happy to do anything you suggest.

Actually, thinking about it, it's might be about this rule?

image

I needed to have a delayed, cancellable "if" statement, so I created this rule to hold the action but never trigger. So I defined the trigger to be something that would never happen.

image

...and there's definitely something strange going on. Thirty minute delay lasted 2 seconds?

app:4192020-06-20 05:39:49.488 pm infoKA - lights off if running: Actions run by KA  - Kitchen Lights Motion Automation
app:1312020-06-20 05:39:49.355 pm infoDelay Over: Run Actions: KA - lights off if running  --> delayed: 0:30:00
app:1312020-06-20 05:39:47.600 pm infoAction: Run Actions: KA - lights off if running  --> delayed: 0:30:00
app:1312020-06-20 05:39:47.540 pm infoWait over: Living Room Motion Sensor motion inactive
dev:1082020-06-20 05:39:47.362 pm infoLiving Room Motion Sensor is inactive

Ok, I've figured out how to reproduce. I edited the "Kitchen Lights Motion Automation" above to add a couple "set variable" lines. After I saved it, the rule showed up in rule machine as "paused" - though I hadn't paused it, and when I went to edit the rule it did not show as paused. Without changing anything else, I hit "done" to close the rule, and the error appeared. Now every time I edit the rule, the error shows up. It does not appear to be affecting the operation of the rule, however.

app:1012020-06-21 06:16:10.370 pm errorjava.lang.IllegalArgumentException: Maps with null keys can't be converted to JSON on line 719 (useVar)

That rule is corrupted somehow, and should be removed. Recreate it from scratch.

1 Like

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