Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 掃地機先掃後拖腳本:
- # 1. 複製所有內容,放在script.yaml的最後面
- # 2. 更改以下三個ID改成自己的
- # 3. 存檔後>開發工具>檢查設定內容>確認沒問題>下方重新載入YAML設定>選腳本
- # 4. 去設定>自動化與場景>腳本有出現"掃地機先掃後拖"且前面圖示不是紅色表示正常
- # 5. 右邊三點>執行即可,日後呼叫服務"script.vacuum_sweeping_than_mopping"即可執行此腳本
- # 6. 有問題時,點進腳本>右上角紀錄>看是哪一步出了問題再提出
- vacuum_sweeping_than_mopping:
- alias: "掃地機先掃後拖"
- variables:
- vacuum_id: vacuum.xiaomi_x10 #更換成你的掃地機實體ID
- notify_service: notify.home_notify #更換成你的通知服務名稱
- clean_mode: select.xiaomi_x10_cleaning_mode #更換成你掃地機的Cleaning Mode的實體ID
- sequence:
- - alias: "開始掃地程序: 1.調整吸力最強"
- service: vacuum.set_fan_speed
- data:
- entity_id: "{{ vacuum_id }}"
- fan_speed: 'Turbo'
- - alias: "2.選擇單掃地模式"
- service: select.select_option
- data:
- option: sweeping
- target:
- entity_id: "{{ clean_mode }}"
- - alias: "3.Line通知"
- service: "{{ notify_service }}"
- data:
- message: "開始掃地"
- - alias: "4.掃地機開始清理"
- service: vacuum.start
- target:
- entity_id: "{{ vacuum_id }}"
- - alias: "5.等待掃地機回家"
- wait_template: "{{ is_state(vacuum_id, 'returning') }}"
- - alias: "6.等待掃地機充電"
- wait_template: "{{ is_state(vacuum_id, 'docked') }}"
- - alias: "7.Line通知"
- service: "{{ notify_service }}"
- data:
- message: "掃地完成"
- - alias: "開始拖地程序: 1.調整吸力最弱"
- service: vacuum.set_fan_speed
- data:
- entity_id: "{{ vacuum_id }}"
- fan_speed: 'Silent'
- - alias: "2.選擇單拖地模式"
- service: select.select_option
- data:
- option: mopping
- target:
- entity_id: "{{ clean_mode }}"
- - delay:
- seconds: 1
- - alias: "3.Line通知"
- service: "{{ notify_service }}"
- data:
- message: "開始拖地"
- - alias: "4.掃地機開始清理"
- service: vacuum.start
- target:
- entity_id: "{{ vacuum_id }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement