搜尋此網誌

2021年6月5日 星期六

(Home Assistant) 洗衣機 Line Notify 通知



一,註冊 Line notify

    登入 https://notify-bot.line.me/zh_TW/

    最下方 "登錄服務" 註冊 line notify 

.服務名稱:智慧家庭通知 .服務概要:智慧家庭通知 .服務網址:你的 HA 網址 .企業/經營者名稱:智慧家庭通知 .所在國家/地區:台灣 .負責人姓名:智慧家庭通知 .電子郵件帳號:填入你可以收到信的email .Callback URL:https://www.google.com/

    複製發行權杖


二,Home Assistant line 插件 

    1. 從作者的 GitHub 上下載客製元件- yun-s-oh 

https://github.com/yun-s-oh/Homeassistant  (作者不知道為什麼刪除了)

      可以改用作者MaxMac_STN https://github.com/maxmacstn/HA-Line-Notify 

      將下載後放置在\custom_components\notify_line\

      將line_notify.yaml放到packages, 將 access_token 改成剛剛複製的權杖


notify:                                                     

  - name: line_notification

    platform: notify_line

    access_token: 改成剛剛複製的權杖

    2.  Home Assistant core 2021.6.1 以後版本要求插件的 manifest.json 檔案中需要有 version key

         此插件作者已無維護,請自行在\custom_components\notify_line\底下添加 manifest.json  檔案,

         內容請參考下方



         {

  "domain": "notify_line",

  "name": "Notify LINE",

  "version": "0.1"

}


   

    3. 測試方式: 開發工具 / 服務 / 進入YAML模式

         


          若要使用兩個以上的 Line Notify,可參考以下寫法

           \\ packages \ line_notify.yaml

                 notify:                                                     

  - name: line_notification

    platform: notify_line

    access_token: 第一個Line notify token

    

  - name: line_notification_xxx   # xxx可自行修改

    platform: notify_line

    access_token: 第二個Line notify token 


三,安裝 BluePrint 自動化通知插件

        將插件匯入HA中 https://community.home-assistant.io/t/notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes/254841 


        將 automations.yaml 內容修正如下

  - id: '1622735458691'

  alias: 洗衣機LINE通知

  description: ''

  use_blueprint:

    path: sbyx/notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes.yaml

    input:

      power_sensor: sensor.wash_aqara_plug_us_power  #智能插座實體

      actions:

      - service: notify.line_notification

        data:

          message: 洗衣機好了

      starting_threshold: 15   #開始的瓦數

      finishing_threshold: 5   #結束的瓦數

      finishing_hysteresis: 10  #結束時間Min



另一個版本的簡易洗衣Line通知自動化

* 將插座entity_id 改成自己的

簡易版洗衣通知:
alias: LINE洗衣機
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.sonoff_pow_r2_washing_power
above: '50'
for: '60'
condition: []
action:
- wait_for_trigger:
- platform: numeric_state
entity_id: sensor.sonoff_pow_r2_washing_power
for: '150'
below: '10'
- service: notify.line_to_mama
data:
message: 衣服洗好囉
data:
file: /config/www/picture/washing.jpg

mode: single 



 


沒有留言:

張貼留言