I grab your Creation and implemented a Condition. the condition is that if the Climate unit is actually turned off, this automation will not start the climate.
In this particular case for MELCLOUD systems. This is important because each climate unit has its own state names. if you want to find out about yours just go to DEveloper Tools and write the name of the entity. this will show you the state atributes.
blueprint: name: Window open, climate off after a defined time4 description: An automation that turns off your climate device for exmple a heater or an air conditioning if a window sensor is open for a specific time. It waits until the window is closed again in order to turn the climate entity on again. domain: automation input: window_entity: name: Window Sensor description: The window sensor that controls the climate entity. selector: entity: domain: binary_sensor device_class: door minimum_open_time: name: Miniumum time the window is open description: Time in seconds to wait until the automation is triggered default: 12 selector: number: min: 0.0 max: 120.0 unit_of_measurement: seconds step: 1.0 mode: slider climate_target: name: Climate Device description: The climate entity that is controlled by the window sensor. selector: entity: domain: climate condition_target: name: Climate Device description: I Unit has a State by melcloud operate. selector: entity: domain: climate source_url: https://community.home-assistant.io/t/window-open-climate-off/257293 trigger: - platform: state entity_id: !input 'window_entity' to: 'on' for: !input 'minimum_open_time' condition: - condition: state entity_id: !input 'condition_target' state: - 'heat' - 'dry' - 'cool' - 'fan_only' - 'heat_cool' action: - service: climate.turn_off entity_id: !input 'climate_target' - wait_for_trigger: - platform: state entity_id: !input 'window_entity' to: 'off' continue_on_timeout: false - service: climate.turn_on entity_id: !input 'climate_target'