浏览代码

add radio support to yaml

Karl Hudgell 6 月之前
父节点
当前提交
78f46cfce1
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      home_assistant_automation.yaml

+ 19 - 0
home_assistant_automation.yaml

@@ -28,6 +28,12 @@ trigger:
     id: SKIP
     to: SKIP
     enabled: true
+  - platform: state
+    entity_id:
+      - sensor.floppy_player_device_status
+    id: RADIO
+    to: RADIO
+    enabled: true
 condition: []
 action:
   - if:
@@ -71,4 +77,17 @@ action:
           entity_id:
             - media_player.ytube_music_player
         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