Yesterday, I left the door ajar, and the fridge overheated and iced up. I would like to send a notification to my phone when the temp of the fridge is 3c greater than the setpoint.
So i can set up a keg alarm entity using this value template
An then could use that in the automation, but I fear that because i don’t use lots of value templates, they will get lost, when i have to debug the automation.
What i really wanted to do was this:
- id: "12"
alias: "Keg Fridge warning"
# the current temp is 3C grater than the set tempp
trigger:
platform: template
value_template: "{{ state_attr("climate.01885101dc4f227adf84","current_temperature") > (state_attr("climate.01885101dc4f227adf84","temperature") + 3) }}"
action:
- service: notify.mobile_app_pixel_2
data:
message: 'Keg fridge over temp'
But i think this fails because the trigger is a limited template and can’t use state_attr.
Does anyone have any cunning plans, or should I just set up the keg_alarm entity using a value template?
The problem is the way you are using quotes. Use double quotes outside the template and single quotes inside, otherwise this is all Home Assistant sees: