@buggy_droid
Thanks for the reply!
It's strange: I manually trigger (with a widget / shortcut) an event that changes the Llama variable, so the screen is definitely on at that point. I've even launched the Llama app and looked under 'Events' to see that both conditions for my event (both (1) Not in areas, and (2) Llama variable) are in green, so Llama detects both conditions correctly. The action changes the Llama variable so that it is no longer true - once the action fires, the (2) Llama variable condition should show red.
It has worked sometimes, so it is failing intermittently - and yet I have no task killers, and it is not set to hibernate with Greenify.
Fuller details: I use Llama to change my sound profile to loud when I'm not at home or at work. But sometimes, I want to manually mute my phone, so I set up a Llama shortcut / widget on the home screen to change the profile to 'silent' and 'lock profiles'. I also set up a Llama shortcut / widget on the home screen to undo the mute, which 'unlocks profile' and then switches the Llama variable 'retest' to '1' (true). This brings me to the event I mentioned, with conditions 'Not at home, not at work' and 'Llama variable retest has a value of 1', and actions 'change profile to loud' and 'set Llama variable retest to 0'.
(I have a corresponding event for 'At home, at work', and 'Llama variable retest has a value of 1', and actions 'change profile to normal' and 'set Llama variable retest to 0'.)
Any thoughts? Is there a more elegant way of achieving this? Or perhaps my Razr XT910 running 4.1.2 (stock) is one of those devices that doesn't play well with Llama...?