- 积分
- 624
- 金钱
- 509
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
高级会员
- 积分
- 624
- 金钱
- 509
- HASS币
- 0
|
发表于 2018-3-20 14:21:50
|
显示全部楼层
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
automation:
- alias: switch_status_mail
trigger:
- platform: state
entity_id: switch.ac,switch.ac_2,switch.decorative_lights,switch.decorative_lights_2
action:
- service: notify.live_mail
data_template:
{"title":"HomeAssistant 通知",
"message":"{{ trigger.event.data.new_state.attributes.friendly_name }}
{%- if trigger.event.data.new_state.state == 'on' %}-开
{% else %}-关
{% endif -%}
"}
|
|