本帖最后由 launze 于 2018-5-3 11:56 编辑
直接上:
开关template:
switch:
- platform: template
switches:
bedroomtv:
friendly_name: "TV"
value_template: "{{ as_timestamp(states.script.close_bedroom_tv.attributes.last_triggered) | int < as_timestamp(states.script.open_bedroom_tv.attributes.last_triggered) | int }} "
turn_on:
service: script.open_bedroom_tv
turn_off:
service: script.close_bedroom_tv
开关script:
open_bedroom_tv:
sequence:
- data:
entity_id: remote.livingroomirremote
command: 'Z6VLACICAABWAgAAdwYAAMcIAACpEQAAiSMAAHibAAD0eAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBISEhAQEhISEBAQEhIQEBISEhAQEBISEBAQEhISFhNXE1AQ=='
service: remote.send_command
close_bedroom_tv:
sequence:
- data:
entity_id: remote.livingroomirremote
command: 'Z6VLACICAABWAgAAdwYAAMcIAACpEQAAiSMAAHibAAD0eAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBISEhAQEhISEBAQEhIQEBISEhAQEBISEBAQEhISFhNXE1AQ=='
service: remote.send_command
为什么要搞成这样呢,为了支持天猫精灵控制。
|