试下这个 两个自动化,辅助元素你自己赋值,赋值完直接选第一个
1111
alias: 播放判断
description: ""
trigger:
- platform: state
entity_id:
- input_select.music_playlist
condition: []
action:
- if:
- condition: state
entity_id: input_select.music_playlist
state: end
then:
- service: input_select.set_options
target:
entity_id: input_select.music_playlist
data:
options:
- null
else:
- if:
- condition: state
entity_id: input_select.music_playlist
state: "null"
then:
- service: media_player.media_stop
target:
entity_id: media_player.xiao_ai_yin_xiang_5860
data: {}
else:
- service: media_player.play_media
target:
entity_id: media_player.xiao_ai_yin_xiang_5860
data:
media_content_type: video
media_content_id: "{{ states('input_select.video_playlist') }}"
mode: single
222
alias: 下一个
description: ""
trigger:
- platform: state
entity_id:
- media_player.xiao_ai_yin_xiang_5860
from: playing
to: idle
condition: []
action:
- service: input_select.select_next
target: {}
data:
cycle: true
mode: single
|