A simple rule like this should work:
(The key is that the built-in value
variable, accessible like any variable via %value%
, will be a string value set to the current mode if the trigger is a mode change. You can assign it to a "real" variable in this way, making it usable globally or however else you want.)