Temperature automation not triggering

Hello gents
I’m new to HA and made a simple automation that works fine when I self trigger. Unfortunately it doesn’t trigger by itself.
Can someone direct me in the correct direction. As for the action part that doesn’t show in the image, it simply turns off the water heater.
Thank you in advance.

For future reference, post the YAML version of your automation as opposed to a screenshot. In the upper right of the Automation Editor there’s an overflow menu (the icon with three vertical dots). Click that and one of the choices is ‘Switch to YAML’. Your automation will be displayed as YAML code which can be easily copy-pasted to the forum.

Your automation uses a Numeric State Trigger that will trigger when the temperature sensor increases above the threshold value of 62. It means it will trigger the moment when the value crosses the threshold. It won’t trigger again until the value first decreases below the threshold (62) and then rises above it. If the automation was created when the temperature was already above 62, it won’t never trigger until the temperature drops below 62 and then rises above it.

Once it crosses the threshold and triggers, it won’t keep triggering as the value continues to rise (it only triggers at the crossing of the threshold).

Thanks for your prompt reply.
What you mentioned is exactly how it is supposed to work, unfortunately it’s not. The temperature rose from 58 exceeding 62 and still nothing happened.

As for the yams code, here it is:

alias: Hot Water Off
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.sonoff_10003874a8_temperature
    above: '62'
    for: '00:02:00'
condition:
  - condition: state
    entity_id: switch.sonoff_10003874a8
    state: 'On'
action:
  - service: switch.turn_off
    data: {}
    entity_id: switch.sonoff_10003874a8
  - service: notify.mobile_app_w7
    data:
      title: Oh Yeah!!
      message: >-
        Pleanty of Hot Water @
        {{states("sensor.sonoff_10003874a8_temperature")}}, Gonna switch it OFF!
  - service: notify.mobile_app_xdk
    data:
      title: Oh Yeah!!
      message: >-
        Pleanty of Hot Water @
        {{states("sensor.sonoff_10003874a8_temperature")}}, Gonna switch it OFF!
mode: single

Your condition needs to have a lowercase O in ‘on’ - as it stands your condition will never be true as all states are lowercase (unless from things you specifically generated).

Yup, condition’s state value is incorrect. The condition should use the state values shown in Developer tools > States and not what you may see in the Lovelace UI.

Thank you guys, that sorted the problem and now the automation works.
I have a question, as I come from an industrial automation background and totally new to HA. In case I didn’t put the condition close (to check on the status of the switch), will I get bombarded by notifications? I mean will the automation keep on activating or it will only activate once and never again until the temperature drops below the set margin?
Once again, thank you for your prompt reply and support. Amazing

It triggers at the crossing of the threshold.

I don’t quite understand the question, but hopefully this is the answer…

You’ll get the notification every time the automation fires.

The automation will fire every time the sensor goes from below 62 to above it and stays there for 2 minutes, and the switch is on.

Thank you all.
Amazing support and amazing community.

2 Likes

BTW, you may wish to consider switching the Solution tag from my post to mf_social’s first post because it was the first to zero-in on the syntax error that prevented the condition from working.

Done.
I’m new to this community too.
Have a good day everyone and stay safe.

Hi! Same issue here… Even when the Sensor goes over 25 … the automation is not working. Already try with Attribute or without.

alias: DC Esta sobre 30 Grados
description: “”
trigger:

  • platform: numeric_state
    entity_id: sensor.living_clima_temperature
    value_template: “”
    attribute: temperature
    above: 25
    condition: []
    action:
  • device_id: fb0c53635862264986ea6da65b3de79e
    domain: mobile_app
    type: notify
    message: DC esta sobre 30 Grados
    mode: single

any idea?

Format your code properly: How to help us help you - or How to ask a good question

Remove the value_template line, which is taking the sensor’s value, discarding it, and using an empty string for the comparison.

Check whether you need the attribute line. If the temperature you’re trying to compare against is the state of that sensor, remove the line. Don’t just try with and without, work out which one it is.

This entity would need attribute: temperature:

This one would not:

How do you get these tables shown?

Developer Tools / States.