Low Temp Alarm, repeat until cleared

Hello, I have been trying to setup a simple alarm, notification, alert to let me know when the temp has gone below a certain value and then send me notifications until the temp rises above that value. I have spent a few hours searching and cannot get anything to work. I recently migrated from OpenHAB so I am a complete newb to HA so be gentle :).

Device is an MQTT Sensor, the data is coming to HA and updates,etc so I believe all is ok with that portion

mqtt:
  sensor:
    - name: "Garage Temp Sensor"
      state_topic: "garage/sensor/temperature"
      
      unit_of_measurement: "°C"
      device_class: "temperature"
notify:
  - name: Gmail
    platform: smtp
    server: smtp.gmail.com
    port: 587
    timeout: 15
    sender: email
    encryption: starttls
    username: email
    password: pass
    recipient:
      - email
      - [email protected]
    sender_name: Home Assistant
input_boolean:
  garage_temp_notify:
    name: Garage Temperature Notify
    icon: mdi:alert

template:
  - binary_sensor:
      - name: Garage Temperature Alert Active
        state: "{{ (states('sensor.garage_temp_sensor') | int(0) < 25 }}"
garage_temp_critical_alert_active:
    name: Garage Temp Alert Active
    entity_id: binary_sensor.garage_temp_critical_alert_active
    state: "on"
    repeat: 1
    can_acknowledge: false
    skip_first: False
    title: "Critical Alert - Garage Temp"
    message: >
      Temperature is {{ states('sensor.garage_temp_sensor') }} C
    done_message: Garage Temp Returned to Normal
    notifiers:
      - mobile
      - Gmail 

I have this working in an automation, but it only works once I believe as it should

- id: 'xxxxxxxx'
  alias: Garage Temp Low
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.garage_temp_sensor
    below: 25
  condition: []
  action:
  - service: notify.gmail
    data:
      title: 'Garage Temp '
      message: Garage Temp Low
  - service: notify.mobile
    data:
      title: Garage Temp
      message: Garage Temp Low
  mode: single

Any help would be greatly appreciated

In your alert set up, I believe this:

    entity_id: binary_sensor.garage_temp_critical_alert_active

maybe should be this:

    entity_id: binary_sensor.garage_temperature_alert_active

Thank you for the response,unfortunatly that did not solve it. I am open to other alternatives, also is there a way to see that actual boolean value to make sure that is actually being triggered ?

You can see the state of all entities (and their history by clicking on them) on the STATES page of the Developer Tools.

This is all I see in there

That is just one of the many entities you showed above, specifically the input boolean, that I don’t see used anywhere in either the alert or the automation.

There should be a list of all the entities below the part you shared in the screen shot.

So I confirmed that is the correct one but if I am reading the screen right it is not triggered state=off ?

What is the correct one for what?

First, an alert is not “triggered”. Automations are triggered. So, which are you asking about? The alert or the automation? I know you are new to HA, so you might not have the terminology down yet. I just want to be clear what you’re asking about.

If you haven’t changed anything that you posted above, the alert will become non-idle (or “activate”) if/when the state of binary_sensor.garage_temp_critical_alert_active becomes on. However, given everything else you posted, there is no such entity. Therefore, the alert will never “activate” (i.e., change state to on and send the notification.)

Sorry, what I meant to say was that I was looking for the binary sensor and based on that screen shot it seems to be it (input_boolean.garage_temp_notify) from my code above.

in regards to the flow of events (again bare with me) my one automation (code) above seems to work as when the temp falls below 25 and I get a single notificaiton, but no repeat.

So based on what you are saying there is no “trigger” to kick off binary sensor to trigger the repeating alert ?, how would i create this entitiy ?.

I think you’ve made it much more complicated than it needs to be. The alert will take care of repeatedly sending the alert as configured until either the condition that cause the alert goes away, or it is cancelled.

You just need to configure the alert to look for a particular state of a particular entity. It can be anything that makes sense. If you don’t have something that indicates the correct condition directly, you can create a template sensor or template binary sensor that can be used to indicate the correct condition to “activate” the alert.

I recently changed to this and it seems to work, is this what you mean?.

template:
  - binary_sensor:
      - name: "Garage Temp Low"
        state: "{{ states('sensor.garage_temp_sensor') | float(0) <= 10.0 }}"
garage_temp_sensor:
    name: Garage Low Temperature
    entity_id: binary_sensor.garage_temp_low
    state: "on"
    repeat: 5
    skip_first: False
    message: The Temperature is Low
    done_message: The Temperature Returned to Normal
    notifiers:
     - mobile_app_RK_12
     - gmail
1 Like