Temperture alert - will this work?

Im trying to let the family know to turn on the AC if its getting too hot. It works when I run the automation manually, but difficult to do a real life test.
Im trying to keep the alexa notifications going every 20 minutes until the thermostat is NOT off, and not sure whether the trigger will keep triggering after the initial trigger above 79
I could just turn on the AC via the automation, but my family is horrible at closing windows unless prompted
Thanks in advance for any info.

alias: 002 AC - Hot Outside AC Not Running
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.thermostat_temperature
    above: '79'
condition:
  - condition: numeric_state
    entity_id: sensor.weather_station_temp
    above: '82'
  - condition: state
    entity_id: climate.thermostat
    state: 'off'
action:
  - service: notify.alexa_media_livingroom
    data:
      message: >-
        It's pretty hot outside, and getting pretty warm inside.  You may want
        to consider closing windows, and turning on the Air Conditioner.
      data:
        type: tts
  - service: notify.alexa_media_kitchen
    data:
      message: >-
        It's pretty hot outside, and getting pretty warm inside.  You may want
        to consider closing windows, and turning on the Air Conditioner.
      data:
        type: tts
  - service: notify.alexa_media_master_bedroom
    data:
      message: >-
        It's pretty hot outside, and getting pretty warm inside.  You may want
        to consider closing windows, and turning on the Air Conditioner.
      data:
        type: tts
  - service: notify.mobile_app_dad_s_phone
    data:
      message: Its hotter inside. Time for AC
      title: Home Assistant
  - delay:
      hours: 0
      minutes: 20
      seconds: 0
      milliseconds: 0
mode: single

Have you tried searching this forum? There are many similar questions.

You can also try reading the “manual” : Automation Modes - Home Assistant

@bouwew Yes. I have searched. Google, this forum, and have read that exact link you posted. I found nothing that clearly says whether or not the initial trigger will get repeated above the trigger point. In this case a temperature.

In my mind, it shouldn’t because it is no longer going from less than 79 to above 79.

Posting to forums is always my last resort.

It won;t continue triggering and the Numeric State Trigger’s documentation explains it will only trigger when the value crosses the threshold and only when it crosses the threshold.

If you want it to trigger for every increase above the threshold, use a State Trigger and then add a Numeric State Condition to test if the value is above the threshold.

1 Like

Looks like someone got it working, see this post Automation: (Loops) How to repeat an action 4 times ..at 90 second intervals - #41 by Plaatjesdraaier and the related posts above.

1 Like

Thank you @123

I was in the process of adding another trigger when you replied. It still wouldnt have worked. Plain old entity state checks every time it changes, then the 2nd trigger is checked and moves to conditions, or not.

TYVM

@bouwew @123

Thanks guys. Working like a champ!

In case anyone else is looking for a similar solution, here is what I ended up with. I used template platform just because I found that when I was “reading the documentation” :wink: I tested numeric state, and that worked just as well.

Im going to add a 30min delay at the end of the automation so its not going off at every temperature state change.

Thanks again.

alias: 002 AC - Hot Outside AC Not Running (Duplicate)
description: ''
trigger:
  - platform: state
    entity_id:
      - sensor.thermostat_temperature
  - platform: template
    value_template: '"{{ states(''sensor.thermostat_temperature'') | float >= 55 }}"'
condition:
  - condition: numeric_state
    entity_id: sensor.weather_station_temp
    above: '50'
  - condition: state
    entity_id: climate.thermostat
    state: 'off'
action:
  - service: notify.alexa_media_livingroom
    data:
      message: >-
        It's pretty hot outside, and getting pretty warm inside.  You may want
        to consider closing windows, and turning on the Air Conditioner.
      data:
        type: tts
  - service: notify.alexa_media_kitchen
    data:
      message: >-
        It's pretty hot outside, and getting pretty warm inside.  You may want
        to consider closing windows, and turning on the Air Conditioner.
      data:
        type: tts
  - service: notify.alexa_media_master_bedroom
    data:
      message: >-
        It's pretty hot outside, and getting pretty warm inside.  You may want
        to consider closing windows, and turning on the Air Conditioner.
      data:
        type: tts
  - service: notify.mobile_app_dad_s_phone
    data:
      message: Its hotter inside. Time for AC
      title: Home Assistant
mode: single

#temperature trigger #retrigger #repeat trigger #multiple triggers

Your automation doesn’t appear to employ what I had suggested.

It contains two triggers monitoring the value of sensor.thermostat_temperature and the second one is redundant.

  • When an automation has multiple triggers, they’re logically ORed (meaning any one of them can serve to trigger the automation).
  • The first trigger will trigger when the value of sensor.thermostat_temperature changes (any change).
  • The second trigger only triggers when the value of sensor.thermostat_temperature changes to anything above 55. However, so will the first trigger so the second one is redundant.

What I had suggested looks like this:

alias: 002 AC - Hot Outside AC Not Running (Duplicate)
description: ''
trigger:
  - platform: state
    entity_id: sensor.thermostat_temperature
condition:
  - "{{ trigger.to_state.state | float(0) >= 55 }}"
  - condition: numeric_state
    entity_id: sensor.weather_station_temp
    above: '50'
  - condition: state
    entity_id: climate.thermostat
    state: 'off'
action:
  ... your actions ...

The first condition is a Template Condition (in shorthand notation) that confirms the trigger’s new value is greater or equal to 55 (in other words, it confirms the sensor’s value is >= 55).

1 Like

@123

Yes, the second trigger is actually a condition to continue the automation and check conditions. LOL… thanks. Makes better sense.

Ill have to play with it a bit. When I move it down to conditions, it says

template value should be a string for dictionary value @ data['value_template']. Got None

Im pretty sure I just need to format the template correctly. No time to read the docs right now. Heading to a graduation ceremony.

Thanks for your time.

The UI “Test condition” button function is currently not working for Template conditions.
The conditions still work “real world”… it’s just the tester that’s broken.

1 Like