Changing modes back

I have modes setup on my HA. Morning, Day, Night, Bed Time and Away.

I have an automation setup that if zone.home is below 1 then change mode to away. Now what I’m trying to figure out is how to get the mode back to where it should be once someone arrives back at home and the zone.home is above 0. Any help on this would be great. Thanks

^ Just like that.
Numeric trigger zone.home above 0

Right got that part but how will the system know which mode to put HA in when someone is home

Day, Night, Morning, bedtime?
Example. When I left home, HA is in Morning mode and it should stay there as long as my wife is home. Once she leaves, the zone.home will be below 1 so it triggers to set HA to Away Mode. Now I come home and zone.home is 1, and it’s 2pm. Ha should be in day mode but if I come home at 8pm it should be in Night mode.

So use the choose and use a time condition on each

my current mode automations are

At 11:30pm switch to Bed Time Mode
At 30 min after Sunrise, switch to Day Mode
At 5:30am, switch to Morning Mode
At 45 mins before sunset, switch to Night Mode

So how can I get HA to be n the correct mode once someone returns home

Not sure what you mean by use the Choose?

Are you referring to this? Will this just choose 1 and skip the others if they don’t work?

alias: Now Home Set to correct Mode
description: Now home switched to correct Mode
triggers:

  • entity_id:
    • zone.home
      trigger: numeric_state
      above: 0
      conditions:
      actions:
  • choose:
    • conditions:
      • condition: time
        after: “09:00:00”
        before: “18:00:00”
        sequence:
      • action: input_select.select_option
        metadata: {}
        data:
        option: Day
        target:
        entity_id: input_select.mode
    • conditions:
      • condition: time
        after: “18:00:00”
        before: “23:30:00”
        sequence:
      • action: input_select.select_option
        metadata: {}
        data:
        option: Night
        target:
        entity_id: input_select.mode

Yes that’s correct.
Please post the code in a code block next time.