RM3 Rule works, but unable to convert it to RM4


I have a simple routine based on RM3 that has worked without issues. I changed my phone recently and of course, it then became necessary to update the notification section of the routine. When trying to do that I hit a 'An unexpected error has occurred trying to load the app. Check Logs for more information.
Error: Cannot invoke method tokenize() on null object.'
I assume that that is because I was trying to change a routine in RM4 that had been created in RM3.

I then decided to re-do the routine from scratch in RM4, but I can not get it to work at all. See screenshot.

I would appreciate any guidance that can be offered.
Thanks, Dave.

The RM4 rule isn't working because you don't have a trigger set. Change your trigger to be your presence sensors changed and it should fire.

1 Like

Thanks corerootedxb.

What about the Boolean expression in the Actions to Run. As far as I can make out the Trigger Events Presence options won't let me set an Event that complies with the one that I set out under Actions to Run. For that matter, the same would apply for the Time Trigger.

I am sure I am missing something here, but I'm not sure what.

Ohhhh, duh. I didn't see the OR there. Just add a Periodic Schedule trigger in addition to your presence sensors. So, you'll have "Presence Sensors changed OR Time between 22:00 and 08:00 in your Triggers section.

Keep your actions as they are and things should run properly.

I don't think he can do "time between" in a trigger. It would have to be Presence changed OR Time is 22:00 OR Time is 8:00.


Yup. You're right... I'm seriously off my game this morning. sigh

MOAR COFFEES! (Thanks @destructure00)

@Davidod Yeah, Periodic Schedule will only allow a single time. So, you'll actually have 3 OR conditions; Presence Sensors changed, Time is 22:00, and Time is 08:00.


@Davidod something like this, here are the 3 triggers that @corerootedxb is explaining

1 Like

OK Thanks folks. I'll get working on that. Much appreciated. Dave

Update: Trigger events updated. Need to wait for 'real world' events to confirm all is well.
Thanks again. I have a much better understanding now.

1 Like

Also add conditional actions ENDIF at the end of your actions


Done :+1:

Sorry to have to get back again, but I am struggling to get notifications to my phone.

With help from here I converted my RM3 routine to RM4 (see above). However I have been unable to get the notifications of the action to go to my phone. The complication to this is that at the same time as changing to RM4 I also changed my phone, and so I do not know if it's an RM4 issue or a phone issue. Up until I changed my phone I used to get a notification in the Notification Bar on my Android Phone when the security system was turned on or off.

My deductions sofar: From other routines, I can see that Life360 is linked and is showing presence for my wife and I. The Life360 app is showing the correct location for both my wife and I. RM 4 is showing a valid True or False as appropriate. I have been unable to get a test notification based on time to go to my phone. The phone is listed as a Mobile App Device in Devices.

Is there any reason why my simple routine test based on time should not do as I anticipate?
Thanks for any help received.

I would say it's a phone issue. Make sure the app on your new phone has notifications access (via settings on your device).

Both Hubitat and Life360 have notifications access.

Ok, simple test. Go to the device page for your phone (Devices -> Mi 9T Pro) and send a device notification from there. If it goes through, then perhaps there is something odd with RM, but I don't think so. The other test is to enable logging on the rule and use the Run Actions button to see what it's actually doing.

1 Like

First thing I see there is Not Present for the Device. Both my wife and I are currently showing as present in the main rule where Presence was one of the Trigger events.

I set up a test under Notifications. The Presence Sensor was myself, the notified device was my Mi 9T Pro. see the log

Previously, the switch that I want to activate on leaving was not being activated. Now that I know that the correct phone is showing up (because it tried to send a notification when I wasn't present), I want to set an Action to turn on the Security System (see earlier posts) switch and see what happens.

I'll get back later on that.

I have had some success in my little routine.

My old phone is no longer showing up as an option, and my new phone is showing up with the just the model number, not the full name that I had previously entered. You can see that in the log printout above.

So now both time and presence are working just as desired. I'm not sure what the story is on notifications. The above log shows that it it did send a notification, but that never appeared on the phone. All required permissions are there, for both Hubitat and Life360. It's possible that it might be a phone OS thing.

I have just added the Notification Action to my main routine that is now working routine, and I will await the results of that. One encouraging thing is that my new phone was the only available device to send the message to. Previously I had to select between my wife, myself, my old phone and my new phone.

Thanks to all for the help. Definitely a little older, hopefully a little wiser.