Automatic air conditioner

It would be great to add more condition like Solar power generation, power usage,

It would also be good to have triggers based off room temp or humidity

Looks excellent, thankyou for sharing, i will try :slight_smile:

1 Like

Can you add a scheduler Feature? Variable Times are better

planning what do you mean by a weekly schedule? Operation is planned on an hourly basis which also takes into account the presence at home so as to be more automatic.

A manuell helper scheduler is the best way i think, maby multiple for normal and holiday

What is the best way to troubleshoot this automation.
I can hear the AC getting some type of trigger but it does not turn on.
Only thing I can think of is my HVAC option in local tuya is auto not cold.

How are the seasons defined? I assume it doesn’t use the Season integration? Would it work properly in the southern hemisphere?

Thanks for your contribution!

you change the season manually from the blueprint switch. I didn’t rely on integration to avoid anomalous behavior.

I have a multisplit air conditioner at home with one central unit and multiple splits in different rooms.
And I control the air conditioning with the Sensibo system, which is integrated in Home Assistant, among other things.
Is it possible to run this blueprint with such integration?

I’m in a similar boat - I have 5 mini splits and I’d like to set up an automation that adjusts all of my rooms to different temperatures based on experience of how warm/ cold a room gets compared to another.

For starters I’m going to create a separate automation for each mini split (god I hope they add folders to home assistant for organization soon!!), but would a similar approach work for your hvac system?

Would it be possible to have an option to use Fahrenheit instead of Celsius? Any way to have an option for Cool mode instead of auto? Also read that Device to notify push : OPTIONAL is not optional anymore and requires an entry or it errors when trying to save.

Thanks for great work

Hi, my automatization does not work, please check - see trace attached.

{
  "trace": {
    "last_step": "action/2/if/condition/0",
    "run_id": "9fc6f0c16ec159b041c9fa165e20c77c",
    "state": "stopped",
    "script_execution": "finished",
    "timestamp": {
      "start": "2024-09-03T10:14:04.856696+00:00",
      "finish": "2024-09-03T10:14:04.860089+00:00"
    },
    "domain": "automation",
    "item_id": "1725315220436",
    "trigger": null,
    "trace": {
      "trigger": [
        {
          "path": "trigger",
          "timestamp": "2024-09-03T10:14:04.856813+00:00",
          "changed_variables": {
            "season": "Summer",
            "target_temperature_start": 24,
            "climate": "climate.dnevna_soba_zg",
            "target_temperature_stop": 22,
            "window": "binary_sensor.windows_ds_zg",
            "language": "English",
            "presence_home": "group.presence_home_disabled",
            "this": {
              "entity_id": "automation.automatic_air_conditioner_for_winter_and_summer_monitoring_presence_window_status_water_level_and_time_slot",
              "state": "on",
              "attributes": {
                "id": "1725315220436",
                "last_triggered": "2024-09-03T10:12:19.407838+00:00",
                "mode": "parallel",
                "current": 0,
                "max": 10,
                "friendly_name": "Automatic air conditioner for winter and summer, monitoring presence, window status, water level and time slot."
              },
              "last_changed": "2024-09-03T10:14:00.247152+00:00",
              "last_reported": "2024-09-03T10:14:00.247152+00:00",
              "last_updated": "2024-09-03T10:14:00.247152+00:00",
              "context": {
                "id": "01J6VP0ZSQSGJT3RFJQPHD1D1J",
                "parent_id": null,
                "user_id": null
              }
            },
            "trigger": {
              "platform": null
            }
          }
        }
      ],
      "action/0": [
        {
          "path": "action/0",
          "timestamp": "2024-09-03T10:14:04.857870+00:00",
          "changed_variables": {
            "context": {
              "id": "01J6VP149RC168QQAP6HCKSQK3",
              "parent_id": "01J6VP149QSHXSFMGF398PQCJT",
              "user_id": null
            }
          }
        }
      ],
      "action/0/if": [
        {
          "path": "action/0/if",
          "timestamp": "2024-09-03T10:14:04.857997+00:00",
          "result": {
            "result": false
          }
        }
      ],
      "action/0/if/condition/0": [
        {
          "path": "action/0/if/condition/0",
          "timestamp": "2024-09-03T10:14:04.858020+00:00",
          "result": {
            "result": false,
            "entities": []
          }
        }
      ],
      "action/1": [
        {
          "path": "action/1",
          "timestamp": "2024-09-03T10:14:04.858499+00:00"
        }
      ],
      "action/1/if": [
        {
          "path": "action/1/if",
          "timestamp": "2024-09-03T10:14:04.858837+00:00",
          "result": {
            "result": false
          }
        }
      ],
      "action/1/if/condition/0": [
        {
          "path": "action/1/if/condition/0",
          "timestamp": "2024-09-03T10:14:04.858859+00:00",
          "result": {
            "result": true,
            "entities": [
              "climate.dnevna_soba_zg"
            ]
          }
        }
      ],
      "action/1/if/condition/1": [
        {
          "path": "action/1/if/condition/1",
          "timestamp": "2024-09-03T10:14:04.859110+00:00",
          "result": {
            "after": {
              "__type": "<class 'datetime.time'>",
              "isoformat": "01:00:00"
            },
            "now_time": {
              "__type": "<class 'datetime.time'>",
              "isoformat": "12:14:04.859125"
            },
            "before": {
              "__type": "<class 'datetime.time'>",
              "isoformat": "23:00:00"
            },
            "result": true
          }
        }
      ],
      "action/1/if/condition/2": [
        {
          "path": "action/1/if/condition/2",
          "timestamp": "2024-09-03T10:14:04.859144+00:00",
          "result": {
            "result": true,
            "entities": [
              "group.presence_home_disabled"
            ]
          }
        }
      ],
      "action/1/if/condition/3": [
        {
          "path": "action/1/if/condition/3",
          "timestamp": "2024-09-03T10:14:04.859228+00:00",
          "result": {
            "result": false
          }
        }
      ],
      "action/1/if/condition/3/conditions/0": [
        {
          "path": "action/1/if/condition/3/conditions/0",
          "timestamp": "2024-09-03T10:14:04.859243+00:00",
          "result": {
            "result": false,
            "entities": []
          }
        }
      ],
      "action/1/if/condition/3/conditions/1": [
        {
          "path": "action/1/if/condition/3/conditions/1",
          "timestamp": "2024-09-03T10:14:04.859325+00:00",
          "result": {
            "result": false,
            "entities": []
          }
        }
      ],
      "action/2": [
        {
          "path": "action/2",
          "timestamp": "2024-09-03T10:14:04.859425+00:00"
        }
      ],
      "action/2/if": [
        {
          "path": "action/2/if",
          "timestamp": "2024-09-03T10:14:04.859580+00:00",
          "result": {
            "result": false
          }
        }
      ],
      "action/2/if/condition/0": [
        {
          "path": "action/2/if/condition/0",
          "timestamp": "2024-09-03T10:14:04.859596+00:00",
          "result": {
            "result": false,
            "entities": [
              "climate.dnevna_soba_zg"
            ]
          }
        }
      ]
    },
    "config": {
      "mode": "parallel",
      "variables": {
        "season": "Summer",
        "target_temperature_start": 24,
        "climate": "climate.dnevna_soba_zg",
        "target_temperature_stop": 22,
        "window": "binary_sensor.windows_ds_zg",
        "language": "English",
        "presence_home": "group.presence_home_disabled"
      },
      "trigger": [
        {
          "platform": "state",
          "entity_id": "binary_sensor.moisture_disabled",
          "from": "off",
          "to": "on",
          "id": "moisture_notify"
        },
        {
          "platform": "state",
          "entity_id": "binary_sensor.moisture_disabled",
          "from": "off",
          "to": "on",
          "for": {
            "minutes": 5
          },
          "id": "moisture_climate_off"
        },
        {
          "platform": "numeric_state",
          "entity_id": "climate.dnevna_soba_zg",
          "attribute": "current_temperature",
          "above": 24,
          "id": "climate_on"
        },
        {
          "platform": "numeric_state",
          "entity_id": "climate.dnevna_soba_zg",
          "attribute": "current_temperature",
          "below": 24,
          "id": "climate_on"
        },
        {
          "platform": "numeric_state",
          "entity_id": "climate.dnevna_soba_zg",
          "attribute": "current_temperature",
          "below": 22,
          "for": {
            "minutes": 10
          },
          "id": "climate_off"
        },
        {
          "platform": "numeric_state",
          "entity_id": "climate.dnevna_soba_zg",
          "attribute": "current_temperature",
          "above": 22,
          "for": {
            "minutes": 10
          },
          "id": "climate_off"
        },
        {
          "platform": "time",
          "at": "23:00:00",
          "id": "climate_off"
        },
        {
          "platform": "time",
          "at": "01:00:00",
          "id": "climate_on"
        },
        {
          "platform": "state",
          "entity_id": "binary_sensor.windows_ds_zg",
          "for": {
            "seconds": 30
          },
          "id": "window"
        },
        {
          "platform": "state",
          "entity_id": "group.presence_home_disabled",
          "from": [
            "not_home",
            "home"
          ],
          "to": [
            "not_home",
            "home"
          ],
          "id": "presence_home"
        }
      ],
      "action": [
        {
          "alias": "Avviso tanica piena",
          "if": [
            "{{ trigger.id == 'moisture_notify' and not is_state(climate,'off')}}"
          ],
          "then": [
            {
              "domain": "mobile_app",
              "type": "notify",
              "device_id": "062bd6b57f1171063b012d7b94f0ddee",
              "title": "{% if language == 'Italiano' %}CONDIZIONATORE {% else %}AIR CONDITIONER. {% endif %}",
              "message": "{% if language == 'Italiano' %}Contenitore scarico acqua condizionatore pieno, spegnimento automatico tra 5 minuti. {% else %} Air conditioner water discharge container full, automatic shutdown in 5 minutes. {% endif %}"
            }
          ]
        },
        {
          "alias": "Accensione climate",
          "if": [
            "{{is_state(climate,'off')}}",
            {
              "condition": "time",
              "after": "01:00:00",
              "before": "23:00:00"
            },
            "{{ states(presence_home) == 'home' or presence_home == 'group.presence_home_disabled'}}",
            {
              "or": [
                "{{ (trigger.id == 'climate_on' or trigger.id == 'window' or (trigger.id == 'presence_home' and trigger.to_state.state == 'home')) and season == 'Winter' and (state_attr(climate,'current_temperature')|float(0) < target_temperature_start|float(0) )}}",
                "{{ (trigger.id == 'climate_on' or trigger.id == 'window'or (trigger.id == 'presence_home' and trigger.to_state.state == 'home')) and season == 'Summer' and (state_attr(climate,'current_temperature')|float(0) > target_temperature_start|float(0) )}}"
              ]
            }
          ],
          "then": [
            {
              "alias": "Controllo finestra",
              "if": [
                " {{ window == 'binary_sensor.window_disabled' or states(window) == 'off'}}"
              ],
              "then": [
                {
                  "data": {
                    "entity_id": "climate.dnevna_soba_zg",
                    "temperature": 18,
                    "hvac_mode": "cool"
                  },
                  "action": "climate.set_temperature"
                },
                {
                  "delay": {
                    "seconds": 1
                  }
                },
                {
                  "data": {
                    "entity_id": "climate.dnevna_soba_zg",
                    "fan_mode": "high"
                  },
                  "action": "climate.set_fan_mode"
                },
                {
                  "domain": "mobile_app",
                  "type": "notify",
                  "device_id": "062bd6b57f1171063b012d7b94f0ddee",
                  "title": "{% if language == 'Italiano' %}CONDIZIONATORE {% else %}AIR CONDITIONER. {% endif %}",
                  "message": "{% if language == 'Italiano' %}Accensione condizionatore eseguita ci sono {{state_attr(climate,'current_temperature')|float(0)}}° {% else %} Turn on air conditioner performed there are {{state_attr(climate,'current_temperature')|float(0)}}° {% endif %}"
                }
              ],
              "else": [
                {
                  "domain": "mobile_app",
                  "type": "notify",
                  "device_id": "062bd6b57f1171063b012d7b94f0ddee",
                  "title": "{% if language == 'Italiano' %}CONDIZIONATORE {% else %}  AIR CONDITIONER. {% endif %}",
                  "message": "{% if language == 'Italiano' %}Accensione condizionatore non eseguito perchè hai lasciato aperta la finesta. {% else %} Turning on air conditioner not performed because you left the window open. {% endif %}"
                }
              ]
            }
          ]
        },
        {
          "alias": "Spegni climate",
          "if": [
            "{{not is_state(climate,'off')}}",
            {
              "or": [
                "{{ trigger.id == 'presence_home' and trigger.to_state.state == 'not_home'}}",
                "{{ trigger.id == 'climate_off' and season == 'Winter' and (state_attr(climate,'current_temperature')|float(0) > target_temperature_stop|float(0) )}}",
                "{{ trigger.id == 'climate_off' and season == 'Summer' and (state_attr(climate,'current_temperature')|float(0) < target_temperature_stop|float(0) )}}",
                "{{ trigger.id == 'climate_off' and trigger.platform == 'time'}}",
                "{{ trigger.id == 'window' and is_state(window,'on')}}",
                "{{ trigger.id == 'moisture_climate_off' }}"
              ]
            }
          ],
          "then": [
            {
              "target": {
                "entity_id": "climate.dnevna_soba_zg"
              },
              "action": "climate.turn_off"
            },
            {
              "domain": "mobile_app",
              "type": "notify",
              "device_id": "062bd6b57f1171063b012d7b94f0ddee",
              "title": "{% if language == 'Italiano' %}CONDIZIONATORE {% else %}  AIR CONDITIONER. {% endif %}",
              "message": "{% if language == 'Italiano' and trigger.id == 'window' %}Condizionatore spento perchè è stata aperta la finestra. {% elif language == 'Italiano' and (trigger.id == 'climate_off' or trigger.id == 'presence_home')%} Spegnimento automatico condizionatore. {% elif language == 'Italiano' and trigger.id == 'moisture_climate_off' %} Condizionatore spento per contenitore scarico acqua pieno. {% elif language == 'English' and trigger.id == 'window' %} Air conditioner turned off because the window was opened. {% elif language == 'English' and (trigger.id == 'climate_off' or trigger.id == 'presence_home')%} Automatic air conditioner shutdown. {% elif language == 'English' and trigger.id == 'moisture_climate_off' %} Air conditioner off for water drain container full. {% endif %}"
            }
          ]
        }
      ],
      "id": "1725315220436",
      "alias": "Automatic air conditioner for winter and summer, monitoring presence, window status, water level and time slot.",
      "description": ""
    },
    "blueprint_inputs": {
      "id": "1725315220436",
      "alias": "Automatic air conditioner for winter and summer, monitoring presence, window status, water level and time slot.",
      "description": "",
      "use_blueprint": {
        "path": "marco-hacs/automatic_air_conditioner.yaml",
        "input": {
          "language": "English",
          "climate": "climate.dnevna_soba_zg",
          "hvac_modes": "cool",
          "fan_modes": "high",
          "window": "binary_sensor.windows_ds_zg",
          "notify_device": "062bd6b57f1171063b012d7b94f0ddee",
          "set_temperature_climate": 18,
          "target_temperature_start": 24,
          "target_temperature_stop": 22,
          "season": "Summer",
          "start_time": "01:00:00",
          "stop_time": "23:00:00"
        }
      }
    },
    "context": {
      "id": "01J6VP149RC168QQAP6HCKSQK3",
      "parent_id": "01J6VP149QSHXSFMGF398PQCJT",
      "user_id": null
    }
  },
  "logbookEntries": [
    {
      "name": "Automatic air conditioner for winter and summer, monitoring presence, window status, water level and time slot.",
      "message": "triggered",
      "source": null,
      "entity_id": "automation.automatic_air_conditioner_for_winter_and_summer_monitoring_presence_window_status_water_level_and_time_slot",
      "context_id": "01J6VP149RC168QQAP6HCKSQK3",
      "when": 1725358444.8571854,
      "domain": "automation"
    }
  ]
}