How to Email Notify Temperature Alert

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.

Help with what? Is there something wrong?

The alert email isn’t occurring when the probe is below 85 degrees.

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

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

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.

Oh, ok. How can I set it to trigger when it rises above 85?

change this

below: 85
above: 85
1 Like

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

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

Will this still alert during normal operations, if the temp drops?

yes it work normally, but in addition when the HA restart it will send notification if the temp already below 85.