Ok here is what I am trying to do: I have a global variable called gEmergency on the trigger event for key fob button 1 pressed being set to NOW.

On the release button event I have a local variable called lNow being set to now.
Next I want to subtract gEmergency from lNow to get the number of milliseconds that has passed from the time the button was pressed till it was released and assign it back to gEmergency.
Now if I was writing this as code I would probably write something like:
This would give me a new number giving the number of seconds between the press time and release time to use elsewhere in my conditional actions.

Now I am really new to Rule Machine and can’t figure out how to get the calculation “gEmergency=(lNow-gEmergency)/1000” into an action… is there a place where I can just enter this code or do I have to build it someway?

Help!!! Please don’t use screen shots I can’t see them.


You can use variable math. It's an option in RM when you set a variable.

1 Like

Thanks i found it. I was using the variable type of Time and not number.