Skip to content

Commit

Permalink
adding sonos voice warning alert
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeraman committed Mar 3, 2024
1 parent a9a09fe commit 1db3f7f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
16 changes: 16 additions & 0 deletions automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3358,4 +3358,20 @@
message: !secret garagedooropenmsg
title: "{{ trigger.event.data.service_data.message }}"
notification_id: "garage_door_open"

- id: sonoswarningalert
alias: Sonos Warning Alert
initial_state: True
trigger:
- platform: event
event_type: call_service
event_data:
domain: notify
service: sonos_speak
action:
- service: script.turn_on
entity_id: script.sonos_warning
data:
variables:
message: 'Warning! {{ trigger.event.data.service_data.message }}. Please check.'

4 changes: 3 additions & 1 deletion configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,9 @@ notify:
- platform: group
name: ha_persistent
services: []

- platform: group
name: sonos_speak
services: []
# SONOS
sonos:
media_player:
Expand Down
16 changes: 12 additions & 4 deletions scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ sonos_afternoon_greet:
data_template:
entity_id: media_player.living
volume_level: "0.60"
- service: tts.google_say
- service: tts.speak
target:
entity_id: tts.google_en_com_au
data_template:
entity_id: media_player.living
message: >
Expand Down Expand Up @@ -90,7 +92,9 @@ sonos_morning_greet:
data_template:
entity_id: media_player.living
volume_level: "0.60"
- service: tts.google_say
- service: tts.speak
target:
entity_id: tts.google_en_com_au
data_template:
entity_id: media_player.living
message: >
Expand Down Expand Up @@ -132,7 +136,9 @@ garage_door_warning:
data_template:
entity_id: media_player.living
volume_level: "0.60"
- service: tts.google_say
- service: tts.speak
target:
entity_id: tts.google_en_com_au
data_template:
entity_id: media_player.living
message: >
Expand Down Expand Up @@ -161,7 +167,9 @@ sonos_warning:
data_template:
entity_id: media_player.living
volume_level: "0.60"
- service: tts.google_say
- service: tts.speak
target:
entity_id: tts.google_en_com_au
data_template:
entity_id: media_player.living
message: "{{ message }}"
Expand Down

0 comments on commit 1db3f7f

Please sign in to comment.