Turning on a light switch at 5:00 AM Mon-Fri if someone is home

Hi - I’m trying to figure out the correct automation code to:

1.) turn on an Insteon switch
2.) at 5:00 AM
3.) only Monday thru Friday
4.) If someone is at home
5.) Otherwise leave the switch to off

I have an Entity created already called “somebody is home” with the desired people configured correctly. Using HA’s built in proxmity integration for presence detection.

Here is how I currently have my automation setup:

alias: Turn on hot water weekdays at 5:00 AM if somebody home
description: ""
trigger:
  - platform: time
    at: "05:00:00"
condition:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
    after: "00:00:00"
  - condition: state
    entity_id: group.somebody_home
    state: home
action:
  - type: turn_on
    device_id: 12bcf556f376cc281824e0adffcaa8b7
    entity_id: switch.on_off_module_36_46_84
    domain: switch
mode: single

The automation you posted appears to be designed to do what you want.

  1. Trigger at 05:00
  2. Condition is only if today is Monday to Friday after 00:00:00 and the state of group.somebody_home is home
  3. Action is turn on a switch

Does it work as you expected or not?