Window open, climate off

Hi - thanks. I am not sure if this is supported at the moment. An blueprint example eg. several motion detectors trigger a light would be helpful. I will put it on the list of further improvements.

I haven’t tried it, but I think you just need to add target: like this;

      name: Window Sensor
      description: The window sensor that controls the climate entity.
            domain: binary_sensor
            device_class: window

No. I have tried it before answering you. :nerd_face: You are able to select different window sensors but they do not create a working automation. It has to do with the “or” in the trigger area. I had a look at the several motion based light blueprints but all of them only work with only one sensor (at the moment).

Since the pir motion sensors I have are somewhat unreliable I ended up using two of them per device and build a template binary sensor around so that they only trigger as soon as both per device detected motion. I did that in esphome instead of HA but this would solve the issue for you if You use OR instead of AND. so any detected motion from any sensor would switch the binary sensor to ON. Not sure if that works in blueprints…

Thanks for the small overview of the sensors you’re using ^^


Cool blueprint! :slight_smile:

For my case i have to change the line and remove the device class:

domain: binary_sensor
device_class: window

My sensors are not registered as window sensors. Is there any possibility to do the “wait for trigger” for two sensors? I have a room where are two windows and one heater.

Thanks! The sensors device class has to be specified correctly otherwise the blueprint does not find matching entitys. Your workaround shows all sensors - what in a lot of cases can become overwhelming.

As @Blade1337 reccomended you can use a “Template Binary Sensor” in order to make a (window) sensor group. Here you can also define a “device_class” so that my blueprint will recognize it as a window sensor.
You can put as many sensors as you want - the following example consists of two sensors.

  - platform: template
        friendly_name: Window Sensor with several Sensors
        value_template: >-
          {{ is_state('binary_sensor.training_fenster_936', 'on')
             or is_state('binary_sensor.training_philio_4_1_window_940', 'on')
        device_class: window 

Unfortunately it is not yet possible to do it directly in the Blueprint.

1 Like

Nice topic! I am looking for a blueprint using a temperature drop for detection of an open window. Then a window sensor is not needed. A rapid measured temperature drop of the thermostat or valve (Adam Plugwise) could be used to switch off the heating for 15-20 minutes.
Who can write such a blueprint? Thanks, Dirk.

please define “A rapid measured temperature drop” in time and delta temperature. Please take in consideration that there are different environmental conditions during summer, winter as well as spring and autumn that will have an effect on the delta temperature.
Furthermore, I would like to know what happens after the 15-20 min countdown if the blueprint has been triggered and the window/door is still open?

This is great! It would be great if we could define the time it should be open before the heating is killed. For example, if I open my window for just a second, it shouldn’t kill the heating.

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

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!

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.

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.

  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
      name: Window Sensor
      description: The window sensor that controls the climate entity.
          domain: binary_sensor
          device_class: door
      name: Miniumum time the window is open
      description: Time in seconds to wait until the automation is triggered
      default: 12
          min: 0.0
          max: 120.0
          unit_of_measurement: seconds
          step: 1.0
          mode: slider
      name: Climate Device
      description: The climate entity that is controlled by the window sensor.
          domain: climate
      name: Climate Device
      description: I Unit has a State by melcloud operate.
          domain: climate
- platform: state
  entity_id: !input 'window_entity'
  to: 'on'
  for: !input 'minimum_open_time'
- condition: state
  entity_id: !input 'condition_target'
  - 'heat'
  - 'dry'
  - 'cool'
  - 'fan_only'
  - 'heat_cool'
- 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!

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

  • ‘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

1 Like

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.