这是坏天气才提醒的案例可以参考下自己改!改成自己的合适的
# 坏天气邮件提醒
- alias: 'yueqing bad weather tomorrow'
initial_state: true
trigger:
- platform: time # 预定时间触发
at: '21:25:00'
condition:
condition: template # 当明天为以下天气时(自己也可酌情增减。另heweather支持英文,如果设置的英文请用注释部分。)
value_template: '{{states("sensor.tomorrow_weather") in ("大风", "阵雨",
"强阵雨", "雷阵雨", "强雷阵雨", "雷阵雨伴有冰雹", "小雨", "中雨",
"大雨", "暴雨", "大暴雨", "特大暴雨", "冻雨", "小雪", "中雪",
"大雪", "暴雪", "雨夹雪", "雨雪天气", "阵雨夹雪", "阵雪", "雾")}}'
action:
- service: notify.mail
data:
title: "明天有雨雾天气,外出请注意!"
message: "满满智能坏天气提醒:明天天气:{{states('sensor.tomorrow_weather')}},温度{{states('sensor.tomorrow_tmp_min')}}到{{states('sensor.tomorrow_tmp_max')}}°C,外出时请注意备好雨伞等,开车注意安全!"
- service: tts.baidu_say #调用百度TTS
data_template:
entity_id: media_player.pro3403 #小度pro TTS
message: >
"满满智能坏天气提醒:明天天气:{{states('sensor.tomorrow_weather')}},温度{{states('sensor.tomorrow_tmp_min')}}到{{states('sensor.tomorrow_tmp_max')}}°C,外出时请注意备好雨伞等,开车注意安全!"
- service: notify.weixin
data:
title: "明天有雨雾天气,外出请注意!"
message: "满满智能坏天气提醒:明天天气:{{states('sensor.tomorrow_weather')}},温度{{states('sensor.tomorrow_tmp_min')}}到{{states('sensor.tomorrow_tmp_max')}}°C,外出时请注意备好雨伞等,开车注意安全!"
|