本帖最后由 chinyaolin 于 2019-4-13 21:09 编辑
第一組代碼中, 我使用了三個 script 來發送紅外, 三組紅外之間延遲 1 秒鐘
你可以參考看看調整其中的時間
action:
- service: script.turn_on
data_template:
entity_id:
# 因為透過 states 取得頻道拉桿的數字帶小數點, 所以需要用 int 轉為整數
- script.mod_remote_{{ states.input_number.mod_ch_x00.state | int }}
- delay: "00:00:01"
- service: script.turn_on
data_template:
entity_id:
- script.mod_remote_{{ states.input_number.mod_ch_0x0.state | int }}
- delay: "00:00:01"
- service: script.turn_on
data_template:
entity_id:
- script.mod_remote_{{ states.input_number.mod_ch_00x.state | int }}
另外, 也可以考慮把 service: script.turn_on 換成寫入 log, 方便偵錯
- service: system_log.write
data_template:
message: '想要寫入記錄檔的訊息'
|