本帖最后由 隔壁的王叔叔 于 2022-11-20 22:24 编辑
大佬帮忙搞定了,一条代码,如下
alias: 自动化
description: ""
trigger:
- platform: state
entity_id:
- input_button.dian_dong_che_chong_dian
condition: []
action:
- choose:
- conditions:
- condition: time
after: "22:00:00"
before: "06:00:00"
weekday:
- sat
- fri
- thu
- wed
- tue
- mon
- sun
sequence:
- service: switch.toggle
data: {}
target:
entity_id: switch.dian_dong_che_chong_dian_cha_zuo_switch
- conditions:
- condition: time
after: "06:00:00"
before: "22:00:00"
weekday:
- fri
- thu
- wed
- tue
- mon
- sun
- sat
sequence:
- wait_for_trigger:
- platform: time
at: "22:00:00"
- platform: time
at: "06:00:00"
continue_on_timeout: false
- service: switch.toggle
data: {}
target:
entity_id: switch.dian_dong_che_chong_dian_cha_zuo_switch
mode: single
|