Help with ac automation that didn't work

i have this automation, and it doesn’t work
although all parameters where ok

alias: Shabat _AC
description: auto make ac living room on above 27
trigger:
  - platform: device
    device_id: ecdf7df1a59f4e6c9c8287471f380cf1
    domain: climate
    entity_id: climate.air_conditioner_living_room
    type: current_temperature_changed
    above: 27
    for:
      hours: 0
      minutes: 0
      seconds: 0
condition:
  - condition: state
    entity_id: input_boolean.shabes_mode
    state: 'on'
  - condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.away_mode
        state: 'off'
  - condition: time
    before: '18:00:00'
    after: '10:00:00'
action:
  - device_id: ecdf7df1a59f4e6c9c8287471f380cf1
    domain: climate
    entity_id: climate.air_conditioner_living_room
    type: set_hvac_mode
    hvac_mode: cool
  - service: climate.set_temperature
    data:
      temperature: 22
    target:
      device_id: ecdf7df1a59f4e6c9c8287471f380cf1
  - device_id: 5c457297158c68ef6f689d8fe4792e68
    domain: climate
    entity_id: climate.air_conditioner_hall
    type: set_hvac_mode
    hvac_mode: cool
  - service: climate.set_temperature
    data:
      temperature: 22
    target:
      device_id: 5c457297158c68ef6f689d8fe4792e68
  - delay:
      hours: 3
      minutes: 0
      seconds: 0
      milliseconds: 0
  - device_id: ecdf7df1a59f4e6c9c8287471f380cf1
    domain: climate
    entity_id: climate.air_conditioner_living_room
    type: set_hvac_mode
    hvac_mode: 'off'
  - device_id: 5c457297158c68ef6f689d8fe4792e68
    domain: climate
    entity_id: climate.air_conditioner_hall
    type: set_hvac_mode
    hvac_mode: 'off'
mode: single

A few things stand out. First of all, I personally like numerical state triggers better than device triggers, it is hard to tell if if the device trigger is ok from my side. For instance, I do not know if it uses the above value. I also cannot tell what temperature it triggers on: the setpoint or the room temperature.

You can check if it works by looking at the trace for the automation. If there is one, it triggered at some point. If you have no traces at all, it is likely doing something else than expected. I’d use a numerical state trigger with an entity I know is the current temperature in the room.

You are also using the and clause the wrong way. All things that must be ‘and’-ed should be below it. However, since all conditions are anded by default you don’t really need it and it is probably not what is going wrong. You only ever need an ‘and’ inside an ‘or’.

Third: if the temperature is reached before the time range, nothing will happen. This trigger only happens one when the temperature goes from below 27 to above. It is ignored outside the time range, so if it is 27 degrees at 10:00 nothing happens.

I would put in an extra trigger at 10:00, and an extra condition it must me above 27 degrees. That way it will also turn on at 10 if it is hot.

And lastly, where do you live? It’s barely 11°C out here in the Netherlands and raining. I’m jealous! :wink:

thank you, I believe your third argument is the issue
well I live in Israel and I’m jealous, it’s hot over here :weary: :grinning_face_with_smiling_eyes:

Maybe we should meet in the middle, at around 20°C then :smile:

yep, where are you from?
any idea how to change the condition so it will work if at the current time the temp. is above, without changing time condition?

I live in Delft, the Netherlands. I was joking a bit, it is getting colder now in the evening but the weather today was quite nice, so I’m actually better off than you are.

The temperature condition should be pretty much the same as the trigger, if the device trigger works for you there’s probably a quite similar device condition too. Put that with the conditions. at the trigger part, a simple time trigger at 10:00.

If you want it to trigger at any change, try removing the above line. You would still need the temperature clause in the conditions then. But that will be very much less efficient, not to mention very annoying if you want to be able to control the AC by hand as well. Because if you turn the AC off by hand, the automation will keep turning it on again.

1 Like