2024年11月24日星期日 上午5:52:15

notify - mail SMTP

1 年 前
#23781 引用
mail

https://www.home-assistant.io/integrations/smtp/


notify:
  - name: send_mail_to_myself
    platform: smtp
    sender: root@fqdn-hostname
    username: root@fqdn-hostname
    recipient: [email protected]


automation:
  - alias: Send test mail
    trigger:
      platform: time
      after: 'xx:xx:xx'
    action:
      service: notify.send_email_to_myself
      data:
        title: 'Test Email'
        message: 'Test'


To enable notification by e-mail in your installation, add the following to your configuration.yaml file:



# Example configuration.yaml entry
notify:
  - name: "NOTIFIER_NAME"
    platform: smtp
    sender: "YOUR_SENDER"
    recipient: "YOUR_RECIPIENT"




https://bbs.hassbian.com/thread-2759-1-2.html
0
1 年 前
#23782 引用
https://bbs.hassbian.com/thread-2759-1-2.html



notify:
  - name: mail
    platform: smtp
    server: smtp-mail.outlook.com
    port: 587
    timeout: 30
    sender: **********@live.cn
    encryption: starttls
    username: **********@live.cn
    password: *************
    recipient:
      - **********@qq.com
      - **********@qq.com
    sender_name: My Home Assistant

0
9 个月 前
#28460 引用
step 1.configuration entry for Google Mail.

# Example configuration.yaml entry for Google Mail.
notify:
  - name: "NOTIFIER_NAME"
    platform: smtp
    server: "smtp.gmail.com"
    port: 587
    timeout: 15
    sender: "[email protected]"
    encryption: starttls
    username: "[email protected]"
    password: "YOUR_APP_PASSWORD"
    recipient:
      - "[email protected]"
      - "[email protected]"
    sender_name: "SENDER_NAME"
0
9 个月 前
#28461 引用
step 2.how to use

USAGE
To use the SMTP notification, refer to it in an automation or script like in this example:

burglar:
  alias: "Burglar Alarm"
  sequence:
    - service: shell_command.snapshot
    - delay:
          seconds: 1
    - service: notify.NOTIFIER_NAME
      data:
          title: "Intruder alert"
          message: "Intruder alert at apartment!!"
          target:
            - "[email protected]"
          data:
              images:
                  - /home/pi/snapshot1.jpg
                  - /home/pi/snapshot2.jpg

0