|
发表于 2018-2-2 14:26:08
|
显示全部楼层
本帖最后由 zorankeinfo 于 2018-2-2 14:33 编辑
感谢分享......善于运用场景模式,自动化更丰富....
# If player goes from playing to pause, dim the lights for bathroom/kitchen
- name: Movie Open
entities:
light.yeelight_white_286c07aea00f: #打开电视背景灯
state: on
brightness: 50
switch.slot2: on #打开投影仪总电源
cover.livingroom_mubu: open #放下投影幕布
cover.livingroom_cover: closed #关闭窗帘
switch.plug_158d000101c1b1: on #打开音响总电源
script.hdboxswitch: on #打开音响遥控电源
script.open_touying: on #打开投影仪
script.bt2gqswitch: on #转换音箱到光钎线接口
#####
# If player goes from paused to playing, do close movie in reverse
- name: Movie Close
entities:
light.yeelight_white_286c07aea00f:
state: off
cover.livingroom_mubu: closed
script.close_touying: on
media_player.apple_tv:
state: idle
switch.plug_158d000101c1b1: off
script.hdboxswitch: on
alias: auto turn on scene movies click
hide_entity: true
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d00019cd802
click_type: single
action:
service: homeassistant.turn_on
entity_id: scene.movie_open #开启影院模式场景
这样编辑自动化更节省代码,实现联动功能更多.....更多组件命令可以共享 |
|