How to set Air-Condition automation with condition

After long instalation setup on my VM i`m finally ready for automation.

My first automation is Air-condition heating

Without the “condition” its working but when I want to add time limitation when it should work it dosent!

condition|531x500

What I`m doing wrong?

id: '1697749897541'
alias: Kuchnia Klima Turn On
description: ''
trigger:
  - platform: device
    device_id: 4886c752db0b265e5b5ca2bf7eca0003
    domain: climate
    entity_id: 1a8539ce1ba75dd75ff5a9a8c1e30be3
    type: current_temperature_changed
    below: 20
condition:
  - condition: time
    after: '06:30:00'
    before: '22:00:00'
    weekday:
      - sun
      - mon
      - tue
      - wed
      - thu
      - sat
      - fri
action:
  - device_id: 4886c752db0b265e5b5ca2bf7eca0003
    domain: climate
    entity_id: 1a8539ce1ba75dd75ff5a9a8c1e30be3
    type: set_hvac_mode
    hvac_mode: heat
mode: single

Hello! This is my code and it works fine. It might help.


alias: Clima On 08:00-23:00 - 19.7 C
description: Clima On 08:00-23:00 - 19.7 C
trigger:
  - type: temperature
    platform: device
    device_id: ab68b2ca8d58eb61fb0299572713f840
    entity_id: sensor.living_room_sensor_temperature
    domain: sensor
    below: 19.8
  - platform: time
    at: "08:10"
condition:
  - condition: time
    after: "08:00"
    before: "23:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
action:
  - service: climate.turn_on
    entity_id: climate.nord_conditioner
  - service: climate.set_temperature
    data:
      temperature: 29
      hvac_mode: heat
    target:
      entity_id: climate.nord_conditioner
  - service: climate.set_fan_mode
    data:
      entity_id: climate.nord_conditioner
      fan_mode: low
mode: single

Trigger and action we have diffrent (yours look more complicated) but the condition is the same.
I have the problem with condition.

To make it more complicated. It dosen`t start only in the morning. When I turn on the air-conditioner then … during the day the automation works. It turns on and offe at specific temperature values.

Your problem is that it goes below 20 at night, then the condition prevents it from running, all good so far.
Then in the morning, it is already below 20 so it will not trigger again.
You need another trigger in the morning as @WebPower suggested.

Recommended solution would be to add time as trigger, for example at: 06:30.
But then also the temperature as condition, below: 20.

So if triggered by time, it checks if the time slot is valid (your original condition) but also checks if the temperature really is below 20 at that time.
If triggered by temperature below 20, it check if the time slot is valid but also double checks if the temperature is really below 20 which is not a problem.

Basically something like this and then your desired action after:

description: ""
mode: single
trigger:
  - platform: numeric_state
    entity_id: climate.daikin
    below: 20
  - platform: time
    at: "00:06:30"
condition:
  - condition: time
    after: "00:06:30"
    before: "00:22:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
  - condition: numeric_state
    entity_id: climate.daikin
    below: 20
action: []

I’m on mobile so above is just a quick example to get you in the right direction :slight_smile:

1 Like

I`ve added to the condition “numeric state” (like below) and now if dosent turn off even during the day.

Any other suggestions how the condition could look like?

alias: Kuchnia Klima Turn On
description: ""
trigger:
  - platform: device
    device_id: 4886c752db0b265e5b5ca2bf7eca0003
    domain: climate
    entity_id: 1a8539ce1ba75dd75ff5a9a8c1e30be3
    type: current_temperature_changed
    below: 20
condition:
  - condition: time
    after: "06:30:00"
    before: "22:00:00"
    weekday:
      - sun
      - mon
      - tue
      - wed
      - thu
      - sat
      - fri
  - condition: numeric_state
    entity_id: climate.c698f786
    below: 20
action:
  - device_id: 4886c752db0b265e5b5ca2bf7eca0003
    domain: climate
    entity_id: 1a8539ce1ba75dd75ff5a9a8c1e30be3
    type: set_hvac_mode
    hvac_mode: heat
mode: single