格式规整了一下代码
alias: 网易云自动下一曲
description: ""
trigger:
- platform: time_pattern
seconds: /5
condition:
- condition: state
entity_id: media_player.yun_yin_le_dlna_player_mediacenter
state: playing
- condition: numeric_state
entity_id: media_player.yun_yin_le_dlna_player_mediacenter
attribute: media_duration
above: 0
- condition: template
value_template: " {{ (state_attr('media_player.yun_yin_le_dlna_player_mediacenter','media_duration') - state_attr('media_player.yun_yin_le_dlna_player_mediacenter','media_position')) <11 }}"
action:
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: media_player.media_next_track
target:
entity_id: media_player.yun_yin_le_dlna_player_mediacenter
data: {}
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
mode: single
|