Automation with IF doesn't work

I have two Aqara T1 sensors and a switch that turn on or off the heating. I’m trying to add automation to turn off the heater when temperature on both sensors reaches (or above) 22 degree. I added 2 conditions: temperature on the sensor 1 above 22 degree and temperature on sensor 2 above 22 degree. Then I added the same conditions to IF section to turn off the heating only when the temperature on both sensors reaches 22 degree. But the automation never runs. It starts working only when I remove IF section. But I need it to run automation if both conditions are true. It looks like a bug to me.

Hi, no, this is not an error. You are creating automation incorrectly. The principle of operation of 2.0 is described here (ignore the name of the lesson). Automation 2.0, lesson 1 (continued), description of the algorithm for transitioning automation 1.0 to 2.0 The principle of controlling the temperature in the room is described here Automation 2.0, lesson 11, creating the simplest automation for heating devices Can you provide a screenshot of the automation, I will fix it.

Thank you for the response
Here is my automation:

Do this.

1 Like

try this

Thanks guys for responses. But both solutions don’t work for me. Only clearing the IF section helps. But it doesn’t let me use AND condition as WHEN section works only as OR. I don’t know know how. To solve the problem I had to use hacky solution:


It seems the problem is only with temperature sensors T1 because other automations that I have work with IF conditions correctly.

I don’t understand, my entire heating control system is built on my example, everything works. Maybe your temperature in the IF section never happens (T1 or T2 at the same time no more than 22°C). Have you tried to run the test without time limits?

It definitely happens. I had more then 23 degrees on both sensors. I also tried without time limits. I even tried to leave only one condition in the IF section. Nothing helped until I cleared it.

I generally do this configuration, only there is no time frame.


Explanation, the condition in WHEN with a value greater than 0 forces it to poll the IF section for execution each time information is transmitted to the gateway (the period is visible in the temperature graph log). The second feature is that you can change the control parameters only in one section (IF).