Skip to content

Instantly share code, notes, and snippets.

@VynDesign
Forked from cliffordwhansen/presence_non_binary.yaml
Last active April 11, 2024 01:58
Show Gist options
  • Save VynDesign/d2fd76e61e23e45b27f0ea5404d29dd4 to your computer and use it in GitHub Desktop.
Save VynDesign/d2fd76e61e23e45b27f0ea5404d29dd4 to your computer and use it in GitHub Desktop.
Making Home Assistant’s Presence Detection not so Binary
blueprint:
name: "Person: Status Update"
description: Making Home Assistant’s Presence Detection not so Binary
domain: automation
input:
person_device_tracker:
name: Device tracker
description: This is the device tracker for the person
selector:
entity:
domain: device_tracker
person_input_select:
name: Input select
description: This is the input select that tracks the person's status
selector:
entity:
domain: input_select
alias: 'Person: Status update'
description: ''
trigger:
- platform: state
entity_id: !input person_device_tracker
to: home
id: device_tracker_home
- platform: state
entity_id: !input person_input_select
for: 10min
id: input_select_wait_arrived
to: Just Arrived
- platform: state
entity_id: !input person_input_select
from: Just Left
to: Just Arrived
id: input_select_debounce
- platform: state
entity_id: !input person_device_tracker
from: home
id: device_tracker_not_home
- platform: state
entity_id: !input person_input_select
to: Just Left
for: 10min
id: input_select_wait_left
- platform: state
entity_id: !input person_input_select
to: Away
for: 24hours
id: input_select_wait_away
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: device_tracker_home
- condition: state
entity_id: !input person_input_select
state: Just Left
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Home
- conditions:
- condition: trigger
id: device_tracker_home
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Just Arrived
- conditions:
- condition: or
conditions:
- condition: trigger
id: input_select_wait_arrived
- condition: trigger
id: input_select_debounce
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Home
- conditions:
- condition: trigger
id: device_tracker_not_home
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Just Left
- conditions:
- condition: trigger
id: input_select_wait_left
sequence:
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Away
default:
- condition: trigger
id: input_select_wait_away
- service: input_select.select_option
target:
entity_id: !input person_input_select
data:
option: Extended Away
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment