Skip to content

Instantly share code, notes, and snippets.

@VynDesign
Forked from cliffordwhansen/presence_non_binary.yaml
Last active April 11, 2024 01:58

Revisions

  1. VynDesign revised this gist Sep 21, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ blueprint:
    domain: automation
    input:
    person_device_tracker:
    name: Device tracker
    description: This is the device tracker for the person
    name: Person
    description: This is the person entity to read the basic home/away presence
    selector:
    entity:
    domain: person
  2. VynDesign revised this gist Sep 21, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    blueprint:
    name: "Person: Status Update"
    name: "Presence Status Update"
    description: Making Home Assistant’s Presence Detection not so Binary
    domain: automation
    input:
  3. VynDesign revised this gist Sep 21, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ blueprint:
    description: This is the device tracker for the person
    selector:
    entity:
    domain: device_tracker
    domain: person
    person_input_select:
    name: Input select
    description: This is the input select that tracks the person's status
  4. @cliffordwhansen cliffordwhansen revised this gist Aug 23, 2021. 1 changed file with 42 additions and 15 deletions.
    57 changes: 42 additions & 15 deletions presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -3,18 +3,45 @@ blueprint:
    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
    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
    time_till_marked_away:
    name: Time till marked away
    description: How long to wait in just left before getting set as away
    default: 10
    selector:
    number:
    min: 0
    max: 60
    unit_of_measurement: minutes
    time_till_marked_home:
    name: Time till marked home
    description: How long to wait in just arrived before getting set as home
    default: 10
    selector:
    number:
    min: 0
    max: 60
    unit_of_measurement: minutes
    time_till_marked_extended_away:
    name: Time till marked extended away
    description: How long to wait in away before being set to extended away
    default: 24
    selector:
    number:
    min: 0
    max: 168
    unit_of_measurement: hours

    alias: 'Person: Status update'
    description: ''
    @@ -26,7 +53,7 @@ trigger:
    - platform: state
    entity_id: !input person_input_select
    for:
    minutes: 10
    minutes: !input time_till_marked_home
    id: input_select_wait_arrived
    to: Just Arrived
    - platform: state
    @@ -42,13 +69,13 @@ trigger:
    entity_id: !input person_input_select
    to: Just Left
    for:
    minutes: 10
    minutes: !input time_till_marked_away
    id: input_select_wait_left
    - platform: state
    entity_id: !input person_input_select
    to: Away
    for:
    hours: 24
    hours: !input time_till_marked_extended_away
    id: input_select_wait_away
    condition:
    - condition: template
  5. @cliffordwhansen cliffordwhansen revised this gist Aug 19, 2021. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,6 @@ description: ''
    trigger:
    - platform: state
    entity_id: !input person_device_tracker
    from: not_home
    to: home
    id: device_tracker_home
    - platform: state
    @@ -38,7 +37,6 @@ trigger:
    - platform: state
    entity_id: !input person_device_tracker
    from: home
    to: not_home
    id: device_tracker_not_home
    - platform: state
    entity_id: !input person_input_select
  6. @cliffordwhansen cliffordwhansen revised this gist Aug 19, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -52,7 +52,9 @@ trigger:
    for:
    hours: 24
    id: input_select_wait_away
    condition: []
    condition:
    - condition: template
    value_template: '{{ trigger.to_state.state != trigger.from_state.state }}'
    action:
    - choose:
    - conditions:
  7. @cliffordwhansen cliffordwhansen revised this gist Aug 18, 2021. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,8 @@ trigger:
    id: device_tracker_home
    - platform: state
    entity_id: !input person_input_select
    for: 10min
    for:
    minutes: 10
    id: input_select_wait_arrived
    to: Just Arrived
    - platform: state
    @@ -42,12 +43,14 @@ trigger:
    - platform: state
    entity_id: !input person_input_select
    to: Just Left
    for: 10min
    for:
    minutes: 10
    id: input_select_wait_left
    - platform: state
    entity_id: !input person_input_select
    to: Away
    for: 24hours
    for:
    hours: 24
    id: input_select_wait_away
    condition: []
    action:
  8. @cliffordwhansen cliffordwhansen revised this gist Aug 13, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,7 @@ description: ''
    trigger:
    - platform: state
    entity_id: !input person_device_tracker
    from: not_home
    to: home
    id: device_tracker_home
    - platform: state
    @@ -36,6 +37,7 @@ trigger:
    - platform: state
    entity_id: !input person_device_tracker
    from: home
    to: not_home
    id: device_tracker_not_home
    - platform: state
    entity_id: !input person_input_select
    @@ -110,4 +112,4 @@ action:
    entity_id: !input person_input_select
    data:
    option: Extended Away
    mode: single
    mode: queued
  9. @cliffordwhansen cliffordwhansen created this gist Aug 12, 2021.
    113 changes: 113 additions & 0 deletions presence_non_binary.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,113 @@
    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