Temperature sensor won't kick automation

Hi guys I’m having problem with automation of if temperature changes below x and above x then turn on AC on certain room.

Previously I have been using a set up time and it worked alright. Then I bought Tuya temperature sensor and hasn’t able to get the function above working.

I’ve tested that the conditions are all good to go but it never kicked off. Where do I do wrong? Screenshots below are two different tests that I have. Both doesn’t work.


How to help us help you - or How to ask a good question.
That is very hard to read and help you with.
Troubleshooting YAML using pictures of the UI is not the way to ask for help.

Whatever the yaml is then the more correct option is to set up a generic thermostat for it instead.
Then turn the thermostat on/off depending on time

1 Like

Wild guess: before 5a.m. the sensor’s temp was already above the threshold (or below) but did not cross the threshold.

Hi sorry I am still very new. I believe below is the code:

id: ‘1715482656800’
alias: AC On (BR) - Cold Season
description: >-
To turn on AC around 6:30 PM - 5:00 AM when the temperature is below 22°C for
Baby Room
trigger:

  • type: temperature
    platform: device
    device_id: cd3bff1d0fcb569a51f3779854ab8ae3
    entity_id: 4320ae9a7253c64d1574fe3856196c90
    domain: sensor
    above: 18
    below: 22
    condition:
  • condition: time
    after: ‘18:30:00’
    before: ‘05:00:00’
  • type: is_temperature
    condition: device
    device_id: cd3bff1d0fcb569a51f3779854ab8ae3
    entity_id: 4320ae9a7253c64d1574fe3856196c90
    domain: sensor
    below: 22
    action:
  • service: climate.turn_on
    target:
    device_id:
    - 0fe03261b8447a2f424ed8b12d5cdfc6
    entity_id:
    - climate.baby_room
    - climate.main_climate_controller
    data: {}
  • service: climate.turn_off
    target:
    entity_id:
    - climate.deanne_room
    - climate.guest_room
    - climate.master_bedroom
    - climate.office_room
    data: {}
  • service: climate.set_temperature
    target:
    device_id:
    - 0fe03261b8447a2f424ed8b12d5cdfc6
    entity_id: climate.baby_room
    data:
    temperature: 22
    hvac_mode: heat
    mode: single

format your code correctly. How to format your code in forum posts

1 Like