Skip to content

Commit c1efed2

Browse files
committed
automations
- Remove old arriving home notification - Customize automatic-gate/itinerary blueprints - Fix action titles for quickbars notifications - Fix icon for object notifications Signed-off-by: Joshua Clark <zanix@users.noreply.github.com>
1 parent fb3dc5b commit c1efed2

4 files changed

Lines changed: 35 additions & 154 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ Material Design 3 Theme for Home Assistant
732732
> [!NOTE]
733733
> For more details, see the [automations.xml][automations] file and `automation:` blocks in [integrations].
734734
735-
<details><summary>151 Automations</summary>
735+
<details><summary>150 Automations</summary>
736736

737737
- ⏯ Ensure Android TV Apps are Running 🚫
738738
- ⏯ Family Room Media Off
@@ -873,7 +873,6 @@ Material Design 3 Theme for Home Assistant
873873
- 🖥️ [Work Josh] Microphone/Camera Active
874874
- 🖨️ Low Toner
875875
- 🖨️ Out of Paper
876-
- 🗺️ Arriving Home 🚫
877876
- 🗺️ Leaving Zone
878877
- 🚦 Amy Office Light Switch Status 🚫
879878
- 🚦 Emma Light Switch Status

automations.yaml

Lines changed: 11 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -3044,7 +3044,7 @@
30443044
icon: '{{ icon_mdi }}'
30453045
background_color: '{{ color }}'
30463046
action_1_id: '{{ notification_actions[0].action }}'
3047-
action_1_title: '{{ notification_actions[0].title }}'
3047+
action_1_label: '{{ notification_actions[0].title }}'
30483048
action: script.notify_quickbars
30493049
- delay:
30503050
minutes: 5
@@ -3107,7 +3107,7 @@
31073107
icon: '{{ icon_mdi }}'
31083108
background_color: '{{ color }}'
31093109
action_1_id: '{{ notification_actions[0].action }}'
3110-
action_1_title: '{{ notification_actions[0].title }}'
3110+
action_1_label: '{{ notification_actions[0].title }}'
31113111
action: script.notify_quickbars
31123112
- data:
31133113
media_player:
@@ -3232,7 +3232,7 @@
32323232
icon: '{{ icon_mdi }}'
32333233
background_color: '{{ color }}'
32343234
action_1_id: '{{ notification_actions[0].action }}'
3235-
action_1_title: '{{ notification_actions[0].title }}'
3235+
action_1_label: '{{ notification_actions[0].title }}'
32363236
action: script.notify_quickbars
32373237
- data:
32383238
media_player:
@@ -3636,7 +3636,7 @@
36363636
icon: '{{ icon_mdi }}'
36373637
background_color: '{{ color }}'
36383638
action_1_id: '{{ notification_actions[0].action }}'
3639-
action_1_title: '{{ notification_actions[0].title }}'
3639+
action_1_label: '{{ notification_actions[0].title }}'
36403640
action: script.notify_quickbars
36413641
- data:
36423642
media_player:
@@ -3852,9 +3852,9 @@
38523852
icon: '{{ icon_mdi }}'
38533853
background_color: '{{ color }}'
38543854
action_1_id: '{{ notification_actions[0].action }}'
3855-
action_1_title: '{{ notification_actions[0].title }}'
3855+
action_1_label: '{{ notification_actions[0].title }}'
38563856
action_2_id: '{{ notification_actions[1].action }}'
3857-
action_2_title: '{{ notification_actions[1].title }}'
3857+
action_2_label: '{{ notification_actions[1].title }}'
38583858
action: script.notify_quickbars
38593859
- data:
38603860
media_player:
@@ -4227,7 +4227,7 @@
42274227
icon: '{{ icon_mdi }}'
42284228
background_color: '{{ color }}'
42294229
action_1_id: '{{ notification_actions[0].action }}'
4230-
action_1_title: '{{ notification_actions[0].title }}'
4230+
action_1_label: '{{ notification_actions[0].title }}'
42314231
action: script.notify_quickbars
42324232
- data:
42334233
media_player:
@@ -4345,7 +4345,7 @@
43454345
icon: '{{ icon_mdi }}'
43464346
background_color: '{{ color }}'
43474347
action_1_id: '{{ notification_actions[0].action }}'
4348-
action_1_title: '{{ notification_actions[0].title }}'
4348+
action_1_label: '{{ notification_actions[0].title }}'
43494349
action: script.notify_quickbars
43504350
- data:
43514351
media_player:
@@ -4506,7 +4506,7 @@
45064506
icon: '{{ icon_mdi }}'
45074507
background_color: '{{ color }}'
45084508
action_1_id: '{{ notification_actions[0].action }}'
4509-
action_1_title: '{{ notification_actions[0].title }}'
4509+
action_1_label: '{{ notification_actions[0].title }}'
45104510
action: script.notify_quickbars
45114511
- data:
45124512
media_player:
@@ -5902,12 +5902,12 @@
59025902
- data:
59035903
title: '{{ title }}'
59045904
message: '{{ message }}'
5905-
icon: '{{ icon_mdi }}'
5905+
icon: '{{ icon }}'
59065906
image: '{{ image }}?format=android'
59075907
background_color: '{{ color }}'
59085908
duration: 15
59095909
action_1_id: silence_doorbell
5910-
action_1_title: Silence Doorbell
5910+
action_1_label: Silence Doorbell
59115911
action: script.notify_quickbars
59125912
- if:
59135913
- condition: trigger
@@ -6725,66 +6725,6 @@
67256725
icon: '{{ icon }}'
67266726
action: script.notify_lnxlink
67276727
mode: single
6728-
- id: '1679340622496'
6729-
alias: "\U0001F5FA️ Arriving Home"
6730-
description: Sends a notification when someone is arriving home.
6731-
trigger:
6732-
- platform: state
6733-
entity_id:
6734-
- person.joshua
6735-
- person.amy
6736-
to: home
6737-
for:
6738-
hours: 0
6739-
minutes: 1
6740-
seconds: 0
6741-
condition:
6742-
- condition: template
6743-
value_template: '{{ trigger.from_state.state == "not_home" }}'
6744-
- condition: template
6745-
value_template: '{{ trigger.to_state.attributes.gps_accuracy | int < 30 }}'
6746-
- condition: time
6747-
after: 08:00:00
6748-
before: '22:00:00'
6749-
action:
6750-
- variables:
6751-
name: '{{ trigger.to_state.attributes.friendly_name }}'
6752-
message: '{%- from "message.jinja" import welcome_home -%} {%- set person =
6753-
{"Amy": "Mom", "Joshua": "Dad"}[name] -%} {{ welcome_home(person) }}'
6754-
- parallel:
6755-
- data:
6756-
send_to: parents
6757-
title: '{{ name }} is Home'
6758-
message: '{{ message }}'
6759-
notification_icon: mdi:map-marker-account
6760-
color: '#ff5722'
6761-
icon: local/icons/map-marker-account.png
6762-
group: Presence
6763-
action: script.notify_mobile
6764-
- data:
6765-
entity:
6766-
- media_player.nasya
6767-
title: '{{ name }} is Home'
6768-
message: '{{ message }}'
6769-
action: script.notify_hass_agent
6770-
- data:
6771-
computer:
6772-
- erebus
6773-
title: '{{ name }} is Home'
6774-
message: '{{ message }}'
6775-
icon: local/icons/map-marker-account.png
6776-
action: script.notify_lnxlink
6777-
- data:
6778-
media_player:
6779-
- media_player.living_room_speaker
6780-
- media_player.family_room_speaker
6781-
- media_player.office_speaker
6782-
message: '{{ message }}'
6783-
action: script.notify_speech
6784-
- delay:
6785-
minutes: 5
6786-
mode: single
6787-
max_exceeded: silent
67886728
- id: '1677559331389'
67896729
alias: "\U0001F5FA️ Leaving Zone"
67906730
description: Sends a notification when someone is leaving a zone.

blueprints/automation/etiennec78/automatic-gate.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,7 @@ actions:
13591359
car_ui: true
13601360
notification_icon: mdi:hammer-wrench
13611361
channel: Automatic Gate
1362+
group: Automatic Gate
13621363
importance: high
13631364
priority: high
13641365
ttl: 0
@@ -1507,7 +1508,9 @@ actions:
15071508
data: &notification_data
15081509
car_ui: true
15091510
notification_icon: mdi:alert-circle
1510-
channel: Itinerary status
1511+
color: "#00bcd4"
1512+
channel: Itinerary Status
1513+
group: Itinerary Status
15111514
importance: high
15121515
priority: high
15131516
ttl: 0

blueprints/automation/etiennec78/itinerary-tracker-notification.yaml

Lines changed: 19 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -711,11 +711,15 @@ actions:
711711
sequence:
712712
- action: "{{ repeat.item }}"
713713
data:
714+
title: Itinerary Status
714715
message: "{{ message }}"
715716
data:
717+
car_ui: true
716718
notification_icon: mdi:car
719+
color: "#00bcd4"
717720
tag: "{{ notification_tag }}"
718-
channel: Itinerary status
721+
channel: Itinerary Status
722+
group: Itinerary Status
719723
sticky: true
720724
# Hack to retrieve notification service when dismissed
721725
confirmation: "{{ repeat.item }}"
@@ -741,82 +745,10 @@ actions:
741745
and persons | select('is_state', 'home') | list != []
742746
}}
743747
- alias: Play TTS on each speaker
744-
repeat:
745-
for_each: "{{ speaker_tts_devices }}"
746-
sequence:
747-
- alias: Initialize a variable to store the speaker volume later
748-
variables:
749-
old_volume: "{{ none }}"
750-
- alias: If the tts night mode is currently active
751-
if:
752-
- condition: template
753-
value_template: |-
754-
{% set start = today_at(tts_volume_night_time_start) %}
755-
{% set end = today_at(tts_volume_night_time_end) %}
756-
{% set time = now() %}
757-
{{
758-
tts_volume_night_time_start != ''
759-
and tts_volume_night_time_end != ''
760-
and (
761-
start <= end and start <= time <= end
762-
or start > end and (time >= start or time <= end)
763-
)
764-
}}
765-
then:
766-
- alias: If the speaker is not exposing its volume because it is turned off
767-
if:
768-
- condition: template
769-
value_template: |-
770-
{{
771-
is_state(repeat.item, 'off')
772-
and state_attr(repeat.item, 'volume_level') is none
773-
}}
774-
then:
775-
- alias: Turn on the speaker
776-
action: media_player.turn_on
777-
target:
778-
entity_id: "{{ repeat.item }}"
779-
- alias: Wait for the speaker to turn on
780-
wait_template: "{{ not is_state(repeat.item, 'off') }}"
781-
continue_on_timeout: true
782-
timeout: 3
783-
- alias: Only continue if the speaker has a higher volume than night mode
784-
condition: template
785-
value_template: |-
786-
{{
787-
state_attr(repeat.item, 'volume_level') is none
788-
or (
789-
state_attr(repeat.item, 'volume_level') * 100
790-
) | int > tts_volume_at_night
791-
}}
792-
- alias: Save the current volume
793-
variables:
794-
old_volume: "{{ state_attr(repeat.item, 'volume_level') }}"
795-
- alias: Lower the volume
796-
action: media_player.volume_set
797-
target:
798-
entity_id: "{{ repeat.item }}"
799-
data:
800-
volume_level: "{{ tts_volume_at_night / 100 }}"
801-
- alias: Play the TTS
802-
action: tts.speak
803-
data:
804-
cache: true
805-
media_player_entity_id: "{{ repeat.item }}"
806-
message: "{{ message }}"
807-
target:
808-
entity_id: "{{ speaker_tts_service }}"
809-
- alias: If the old volume could be saved
810-
if:
811-
- condition: template
812-
value_template: "{{ old_volume is not none }}"
813-
then:
814-
- alias: Restore the old volume
815-
action: media_player.volume_set
816-
target:
817-
entity_id: "{{ repeat.item }}"
818-
data:
819-
volume_level: "{{ old_volume }}"
748+
action: script.notify_speech
749+
data:
750+
media_player: "{{ speaker_tts_devices }}"
751+
message: '{{ message }}'
820752
- alias: If travel time sensors set
821753
if:
822754
condition: template
@@ -1016,7 +948,7 @@ actions:
1016948
- alias: Convert ETA to needed types
1017949
variables:
1018950
arrival_timestamp: "{{ as_timestamp(now()) + remaining }}"
1019-
arrival: "{{ arrival_timestamp | timestamp_custom('%H:%M') }}"
951+
arrival: "{{ arrival_timestamp | timestamp_custom('%-I:%M %p') }}"
1020952
- alias: If the nearly arrived tts has not been triggered yet
1021953
if:
1022954
- condition: template
@@ -1070,11 +1002,15 @@ actions:
10701002
sequence:
10711003
- action: "{{ repeat.item }}"
10721004
data:
1005+
title: Itinerary Status
10731006
message: "{{ message }}"
10741007
data:
1008+
car_ui: true
10751009
notification_icon: mdi:map-marker-account
1010+
color: "#00bcd4"
10761011
tag: "{{ notification_tag }}"
1077-
channel: Itinerary status
1012+
channel: Itinerary Status
1013+
group: Itinerary Status
10781014
sticky: true
10791015
# Hack to retrieve notification service when dismissed
10801016
confirmation: "{{ repeat.item }}"
@@ -1120,9 +1056,12 @@ actions:
11201056
data:
11211057
message: "{{ message }}"
11221058
data:
1059+
car_ui: true
11231060
notification_icon: mdi:home-map-marker
1061+
color: "#00bcd4"
11241062
tag: "{{ notification_tag }}"
1125-
channel: Itinerary status
1063+
channel: Itinerary Status
1064+
group: Itinerary Status
11261065
url: !input on_tap_link
11271066
clickAction: !input on_tap_link
11281067
timeout: 300

0 commit comments

Comments
 (0)