From 8fb5e68e8b57dd05c636f62b2712958c1d80dbe9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Mon, 13 Apr 2020 22:13:04 -0400 Subject: [PATCH] Added new audio package to streamline config --- config/packages/audio.yaml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 config/packages/audio.yaml diff --git a/config/packages/audio.yaml b/config/packages/audio.yaml new file mode 100755 index 0000000..a494d9d --- /dev/null +++ b/config/packages/audio.yaml @@ -0,0 +1,50 @@ +############################################################################### +# @author : Jeffrey Stone +# @date : 04/11/2020 +# @package : Audio +# @description : Audio related configuration. +# +# In order to use this package you will need a couple of things. +# +# Add to your configuration.yaml: +# media_extractor: +# +# If you are running Hassio or Home Assistant as it is called now you will need a server that hosts local audio files if you want to leverage those +############################################################################### + +# automation: +# # Turn off Input Booleans when audio stops - Based on ha_speaker state. +# - id: reset_ib_when_stopped +# alias: Reset Input Booleans When Stopped +# initial_state: true +# trigger: +# - platform: state +# entity_id: media_player.ha_speaker +# to: "off" +# action: +# - service: homeassistant.turn_off +# entity_id: group.disney_audio + +script: + + youtube_audio: + sequence: + - condition: state + entity_id: input_boolean.audible_notifications + state: 'on' + - condition: state + entity_id: sensor.family_status + state: Home + - service: media_player.turn_on + entity_id: media_player.ha_speaker + - service: media_player.volume_set + data_template: + entity_id: media_player.ha_speaker + volume_level: > + {{ volume }} + - service: media_extractor.play_media + entity_id: media_player.ha_speaker + data_template: + media_content_type: video/youtube + media_content_id: > + {{ media }}