Add download & play youtube button

This commit is contained in:
2020-03-15 10:14:55 +02:00
parent b8f27f6854
commit 4def21ed68
2 changed files with 40 additions and 8 deletions
+18 -8
View File
@@ -18,14 +18,24 @@ cards:
- entity: input_text.youtube_download_name
type: "custom:text-input-row"
- type: entity-button
entity: script.youtube_download_selected
name: Download
icon: mdi:download
icon_height: 48px
tap_action:
action: call-service
service: script.youtube_download_selected
- type: horizontal-stack
cards:
- type: entity-button
entity: script.youtube_download_selected
name: Download
icon: mdi:download
icon_height: 48px
tap_action:
action: call-service
service: script.youtube_download_selected
- type: entity-button
entity: script.youtube_download_and_play
name: Download & Play
icon: mdi:youtube-tv
icon_height: 48px
tap_action:
action: call-service
service: script.youtube_download_and_play
- type: custom:config-template-card
entities:
+22
View File
@@ -48,6 +48,28 @@ script:
data:
value: ""
youtube_download_and_play:
alias: Youtube · Download and play selected video
sequence:
- service: shell_command.youtube_download
data_template:
url: "{{ states('input_text.youtube_download_url') }}"
name: "{{ states('input_text.youtube_download_name') }}"
- service: script.music_join_sonoses
- service: media_player.play_media
data_template:
entity_id: media_player.master_bedroom
media_content_id: "{{ states('sensor.sarah_url') }}/local/audio/youtube/{{ states('input_text.youtube_download_name') }}.mp3"
media_content_type: "music"
- service: input_text.set_value
entity_id:
- input_text.youtube_download_url
- input_text.youtube_download_name
data:
value: ""
automation:
- id: youtube_download_latest_pds
alias: Youtube · Download latest PDS