鸡舍温度异常报警,已经对接了企业微信对接方法参考【https://bbs.hassbian.com/forum.php?mod=viewthread&tid=7128】
不多叙述了~看下图效果,实际也不好完全测试
大致方法,根据自己实际情况来参考
configuration.yaml里面添加inputnumber
input_number:
maxtemp:
name: maxtemp
min: 25.5
max: 40
step: 0.5
mode: box
unit_of_measurement: '°C'
mintemp:
name: mintemp
min: 10
max: 25
step: 0.5
mode: box
unit_of_measurement: '°C'
然后在自动化automations.yaml里面写自动化
- id: '2222222222'
alias: tempnotify
description: ''
trigger:
- platform: template
value_template: '{{ states(''sensor.tempmean'') | float < states(''input_number.mintemp'') | float }}'
for: 00:01:00
- platform: template
value_template: '{{ states(''sensor.tempmean'') | float > states(''input_number.maxtemp'') | float }}'
for: 00:01:00
condition: []
action:
- data:
message: "textcard|【鸡舍区域】\n\n正常温度范围设定值:{{ states('input_number.mintemp') }}°C~{{ states('input_number.maxtemp') }}°C \n\n最高温度:{{ states('sensor.tempmax') }} °C \n平均温度:{{\
\ states('sensor.tempmean') }} °C \n最低温度:{{ states('sensor.tempmin')}} °C\
\ \n\n最高湿度:{{ states('sensor.hummax') }} % \n平均湿度:{{ states('sensor.hummean')\
\ }} % \n最低湿度:{{ states('sensor.hummin')}} % |http://192.168.1.1"
title: 鸡舍温度异常通知
service: notify.weixin_xn
|