mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
notifications
This commit is contained in:
@@ -13,6 +13,7 @@ condition:
|
||||
- "{{ 'driveway' in trigger.payload_json['after']['entered_zones'] }}"
|
||||
- "{{ 'from_street' in trigger.payload_json['after']['entered_zones'] }}"
|
||||
- "{{ trigger.payload_json['after']['label'] == 'person' }}"
|
||||
- "{{ is_state('input_boolean.outdoor_snapshots','on') }}"
|
||||
|
||||
action:
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ condition:
|
||||
- '{{ is_state("binary_sensor.outer_garage_door","off") }}'
|
||||
- '{{ is_state("binary_sensor.front_door_contact","off") }}'
|
||||
- '{{ is_state("binary_sensor.patio_door_contact","off") }}'
|
||||
- "{{ is_state('input_boolean.outdoor_snapshots','on') }}"
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
|
||||
@@ -41,6 +41,7 @@ condition:
|
||||
- "{{ not stationary }}"
|
||||
- "{{ not zones|length or zones|select('in', entered_zones)|list|length > 0 }}"
|
||||
- "{{ not labels|length or object in labels }}"
|
||||
- "{{ is_state('input_boolean.outdoor_snapshots','on') }}"
|
||||
#- "{{ not presence_entity or not is_state(presence_entity, 'home') }}"
|
||||
#- "{{ not garage_door or not is_state(garage_door, 'on') }}"
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ condition:
|
||||
- '{{ is_state("binary_sensor.patio_door_contact","off") }}'
|
||||
- '{{ is_state("binary_sensor.front_porch_motion","off") }}'
|
||||
- '{{ is_state("binary_sensor.garage_motion_switch_home_security_motion_detection","off") }}'
|
||||
- "{{ is_state('input_boolean.outdoor_snapshots','on') }}"
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
|
||||
@@ -45,6 +45,7 @@ condition:
|
||||
- "{{ not stationary }}"
|
||||
- "{{ not zones|length or zones|select('in', entered_zones)|list|length > 0 }}"
|
||||
- "{{ not labels|length or object in labels }}"
|
||||
- "{{ is_state('input_boolean.outdoor_snapshots','on') }}"
|
||||
#- "{{ not presence_entity or not is_state(presence_entity, 'home') }}"
|
||||
#- "{{ not garage_door or not is_state(garage_door, 'on') }}"
|
||||
|
||||
|
||||
@@ -26,7 +26,14 @@ condition:
|
||||
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_household', 'entity_id'))|list)|groupby('state'))['on']|count }}"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.home_occupied
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id:
|
||||
- input_boolean.indoor_snapshots
|
||||
- input_boolean.outdoor_snapshots
|
||||
- service: automation.turn_on
|
||||
data:
|
||||
entity_id: automation.garage_open_nobody_home
|
||||
|
||||
@@ -30,7 +30,13 @@ condition:
|
||||
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_household', 'entity_id'))|list)|groupby('state'))['on']|count }}"
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.home_occupied
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.indoor_snapshots
|
||||
|
||||
- service: automation.turn_off
|
||||
data:
|
||||
entity_id: automation.garage_open_nobody_home
|
||||
|
||||
@@ -45,7 +45,7 @@ script:
|
||||
content_id: '{{ iif(media_content_id is defined,media_content_id,"media-source://media_source/local/Sounds/tts/welcome_to_daddys_house.mp3") }}'
|
||||
content_type: '{{ iif(media_content_type is defined,media_content_type,"audio/mpeg") }}'
|
||||
volume: "{{ iif(volume is defined,volume,0.6) }}"
|
||||
original_volume: '{{ iif(state_attr(state_attr("media_player.ytube_music_player","remote_player_id"), "volume_level") is not none,state_attr(state_attr("media_player.ytube_music_player","remote_player_id"), "volume_level"),0.0) }}'
|
||||
original_volume: '{{ iif(is_state("media_player.ytube_music_player","off"),0.0,state_attr(state_attr("media_player.ytube_music_player","remote_player_id"), "volume_level")) }}'
|
||||
ytube_in_use: '{{ is_state("media_player.ytube_music_player","playing") or is_state("media_player.ytube_music_player","idle") or is_state("media_player.ytube_music_player","paused") }}'
|
||||
|
||||
sequence:
|
||||
@@ -63,8 +63,7 @@ script:
|
||||
delay:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 0
|
||||
milliseconds: 250
|
||||
seconds: 2
|
||||
|
||||
# This looks to cause the first part of the message to be missed.
|
||||
# Instead of initally muting the speakers, I'll just set them to the appropriate volume off the bat
|
||||
@@ -86,8 +85,7 @@ script:
|
||||
delay:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 0
|
||||
milliseconds: 250
|
||||
seconds: 2
|
||||
|
||||
- alias: "Play the announcement"
|
||||
service: media_player.play_media
|
||||
@@ -113,14 +111,13 @@ script:
|
||||
- alias: Wait for the specified media_player(s) to become idle
|
||||
wait_for_trigger:
|
||||
- platform: template
|
||||
value_template: "{{ is_state(media_player, 'idle') }}"
|
||||
value_template: "{{ is_state(media_player, 'idle') or is_state(media_player, 'off')}}"
|
||||
|
||||
- alias: "Give a second of dead air after the announcement"
|
||||
delay:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 0
|
||||
milliseconds: 250
|
||||
seconds: 2
|
||||
|
||||
- choose:
|
||||
- alias: "Ytube music player was playing something earlier"
|
||||
|
||||
Reference in New Issue
Block a user