本帖最后由 dgmax 于 2020-8-21 23:11 编辑
越搞越复杂。普通一个门磁解决的非要搞那么复杂吗??
19:50-2 3:00 回家 如果关都关的情况下就小爱欢迎回家。就一个binary_sensor.5fmenci门磁解决事情。
- alias: auto_b2key1 on
initial_state: true ##在你重启HA的时候这个自动化是开启(true)还是关闭(false)
condition:
condition: and
conditions:
- condition: time
after: '19:50:00'
before: '23:00:00'
- condition: state
entity_id: light.kt_l1
state: 'off'
- condition: state
entity_id: light.kt_l2
state: 'off'
trigger:
- platform: state
entity_id: binary_sensor.5fmenci
to: 'on'
for: '00:00:02'
action:
- service: light.turn_on
entity_id: light.kt_l1
- service: hello_miai.set_vol
data:
vol: 40
- delay:
seconds: 1
- service: hello_miai.force_send
data:
message: " 欢迎回来,忙碌了一天,听听歌曲放轻松!"
miai_num: "0"
- delay:
seconds: 5
- service: hello_miai.set_vol
data:
vol: 20
- delay:
seconds: 1
- service: hello_miai.play
|