mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-10 02:50:12 -04:00
39 lines
976 B
YAML
39 lines
976 B
YAML
alias: "Kristy Home"
|
|
id: automation_kristy_home
|
|
mode: restart
|
|
|
|
trigger:
|
|
- platform: homeassistant
|
|
event: start
|
|
|
|
- platform: state
|
|
entity_id:
|
|
- group.person_kristy
|
|
- device_tracker.nmap_tracker_d6_28_7a_58_b8_da
|
|
to: "home"
|
|
|
|
- platform: event
|
|
event_type: automation_reloaded
|
|
|
|
condition:
|
|
- alias: "They were previously considered away"
|
|
condition: state
|
|
entity_id: input_boolean.kristy_home
|
|
state: "off"
|
|
|
|
- alias: "At least one tracker is home"
|
|
condition: numeric_state
|
|
entity_id: group.person_kristy
|
|
above: 0
|
|
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_kristy', 'entity_id'))|list)|groupby('state'))['home']|count }}"
|
|
|
|
action:
|
|
- action: input_boolean.turn_on
|
|
entity_id: input_boolean.kristy_home
|
|
|
|
- action: input_boolean.turn_off
|
|
entity_id: input_boolean.allow_announcements
|
|
|
|
- action: input_boolean.turn_off
|
|
entity_id: input_boolean.out_of_bed_alert
|