自己的家庭影院打开脚本,可以参考一下.然后在写一个关闭的,做成input_boolean即可
#家厅影院开
open_movie:
sequence:
#1开幕布
- service: cover.close_cover
entity_id: cover.mubu
#2开盒子
- service: switch.turn_on
entity_id: switch.egbox_sw
#3开投影
- service: switch.turn_on
entity_id: switch.touying_all
#4开功放
- service: media_player.turn_on
entity_id: media_player.lr_av
#切换盒子
- service: media_player.select_source
data:
entity_id: media_player.lr_av
source: Blu-ray
#白天关窗帘,晚上关灯
- service_template: >
{% if states.sensor.sun_state.state == '日出' %}
cover.close_cover
{% else %}
switch.turn_off
{% endif %}
data_template:
entity_id: >
{% if states.sensor.sun_state.state == '日出' %}
cover.window
{% else %}
switch.lr_c2c6c6_2
{% endif %}
#6如果电视开着,关电视
- condition: state
entity_id: media_player.lr_tv
state: 'on'
- service: media_player.turn_off
entity_id: media_player.lr_tv
|