]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Added meetquack voice
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 27 Oct 2026 10:26:50 +0000 (11:26 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 27 Oct 2026 10:42:43 +0000 (11:42 +0100)
scripts/audio.yaml
www/audio/meetquack.mp3 [new file with mode: 0755]

index 2eb8c9347aebd80efe5f4c492a7beae33691ed32..6304196894e5ef77d81a46d358df28ff5ae19037 100644 (file)
@@ -187,3 +187,50 @@ babu_voice_2:
     - action: script.babu_voice
       data:
         type: '2'
+
+######################################################################
+# Script: Quak
+# Inputs:
+# - type:
+#         1 -> PI
+#
+# Operations:
+# - script.volume_manager
+# - media_player.play_media
+######################################################################
+
+quak_voice:
+  alias: Voce Quak
+  variables:
+    defaulMediaPlayer: 'media_player.google_home'
+    defaultVolume: 0.35
+    media_player: >-
+      {# Check Null Input #}
+      {% if media_player | length == 0 %}
+        {% set media_player = defaulMediaPlayer %}
+      {% endif %}
+      {{ media_player }}
+    volume_level: >-
+      {# Check Null Input #}
+      {% if volume_level | length == 0 %}
+        {% set volume_level = defaultVolume %}
+      {% endif %}
+      {{ volume_level }}
+
+  sequence:
+    - condition: state
+      entity_id: input_boolean.speech_notifications
+      state: 'on'
+
+    - wait_template: "{{ not is_state(media_player, 'playing') }}"
+
+    - action: script.volume_manager
+      data_template:
+        media_player: "{{media_player}}"
+        volume_level: "{{ volume_level }}"
+
+    - action: media_player.play_media
+      data_template:
+        entity_id: "{{ media_player }}"
+        media_content_type: 'audio/mp4'
+        media_content_id: 'https://home.giorgioravera.it/local/audio/meetquack.mp3'
diff --git a/www/audio/meetquack.mp3 b/www/audio/meetquack.mp3
new file mode 100755 (executable)
index 0000000..733e157
Binary files /dev/null and b/www/audio/meetquack.mp3 differ