Skip to content

Commit

Permalink
Created a new hybrid group for tracking location.
Browse files Browse the repository at this point in the history
Allows people to be added and removed rather than the traditional hierarchy.
  • Loading branch information
dannytsang committed Jan 20, 2025
1 parent 4f084a1 commit 2c59cc6
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 17 deletions.
4 changes: 2 additions & 2 deletions automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
entity_id: alarm_control_panel.house_alarm
state: armed_away
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: not_home
- condition: sun
after: sunset
Expand Down Expand Up @@ -448,7 +448,7 @@
entity_id: alarm_control_panel.house_alarm
state: armed_away
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: not_home
- condition: sun
after: sunset
Expand Down
2 changes: 1 addition & 1 deletion packages/home_assistant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ automation:
entity_id: input_select.home_mode
state: "guest"
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "home"
- not:
- condition: state
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/alarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ script:
- alias: Everyone home
conditions:
- condition: state
entity_id: group.all_adult_people
entity_id: group.all_tracked_people
state: "home"
for:
minutes: "5"
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/chromecast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ automation:
entity_id: input_select.home_mode
state: "guest"
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "home"
- not:
- condition: state
Expand Down
2 changes: 1 addition & 1 deletion packages/rooms/front_garden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ automation:
response_variable: todo_list
- if:
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "not_home"
- alias: Does not already exist
condition: template
Expand Down
8 changes: 4 additions & 4 deletions packages/rooms/kitchen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ automation:
entity_id: input_select.home_mode
state: "Guest"
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "home"
actions:
- parallel:
Expand Down Expand Up @@ -1405,7 +1405,7 @@ script:
multiline: true
variables:
people_home: "{% set people = namespace(home=[]) %}
{% for p in state_attr('group.adult_people', 'entity_id')|default([]) %}
{% for p in state_attr('group.tracked_people', 'entity_id')|default([]) %}
{% if states(p) == 'home' %}
{% set people.home = people.home + [p] %}
{% endif %}
Expand Down Expand Up @@ -1454,7 +1454,7 @@ script:
text:
variables:
people_home: "{% set people = namespace(home=[]) %}
{% for p in state_attr('group.adult_people', 'entity_id')|default([]) %}
{% for p in state_attr('group.tracked_people', 'entity_id')|default([]) %}
{% if states(p) == 'home' %}
{% set people.home = people.home + [p] %}
{% endif %}
Expand All @@ -1464,7 +1464,7 @@ script:
- choose:
- conditions:
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "home"
- condition: time
before: "22:00:00"
Expand Down
2 changes: 1 addition & 1 deletion packages/rooms/living_room.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ automation:
entity_id: input_boolean.enable_morning_routine
state: "on"
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "home"
- condition: state
entity_id: alarm_control_panel.house_alarm
Expand Down
2 changes: 1 addition & 1 deletion packages/rooms/office.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ automation:
- choose:
- conditions:
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "home"
- condition: time
before: "22:00:00"
Expand Down
2 changes: 1 addition & 1 deletion packages/rooms/porch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ automation:
to: "on"
conditions:
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "home"
actions:
- parallel:
Expand Down
4 changes: 2 additions & 2 deletions packages/rooms/utility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ script:
text:
variables:
people_home: "{% set people = namespace(home=[]) %}
{% for p in state_attr('group.adult_people', 'entity_id')|default([]) %}
{% for p in state_attr('group.tracked_people', 'entity_id')|default([]) %}
{% if states(p) == 'home' %}
{% set people.home = people.home + [p] %}
{% endif %}
Expand All @@ -159,7 +159,7 @@ script:
- choose:
- conditions:
- condition: state
entity_id: group.adult_people
entity_id: group.tracked_people
state: "home"
- condition: time
before: "22:00:00"
Expand Down
19 changes: 17 additions & 2 deletions packages/tracker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ automation:
description: "Someone is home."
triggers:
- trigger: state
entity_id: group.adult_people
entity_id: group.tracked_people
from: "not_home"
to: "home"
conditions:
Expand Down Expand Up @@ -241,7 +241,7 @@ automation:
description: ""
triggers:
- trigger: state
entity_id: group.adult_people
entity_id: group.tracked_people
for: 00:01:00
to: "not_home"
conditions:
Expand Down Expand Up @@ -622,6 +622,14 @@ group:
entities:
- person.danny
- person.terina
all_tracked_people:
name: All Tracked People
icon: mdi:account-multiple
all: true
entities:
- person.danny
- person.leo
- person.terina
anyone:
name: Anyone Home
icon: mdi:account-group
Expand Down Expand Up @@ -663,6 +671,13 @@ group:
icon: mdi:laptop
entities:
- device_tracker.lap_ctc1404
tracked_people:
name: Tracked People
icon: mdi:account-multiple
entities:
- person.danny
- person.leo
- person.terina
turk_computer:
name: Turk Computer
icon: mdi:server
Expand Down

0 comments on commit 2c59cc6

Please sign in to comment.