Reverting back from away

I'm using an entrance table lamp switch to designate if I'm away. The switch is OFF= away, the switch is ON I'm home or not away. In the app for switch ON I must select between day, evening or night. How can I tell the hub to select the correct mode when reverting to not away.

Which app are your using? Mode Manager? Room Lighting or Rule Machine?

I'm using Basic Rule

You'll need to use Mode Manager and Rule Machine to do this plus being on the most recent platform release (2.3.8.118). Basically, if you use Mode Manager to set the time periods, Rule Machine added a new function (Mode change back to whatever mode manager would do? (Take II) - #17 by bravenel) set per Mode at times. With Rule Machine, you would create:

Trigger
Lamp turns on

Action
Set per Mode at Times

The other way to do this if you are not using Mode Manager is strictly through Rule Machine assuming Day, Evening, and Night are time periods:

Trigger
Lamp Turns On

Actions
If time between 7am and 5pm, set mode to Day
Else-If time between 5pm and 10pm, set mode to Evening
Else, set mode to Night
End-If

You could use a conditional action to determine which mode to set based on time.

Finally, if you wanted to just use Basic Rules, you'll need three rules and use restrictions on them to set the mode. It's similar to the Rule Machine example with three rules instead of one.

Here's what I do, for a similar situation, with Rule Manager (Pretty sure it will work with Basic Rules, but I never use that).

We have a guest house. When guests are present, I want several things to operate differently than when no one is staying there (thermostats, lighting, etc.). So, I just set up a VIRTUAL switch ("Guests") that I turn on when we have guests, off when they leave (switch icon on that hub's dashboard). Then, for Rules in that house, write them so that they check the status of that switch (If this, then that, otherwise (else)...).

Hubitat's Rules are powerful but perhaps the clunkiest I've ever used (Homeseer was probably the best (and easiest) I ever used, but Hubitat has been a far more reliable hub for me. Anyway, hope that helps.