感觉跟我家里通过DC1插座的功率自动控制投影系统打开的意思一样,你看能参考不:
- alias: '关电视开投影'
trigger:
- platform: numeric_state #调用状态
entity_id: sensor.phicomm_dc2_power #当前功率
below: 35 #小于多少瓦
above: 25 #大于多少瓦
for:
seconds: 3 #保持几秒钟,相当于播放器开着,但电视关了,准备自动切换到投影
action:
- service: switch.turn_on
entity_id: switch.keting_mubu, switch.phicomm_dc2_switch1 #想执行多个开关用,号隔开-投影幕、插座开
- delay:
seconds: 3
- service: switch.turn_on
entity_id: switch.keting_touyinji #投影机开
#开电视关投影----------------------------------------------------
- alias: '开电视关投影'
trigger:
- platform: numeric_state #调用状态
entity_id: sensor.phicomm_dc2_power #当前功率
#below: 400 #小于多少瓦
above: 380 #大于多少瓦
for:
seconds: 2 #保持几秒钟,相当于电视打开,准备关闭投影
action:
- service: switch.turn_off
entity_id: switch.keting_mubu, switch.keting_touyinji #想执行多个开关用,号隔开-投影幕、插座关
- delay:
seconds: 2
- service: switch.turn_on
entity_id: switch.keting_touyinji #投影机关机要按2次
- delay:
seconds: 10
- service: switch.turn_off
entity_id: switch.phicomm_dc2_switch1 #关功放
- delay:
seconds: 3
- service: switch.turn_off
entity_id: switch.keting_touyinji #还原红外投影到关闭状态
|