Browse Source

add radio support to yaml

Karl Hudgell 6 months ago
parent
commit
78f46cfce1
1 changed files with 19 additions and 0 deletions
  1. 19 0
      home_assistant_automation.yaml

+ 19 - 0
home_assistant_automation.yaml

@@ -28,6 +28,12 @@ trigger:
     id: SKIP
     id: SKIP
     to: SKIP
     to: SKIP
     enabled: true
     enabled: true
+  - platform: state
+    entity_id:
+      - sensor.floppy_player_device_status
+    id: RADIO
+    to: RADIO
+    enabled: true
 condition: []
 condition: []
 action:
 action:
   - if:
   - if:
@@ -71,4 +77,17 @@ action:
           entity_id:
           entity_id:
             - media_player.ytube_music_player
             - media_player.ytube_music_player
         data: {}
         data: {}
+  - if:
+      - condition: trigger
+        id:
+          - RADIO
+    then:
+      - alias: RadioOnSong
+        sequence:
+          - service: media_player.play_media
+            data:
+              media_content_id: |
+                {{state_attr("media_player.ytube_music_player","videoId") }}
+              media_content_type: vid_channel
+            entity_id: media_player.ytube_music_player
 mode: single
 mode: single