mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
initial push
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
alias: "Adults away something open"
|
||||
id: automation_adults_away_something_open
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.adults_away
|
||||
from: "off"
|
||||
to: "on"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.something_open
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: "off"
|
||||
action:
|
||||
# Notify the last person to leave
|
||||
- service: notify.mobile_app_pixel_7
|
||||
data:
|
||||
message: >-
|
||||
{% if as_timestamp(states.input_boolean.kristy_home.last_updated) > as_timestamp(states.input_boolean.clint_home.last_updated) %}
|
||||
The following are open: {{ dict((states|selectattr('entity_id', 'in', state_attr('group.my_exterior_windows', 'entity_id') + state_attr('group.my_exterior_doors', 'entity_id'))|list)|groupby('state'))['on']|map(attribute='name')|list|join(', ') }}
|
||||
{% else %}
|
||||
The following are open: {{ dict((states|selectattr('entity_id', 'in', state_attr('group.my_exterior_windows', 'entity_id') + state_attr('group.my_exterior_doors', 'entity_id'))|list)|groupby('state'))['on']|map(attribute='name')|list|join(', ') }}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user