From: Giorgio Ravera Date: Sat, 1 Feb 2020 16:21:38 +0000 (+0100) Subject: Added Babu Frik voice X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=5b65d8827df872f3c8ffabdcbfddfb2862d899e7;p=homeassistant.git Added Babu Frik voice --- diff --git a/script/audio.yaml b/script/audio.yaml index 8efbfd14..9dccc966 100644 --- a/script/audio.yaml +++ b/script/audio.yaml @@ -63,3 +63,61 @@ laura_voice_3: - 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' diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index a72aa094..d9477142 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -1114,6 +1114,27 @@ views: 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 diff --git a/www/audio/babu/1.mp3 b/www/audio/babu/1.mp3 new file mode 100644 index 00000000..38966ccb Binary files /dev/null and b/www/audio/babu/1.mp3 differ diff --git a/www/audio/babu/2.mp3 b/www/audio/babu/2.mp3 new file mode 100644 index 00000000..a763fb5a Binary files /dev/null and b/www/audio/babu/2.mp3 differ