Notify via email automation not triggering

Need some help with an automation… I can trigger this and get the email but my problem is that the automation will not trigger when the temp goes out of the above and below specs. Any help would be appreciated. The sensor is a D1 Mini running tasmota using a DS18B20. That works fine, and it displays fine on HA.

- id: '1578265748192'
  alias: xxxxxxxxxxxxxxxxx
  description: ''
  trigger:
  - above: 45
    below: 34
    device_id: 8ca0af82b50c4829b8d026f1655a5d55
    domain: sensor
    entity_id: sensor.tasmota_ds18b20_temperature
    for:
      hours: 0
      minutes: 1
      seconds: 0
    platform: device
    type: temperature
  condition: []
  action:
    service: notify.gmail_email
    data:
      message: Refrigerator TEMP is out of Range, Temp is {{ states('sensor.tasmota_ds18b20_temperature') }}  degrees

if you use both above and below it has to be a ‘between’ range. You need to use two triggers, one for below and one for above…

- id: '1578265748192'
  alias: fixed by mf_social
  trigger:
    - platform: numeric_state
      entity_id: sensor.tasmota_ds18b20_temperature
      above: 45
      for:
        minutes: 1
    - platform: numeric_state
      entity_id: sensor.tasmota_ds18b20_temperature
      below: 34
      for:
        minutes: 1
  action:
    service: notify.gmail_email
    data_template:
      message: "Refrigerator TEMP is out of Range, Temp is {{ states('sensor.tasmota_ds18b20_temperature') }}  degrees"

You also needed data_template in your action, and quotes around the templated statement. I’ve also done you the favour of moving you away from those ridiculously verbose device triggers and on to something far more easy on the eye.

1 Like