Hi all,
Thanks to this group I got the following automation rule working:
- id: brewing_temperature
alias: Brewing temperature
trigger:
- platform: state
entity_id: sensor.brew_temp
to: Alert
action:
- service: notify.notify_email
data:
title: Temperature Alert
message: "Sensor value outside limits. Currently {{ states.sensor.beer_temp.state\
\ }}\xB0C"
With this being based on this sensor template:
- platform: template
sensors:
brew_temp:
value_template:
"{% if states.sensor.beer_temp.state | int < 20 or states.sensor.beer_temp.state | int > 22 %}
Alert
{% else %}
Normal
{% endif %}"
friendly_name: "Brew temp"
I have now added a heater, with is controlled by a sonoff basic with tasmota firmware. I have this configured as a switch and it works correctly in a manual or standalone scenario in HA.
To automate it with one of my temperature sensors I created the following automation:
- id: heater_belt_toggle
alias: Toggle Heater Belt
trigger:
- platform: state
entity_id: sensor.beer_temp
action:
service_template: >
{% if states.beer.temp | int <= 20 %}
switch.turn_on
{% elif states.beer.temp | int >= 22 %}
switch.turn_off
{% endif %}
entity_id: switch.heater_belt
Whilst the heater did turn on (at about 19.75 C), it’s now 23.5 C and the heater has not turned off.
Can someone guide me on a way to do this? Simplistically I want the heater on when the beer temp is <=20 C, and turn it off when the temp is >=22 C.
Thanks again…
–
Roland