Home/Away switch

You can put your phones in to a group and operate an input select based whether that group is away or home. (You will need nmap tracker for this). No phones in the group present will cause the group to show as ‘away’. Any of the phones present will cause the group to show as ‘home’

From my automations, here are the two that set the input select named ‘house_occupancy’ to ‘vacant’ or ‘occupied’. There are some built in delays to make sure iPhones just haven’t dropped off the network :wink:

Other automations that actually control things (e.g. turn off lights or turn down heat) are all triggered by changes in the status of the input select named ‘house_occupancy’.

- alias: Presence - no one home
  trigger:
    platform: state
    entity_id: group.phones_presence
    from: 'home'
    to: 'not_home'
    for:
      minutes: 15
  action: 
    service: input_select.select_option
    data:
      entity_id: input_select.house_occupancy
      option: 'vacant'
      
- alias: Presence - someone home
  trigger:
    platform: state
    entity_id: group.phones_presence
    from: 'not_home'
    to: 'home'
    for:
      minutes: 5
  action: 
    service: input_select.select_option
    data:
      entity_id: input_select.house_occupancy
      option: 'occupied'
2 Likes