Simple rule when out of "away"?

Is there a way to use SimpleRule to setup an automation, so that:

  1. If system comes out of Away mode(into Day/Night modes etc.), AND if the system was actually in Away before this,
  2. then turn on a light

I am able to create a rule to say, if mode changes to Day, then turn on the light. But, how do I restrict it to execute that, only if previous mode was Away?

Assuming you mean Simple Automation Rules, then yes: use "Mode Transition" for the "How do you want to trigger it?" option. EDIT: Nevermind, it only allows you to select one mode. Still possible, you'd just need one such automation per mode transition...

Rule 5.0 could do this pretty easily with a predicate condition (which must be true in order for the rule to trigger), however.

If this is easier to implement using rule machine (RM), then I'll give it a try. Can you please give an example how can I setup this in RM, so that the action triggers only if previous mode was away?

Sure! Something like this should work:

Predicate condition: Mode is Away

Trigger: Mode becomes X, Y, Z (everything except "Away," or really whatever specific transitions you hope to capture)

Actions to Run:

Off: Light