前置需求:
功能简介:
- 触发条件这里没写,改成洗完衣服触发即可
- 使用8小时内最大降雨量的传感器,判断降雨量
#降雨强度 0.05 ~ 0.9 小雨 0.9 ~ 2.87 中雨 >2.87大雨
- alias: wash_clothes_rain_alarm
trigger:
- platform: time
at: '21:05:00'
condition:
condition: time
after: '08:05:00'
before: '23:35:00'
action:
- service: tts.clear_cache
- delay: 00:00:03
- service: script.si_tts
data_template:
msg: >
{%- if states.sensor.caiyun_hourly_precipitation8h.state | float >= 0 and states.sensor.caiyun_hourly_precipitation8h.state | float < 0.05 -%}
嘿嘿~天气不错,8小时内都不会下雨,可以放心晾晒衣服。
{%- elif states.sensor.caiyun_hourly_precipitation8h.state | float > 0.05 and states.sensor.caiyun_hourly_precipitation8h.state | float < 0.9 -%}
嗯~8小时内会下小雨,请多留意小思的即时天气播报。{{states('sensor.caiyun_minutely_description')}}
{%- elif states.sensor.caiyun_hourly_precipitation8h.state | float > 0.9 and states.sensor.caiyun_hourly_precipitation8h.state | float < 2.87 -%}
咦?8小时内会下中雨,请多留意小思的即时天气播报。{{states('sensor.caiyun_minutely_description')}},
您所在地的降雨量为{{states('sensor.caiyun_precipitation_local_precipitation_intensity')}}毫米
{%- elif states.sensor.caiyun_hourly_precipitation8h.state | float > 2.87 -%}
哎呀呀~8小时内会下好大的雨呀~{{states('sensor.caiyun_minutely_description')}},
您所在地的降雨量为{{states('sensor.caiyun_precipitation_local_precipitation_intensity')}}毫米
{%- endif %}
|