天龙功放,设置的自动化是状态从开启变成关闭,就根据光照度开窗帘或者开灯 ,但是这个功放有时候会自己启动然后关机,所以我就加了个条件,功放开启两分钟后,在关闭,才会触发,否则不触发,但是不起效,以下是我的自动化流程,请大佬帮忙看看,感谢!
alias: 观影结束自动化测试版本2
description: ""
trigger:
- platform: state
entity_id: media_player.denon_avr_x1700h
from: "on"
to: "off"
condition:
- condition: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(states.media_player.denon_avr_x1700h.last_changed)) > 120 }}
action:
- if:
- condition: template
value_template: "{{ states('sensor.f6e4c8ee6afd2abd29be3899070a6b09') | float >= 30 }}"
then:
- service: cover.open_cover
target:
device_id:
- a0d7cb951fd66c550c33d8a4a4d8cdbb
- 57a9584831e393ef43a997facfa1673a
data: {}
else:
- service: switch.turn_on
target:
entity_id:
- switch.7cc29450ee4f_channel_1
- switch.0xdc8e95fffefa959c_l2
- switch.0xf4b3b1fffe132e82_left
- switch.0xa4c13881b94b7501_right
- switch.dced836f0f62_channel_2
data: {}
- service: xiaomi_miot.intelligent_speaker
data:
execute: false
silent: false
throw: false
entity_id: media_player.xiaomi_x10a_c590_play_control
text: 主人,电影看完了,起来活动一下吧!
mode: single
|