Window open, climate off

Yes, that is a good idea! I’ve just updated the blueprint. Is the time range of 120 seconds enough?

1 Like

Just perfect! Thanks!

1 Like

Fritz Dect open window detection is a nice source for inspiration: open window based on temperature drop.
Fritz!dect open window
There are also suggestions of settings.

@SmartLiving.Rocks perhaps one final request: It would be really cool if we could send a message to a phone running the home assistant app:

{room} (or {climate} window was open. Killing heating
and on close:
{room} (or {climate} window closed. Restoring heating

Sorry, I am not convinced, and I highly doubt the efficiency as well as the stability of the automation. The failure rate is way too high (see also diverse AVM User/Experience groups/forums). Sorry, I am not the right guy for your requirement. Maybe you can develop a blueprint with these guys: Use rapid temperature delta to trigger automation? Thanks!

1 Like

Notifications, alerts and other information is a complete different chapter in the Book of Home Automation! I see the need as I have TTS saying over my media player entity during daytime: “I have switched off the heater. The temperature is yx and the humidity is zx.” You have to set an input boolean helper to set notification ON/OFF as well as input sliders to define a time range. Then you use it also for other things like the “Garage/Entrance/ door is still open!”, “Person xy at the Entrance”, “Unknown car detected at the driveway!” etc. The notification is also able to select a device to send the Notification to (Media Player, Smartphone, TV, Telegram, E-Mail, LeMetric) based on different conditions (time, location, TV-on, sleepmode-on etc.)
For this basic automation it is too much.

1 Like

Hello,
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'
1 Like

Hi, I do not get your point at the moment. Is it some “Melcloud” specific behavior, and it is working for you now?
Do I have to choose the same climate (device) in your modified version of the blueprint?
Bildschirmfoto 2021-03-24 um 08.08.28
Why are you not using the “!input climate_target” as it is literally the same climate device as condition-target?
What is meant by “I unit” - what is the difference between the normal “state” of a climate device versus the state of a “melcloud” climate entity?

Why have you changed the device class to door instead of window?

Thanks in advance for your answers!

1 Like

Hello :slight_smile:

Ahh, yes, about the device Class. For me to find the Z-wave Window and Door Sensor I had to change that device Class. Or I would not find it. I could also leave it in blank and it would show me all entities. I can change it back to yours or to all entities if you wish. But i am sure you can do it as well, since you created this one.

About the MELCLOUD, this is only for the Condition Part. I am still new to this, so this was the best way I could find for my CONDITION to work. As explained before, your Automation for me didnt work, because here in Portugal we dont need Climate always on, because we have times of the year that the temperature is just right, so if if the AC unit was off at the moment that I would open the Window , once I would close the window, it would start the climate, and we dont want that.
So for me to be able to use your automation and only triger if the actual climate unit was ON, I had to create a condition that would say, only trigger if you see these states
state:

  • ‘heat’
  • ‘dry’
  • ‘cool’
  • ‘fan_only’
  • ‘heat_cool’
    These are all the states that my Climate unit works with. I stated this because maybe your units have other diferent states.
    So if the state of the Climate unit was OFF, then the automation would not start.
    For this contition to work, yes you must use the same unit. because thats the unit that you want to control or not.
    the condition sees if the targeted unit is on or not.

Does this make any sense?

Hi! Yes, now it makes perfectly sense! The automation/blueprint should only run if the climate device is running. I have added a condition that checks if the entity is not off (so any climate state is accepted)! Check “condition” documentation here. That feature should have been included right from the beginning. Thank you for giving me the hint for the real life corner case! I was travelling to Spain (Andalucia) for the last 7 years and a lot of people have this kind of climate device! Greetings to Portugal and the sea!!!

p.s.: If you change the device class of your door/window sensor to window it shows up in the blueprint

2 Likes

Good Day,
first of all thanks for all the work done so far, really appreciate it!!
I am trying to use this Blueprint with my Homematic Door/Window Sensor and it does not work. What information can I provide for debugging?
First notice I can not select the sensor from the list I have to enter it manual.

Check the device class in the developer tools. The device class is limited to window only. You can change it by following these instructions.

@duesseldorferjung Here you find the German version as well as a version for a blueprint that accepts all kinds of binary-sensors. You can manually import the Github URL to your Blueprints.

@Soccs and all the others who have problems with the device class window you can find here the blueprint that accepts all kinds of Home Assistants binary sensors.

2 Likes

or if you want to cheat it… :slight_smile:

selector:
entity:
domain: binary_sensor
device_class: door

remove the line that says domain and device_ class From your blueprint

Thanks for the quick response.
I did take the blueprint with the binary sensor and for some reason it does not trigger. Any ideas what to check? I can see that the sensor is reacting.

Have you waited until the set delay time is reached? Set it to 0 if you want to see direct results!

1 Like

Have you reloaded the automations or restarted home assistant ?

All answers are yes.

Hi,
Thanks for sharing this blueprint with us.
It did not work initially for me.
After some investigation, I made it work by replacing the condition attribute hvac_action by hvac_modes into the blueprint.
None of my climate entities have hvac_action as attribute.
I have not checked whether it screws the pinciple of the condition completely yet.
Hope it helps

Interesting - Thank you for sharing your experience! What climate entity are you using?
@duesseldorferjung Maybe that is the same problem with your device

1 Like

I am not sure what kind of answer you expect.
I have Eurotronic Spirit Zwave using Zwave2MQTT (integrated in Zwave JS directly, not using MQTT)

here is the full state:

hvac_modes:
  - 'off'
  - heat
min_temp: 7
max_temp: 35
preset_modes:
  - none
  - Energy heat
  - Full power
current_temperature: 18.8
temperature: null
preset_mode: none
friendly_name: 'Radiateur_Salle_de_bain: Thermostat mode'
supported_features: 17

After a quick test, I can confirm that the condition is skipped though.
If I manually set my TRV to off, then open the window, wait a bit and close it up; the TRV goes back to heating