Why does my automation stop running anymore?

Hi,

I don’t know whether something has changed in HA but an automation I have had working for some time has stopped working.

It triggers based on temperature dropping below a certain amount (with a condition to check whether I am in a peak rate on my electricity tariff).

The automation stops being triggered anymore even when the temperature keeps dropping, as I can see there are no traces available.

Here are the traces available as an example:

As you can see the last trigger was 18:42:17, however the temperature sensor it triggers on has dropped down a few more times since then:

Why wasn’t the automation triggered at 21:28 when it changed to 4 degrees?

This is the automation:

alias: Studio heater - auto on, low temperature
description: Turn on heater if low temperature and it's not Octopus Flux peak time
trigger:
  - platform: numeric_state
    entity_id: sensor.studio_motion_sensor_air_temperature_2
    below: "6"
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: select.octopus_electricity
        state: Peak
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.studio_heater_switch
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id: input_boolean.studio_heater_low_temperature_triggered
  - service: notify.mypushover
    data:
      message: Studio heater turned on as it's very low temperature
mode: single

I can’t see anything in the logs explaining this?

Thanks for any help you can offer

Because it’s below 6.
Triggers for numeric_state trigger ONCE, in this case when the air temperature has dropped below 6. It does not keep triggering each time the value changes when it is below the threshold. It will not trigger again until the temperature rises ABOVE 6 and then falls back below 6.

1 Like

I never realised that, thanks!

Will need to rethink the automation…

Yup change it to state instead of numeric state, and then use numeric_state in the condition. Then it will check every time the temperature changes, but the condition will be used to prevent it running when it is above or at 6.

I would probably add another condition though, to prevent it triggering if input_boolean.studio_heater_low_temperature_triggered is on, because you’ve already sent the notification and turned the heater on in that case.

trigger:
  - platform: state
    entity_id: sensor.studio_motion_sensor_air_temperature_2
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: select.octopus_electricity
        state: Peak
  - condition: numeric_state
    entity_id: sensor.studio_motion_sensor_air_temperature_2
    below: 6
  - condition: state
    entity_id: input_boolean.studio_heater_low_temperature_triggered
    state: "off"

something like that

1 Like

Brill, thanks for the help :grinning:

1 Like