Checking from RM if an ML rule is running

How would I be able to ascertain from rule machine whether a motion lighting rule is currently running or not? I would like to be able to determine from rule machine whether the lights that are currently on have been turned by ML and thus will be turned off by ML as well or if RM will have to turn off the lights itself because they were turned on outside of ML.
The only way I can think of right now to achieve this is to create a virtual switch that ML turns on and off at the same time as the lights and I will query the state if this switch from RM.

Does anyone know of another way to achieve this?

That is the only way that I can think of.