本帖最后由 zro22 于 2019-2-1 16:07 编辑
- platform: template
lights:
zhuwo:
value_template: "{{ is_state('input_boolean.zhuwokai', 'on') }}"
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.zhuwokai
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.zhuwokai
input_boolean:
zhuwokai:
initial: off
然后再在
input_boolean里面加自己要做的动作
- alias: zhuwo kai
initial_state: true
trigger:
- platform: state
from: 'off'
to: 'on'
entity_id: input_boolean.zhuwokai
action:
service: remote.send_command
data:
entity_id: remote.xiaomi_ir_remote
command:
- raw:Z6WtADgCAACiBgAAwgYAAJsRAAC7EQAAFiMAADUjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2IAAgAAAgACAgIAAAAAAgACAAECAgAAAAICAAAEUQACAAACAAICAgAAAAACAAIAAgICAAAAAQIAAANiAAIAAAIAAgICAAAAAAIAAgABAgIAAAACAgAAA=
- alias: zhuwo guan
initial_state: true
trigger:
- platform: state
from: 'on'
to: 'off'
entity_id: input_boolean.zhuwokai
action:
service: remote.send_command
data:
entity_id: remote.xiaomi_ir_remote
command:
- raw:Z6WtACICAABdAgAAbQYAAJ4GAADCBgAAuBEAABcjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWQEAQQCEQQEAQEEAQQBAQEEBAQBAQEDEQQEAQEFZAQBBAQBBAQBAQMRBAEBAQMUBAEBAQQBBAQBAQVkBAEEAxEEBAEAFAEEAQEBBAQEAQEAFAEEBAEAA=
|