Need some direction/ideas in how to setup an automation and then the Alert to SMS as I have read a number of posts and tried a number of ideas but just cannot seem to figure out what I need to do. I have a number of freezers and the below template gets me any that have temperature in the name and are above a set temp but when I add it to the message section of the automation it either does not work or is automatically removed by the editor.
Template:
{%-for state in states.sensor
if (state.entity_id.find("temperature") | int>=0) and (state.state == 'unknown' or (state.state |
int>=20))%}
{{state.name}} :: {{state.state_with_unit}}
{%-endfor%}
Current Automation:
- id: '1580850664300'
alias: Freezer Notification - Run every 10 min
description: ''
- minutes: /10
platform: time_pattern
seconds: '00'
condition:
- condition: or
conditions:
- above: '20'
condition: numeric_state
entity_id: sensor.freezer_one_temperature
- above: '20'
condition: numeric_state
entity_id: sensor.freezer_two_temperature
- above: '20'
condition: numeric_state
entity_id: sensor.freezer_three_temperature
- above: '20'
condition: numeric_state
entity_id: sensor.freezer_four_temperature
- above: '20'
condition: numeric_state
entity_id: sensor.freezer_five_temperature
action:
- data:
message: >
{%if(state.entity_id.find("temperature") | int>=0) and (state.state == 'unknown' or (state.state | int>=20))%}
{{state.name}} :: {{state.state_with_unit}}
{%endif%}
title: Freezer(s) reporting temperature issue
service: notify.sms