littlemaui
(Shawn Haywood)
April 23, 2022, 10:13pm
1
Newbie here, I successfully setup SMTP. Now, I’m trying to setup an email alert when a temperature sensor drops below 85 degrees Fahrenheit.
If it helps, this is the sensor:
sensor:
- platform: rest
name: Reef Tank Temperature
resource: http://192.168.1.186:80/cgi-bin/status.xml
value_template: "{{ value_json.status.probes.probe[0].value }}"
unit_of_measurement: "°F"
force_update: true
Which creates this:
sensor.reef_tank_temperature
This my notifier:
- alias: Notify Reef Tank Low Temp
trigger:
- platform: template
value_template: '"{states.sensor.reef_tank_temperature.state | float
< 85}"'
condition: []
action:
- data:
message: Low Temp Alert
title: Reef Tank Temp Low
service: notify.gmail
Any help is appreciated.
nickrout
(Nick Rout)
April 23, 2022, 10:20pm
2
littlemaui:
Any help is appreciated.
Help with what? Is there something wrong?
littlemaui
(Shawn Haywood)
April 23, 2022, 11:37pm
3
The alert email isn’t occurring when the probe is below 85 degrees.
huu
April 24, 2022, 12:08am
4
Since you already have sensor.reef_tank_temperature as a numeric state can you try this
- alias: Notify Reef Tank Low Temp
trigger:
- platform: numeric_state
entity_id: sensor.reef_tank_temperature
below: 85
action:
- service: notify.gmail
data:
message: Low Temp Alert
title: Reef Tank Temp Low
littlemaui
(Shawn Haywood)
April 24, 2022, 12:57am
5
Thank you. Seems simple enough. I added it to my config.yaml, verified and restarted, but didn’t receive an email alert. The current temp is 76.1
huu
April 24, 2022, 1:04am
6
It only trigger when temperature drop from above to below 85 not when it below 85 already. Go to automation and “run action” see if you receive the email.
littlemaui
(Shawn Haywood)
April 24, 2022, 1:05am
7
Oh, ok. How can I set it to trigger when it rises above 85?
littlemaui
(Shawn Haywood)
April 24, 2022, 1:08am
9
Sorry, I know it’s simple, but hey I’m new. Thank you. It worked when I ran the automation, so I’ll make the change. Thank you very much.
Shawn
huu
April 24, 2022, 1:15am
10
if you want it to check on a restart you can also add it this
- alias: Notify Reef Tank Low Temp
trigger:
- platform: numeric_state
entity_id: sensor.reef_tank_temperature
below: 85
- platform: homeassistant
event: start
condition:
- condition: numeric_state
entity_id: sensor.reef_tank_temperature
below: 85
action:
- service: notify.gmail
data:
message: Low Temp Alert
title: Reef Tank Temp Low
1 Like
littlemaui
(Shawn Haywood)
April 24, 2022, 1:31am
11
Will this still alert during normal operations, if the temp drops?
huu
April 24, 2022, 1:42am
12
yes it work normally, but in addition when the HA restart it will send notification if the temp already below 85.