- service: script.laura_voice
data:
type: '3'
+
+######################################################################
+# Script: Babu Frik
+# Inputs:
+# - type:
+# 1 -> I'm babu frik
+# 2 -> heheeee
+#
+# Operations:
+# - script.volume_manager
+# - media_player.play_media
+######################################################################
+
+babu_voice:
+ alias: Voce Babu
+ sequence:
+ - condition: state
+ entity_id: input_boolean.speech_notifications
+ state: 'on'
+
+ - service: script.volume_manager
+ data_template:
+ media_player: >-
+ {# Check Null Input #}
+ {% if media_player | length == 0 %}
+ {% set media_player = 'media_player.google_home' %}
+ {% endif %}
+ {{ media_player }}
+ volume_level: "{{ volume_level }}"
+
+ - service: media_player.play_media
+ data_template:
+ entity_id: >-
+ {# Check Null Input #}
+ {% if media_player | length == 0 %}
+ {% set media_player = 'media_player.google_home' %}
+ {% endif %}
+ {{ media_player }}
+ media_content_type: 'audio/mp4'
+ media_content_id: >-
+ {% if type is not defined %}
+ {% set type = 1 %}
+ {% endif %}
+ https://home.giorgioravera.it/local/audio/babu/{{type}}.mp3
+
+babu_voice_1:
+ alias: Voce Babu 1
+ sequence:
+ - service: script.babu_voice
+ data:
+ type: '1'
+
+babu_voice_2:
+ alias: Voce Babu 2
+ sequence:
+ - service: script.babu_voice
+ data:
+ type: '2'
service: script.turn_on
service_data:
entity_id: script.laura_voice_3
+
+ - type: horizontal-stack
+ cards:
+ - type: entity-button
+ name: I'm Babu
+ icon: mdi:numeric-1
+ entity: script.babu_voice
+ tap_action:
+ action: call-service
+ service: script.turn_on
+ service_data:
+ entity_id: script.babu_voice_1
+ - type: entity-button
+ name: Heheeeee
+ icon: mdi:numeric-2
+ entity: script.babu_voice
+ tap_action:
+ action: call-service
+ service: script.turn_on
+ service_data:
+ entity_id: script.babu_voice_2
######################################################################
# People