Simple heating automation

Hey guys! Im having problems with this automation, sometimes execute, sometimes not, it’s quite simple, I have a temperature sensor that sends the temperature trough mqqt to HA server, then I use this automation to fire my RM mini to my AC to start heating, but Im confused cause sometimes works and sometimes don’t.

alias: Chicos calor ON
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.habitacion_ninos_temperature
    below: '18'
condition:
  - condition: time
    after: '21:00:00'
    before: '08:00:00'
action:
  - service: switch.turn_on
    target:
      entity_id: switch.aire_calor25_hab_ninos
mode: single

For example last night the temperature was under 18C but the automation did not start at all.

Please help!!

Thanks in advance!

It only triggers if the temperature decrease below 18.
If the temperature already is below 18 at 21:00 it will not trigger

Ohh I see! Any idea how to correct this? Thanks in advance!

The usual way would be:

alias: Chicos calor ON
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.habitacion_ninos_temperature
    below: '18'
  - platform: time
    at: '21:00:00'
condition:
  - condition: numeric_state
    entity_id: sensor.habitacion_ninos_temperature
    below: '18'
  - condition: time
    after: '21:00:00'
    before: '08:00:00'
action:
  - service: switch.turn_on
    target:
      entity_id: switch.aire_calor25_hab_ninos
mode: single
1 Like

Thank so much guys, it is now working ok!!