Temperature sensor not triggering in any given case

Hello everybody,

I ve been stuck with this for hours even if the use case is probably the simplest that exists.

I have not been able to turn ON switch when temperature is below 25. (Its always below 20)

  1. Tried different approaches, first try :
alias: firstTry
description: ""
trigger:
  - type: temperature
    platform: device
    device_id: ac5937feb5452bddd6522a9f719448d2
    entity_id: 3dd45aa1b936e8cdcfb15bab9d44edc6
    domain: sensor
    below: 25
condition: []
action:
  - type: turn_on
    device_id: e754ed54195e59e2657f480fc83c08db
    entity_id: c08ad0ca2dd1f1022a2a1d5e871aaaec
    domain: switch
mode: single

  1. second try :
alias: Allumer chuaffage
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.capteur_temperature_temperature
    below: 25
condition: []
action:
  - type: turn_on
    device_id: e754ed54195e59e2657f480fc83c08db
    entity_id: c08ad0ca2dd1f1022a2a1d5e871aaaec
    domain: switch
mode: single

None of this worked …
PS: With a specific hour as a trigger, it DOES turn on correctly
Thank you for reading me ! :hand_with_index_finger_and_thumb_crossed: :two_hearts:

Versions :

  • Core 2024.2.3
  • Supervisor 2024.02.0
  • Operating System 11.5
  • Interface utilisateur 20240207.1

maybe it doesn’t trigger except when it transitions to being below 25? otherwise it would be constantly triggering?

have u tried warming it up above 25 then let it fall and see if it triggers?

Your automation triggers when the temperature changes from above 25 to below 25. If it is always below 20 it will never trigger.

Also if the temperature is always below 20 the switch should always be on. Why is there a need to automate it?

Anyway, here’s one way of overcoming this:

trigger:
  - platform: state # this triggers whenever the temperature sensor changes to a valid number
    entity_id: 3dd45aa1b936e8cdcfb15bab9d44edc6
    not_to:
      - unknown
      - unavailable
condition:
  - platform: numeric_state # this checks if it is below 25
    entity_id: 3dd45aa1b936e8cdcfb15bab9d44edc6
    below: 25
action:
  - service: switch.turn_on
    target:
      entity_id: 3dd45aa1b936e8cdcfb15bab9d44edc6

The other way is to create a generic thermostat (nicer control on your dashboard too):

Finally have a read of this advice: