Window open, climate off

I have too many zigbee devices to change the integration currently. But I followed the idea of @Arakon and send the command twice and now it works for me as well.

Hello,

Is it possible that when I have set the tado heater manually to 20 (not auto) before the window is openen, that it will set it back to the manual 20 mode when closed again.?

Let’s say I have a day working from home. But my auto program is set to 16 degree. So I set it manually to 20, but with this template it wil go back to 16 when I close the window?

Does this work with thermostats that do both heat and cool? Turning off is straightforward, but the you have to go back to the proper mode when turning back on.

May I please know the manufacturer and the model of your thermostats?

Sure. That’s theoretically no problem. The hvac_state has to be modified to the desired state (heat, manual) for your particular use case. But it cannot decide or know if there has been a manual change in temperature or not. Mixing two controllers is always a bad idea. In short: Just let Home Assistant do all the work!

I strongly advise you also to use Home Assistant to control your heating completely, including the schedules and some other features. You can e.g. include your (Google) calendar to Home Assistant so that the system knows whether there is a working day or not. You can also include holidays and real go deep into heating.

1 Like

Yes, Melcloud Climate - Home Assistant has been tested from one user. Turning back on, the device resumes the last state (cooling or heating).

What 1.) device are you using and 2.) what integration? What hvac_modes: does your device have and which one is the desired for a.) wintertime b.) and summer?

The problem is that I like the app from tado a lot more then the home assistant one for the heater. But tado can’t be combined with door/window sensors, alarms, etc …

So that’s why I use the combination. I also use the sleep mode, alarm mode, away mode etc. In home assistant to controll the Tado heater on combinations where tado it self is unable to do it.

It would be great that when a window opens, home assistant reads the mode, set temperature and time left set from the heater and writes it down in a helper with a template.
When the window closes itself and was not on auto mode, a template wil read this helpers and write them back tot the set heater.

The problem is that I’m not Hass expiriences to write this myself. But I think it should be possible. And great to see it added to your template .

1 Like

Yes, I understand you. This blueprint is a basic one and suites 90% of climate entity. Tado and Homematic are not implemented like the other climate entities and need to be handled separately.

I think you need to design an automation with conditions based on the diffrent states for

and some helpers. It’s too much for a blueprint. I cannot help because I do not have a Tado system. Sorry

Thank you for the Blueprint, works perfeclty with a single Sensor,
Is there a way to add multiple Sensors (So it only turns on again when all Sensors are closed?)

I tried it and the problem seems to be the Wait Template, it doesnt seenm to reference to the Frontend Input Sensors correctly

blueprint:
  name: Window open, climate off after a defined time
  description: An automation that turns off a running 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-Door sensor that controls the climate entity.
      selector:
        entity:
          domain: binary_sensor
          device_class: door
    window_entity_2:
      name: Window Sensor
      description: Another Window-Door 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
          mode: slider
          step: 1.0
    climate_target:
      name: Climate Device
      description: The climate entity that is controlled by the window sensor.
      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'
- platform: state
  entity_id: !input 'window_entity_2'
  to: 'on'
  for: !input 'minimum_open_time'
condition:
- condition: not
  conditions:
  - condition: state
    entity_id: !input 'climate_target'
    state: 'off'
action:
- service: climate.turn_off
  entity_id: !input 'climate_target'
- wait_template: "{{ is_state('!input window_entity', 'off') }}"
  continue_on_timeout: false
- wait_template: "{{ is_state('!input window_entity_2', 'off') }}"
  continue_on_timeout: false
- service: climate.turn_on
  entity_id: !input 'climate_target'

Tried different Iterations of the Wait Template, however i cant really find anything about using Input Sensors with Wait Templates,

Any Help is greatly appreciated!

Yes! You need to make a Template that groups several sensors to one. Please see this post:

1 Like

Oh totally didnt see that post, thank you so much, gonna try it right away!

I personnaly use Aqara sensors in Zigbee. Not expensive, long lasting battery and small size is perfect for me.
Use them via Home Assistant ZHA integration.

Can this blueprint be extended to not only turn off a climate device but also set a new target temperature?

My Eurotronic Spirit ZigBee TRVs are pretty dumb, they don’t react to turn off/set hvac mode to off commands and proceed to heat.

For this (in other automations) I have to use the ‘climate.set_temperature’ service (see below). Maybe this blueprint can add this as an option (allowing to set a) temporary off temperature like 7 degrees and b) turn back on temperature, where ideally b) could be stored from the state before lowering it so there would be no need for static values).

action:
  - service: climate.turn_off
    target:
      entity_id: climate.device
  - service: climate.set_hvac_mode
    target:
      entity_id: climate.device
    data:
      hvac_mode: 'off'
  - service: climate.set_temperature
    target:
      entity_id: climate.device
    data:
      temperature: 16

I am currently working on a modified version. I will update it soon so that this blueprint will use the set_hvac_mode

  1. Could you please share with us the hvac_modes of your climate entity (/developer-tools/state)?
  2. Tell us what happens to the set temperature if the mode changes from heating to off to heating again

Thanks

1 Like
  1. Full output (same for all Eurotronic Spirit ZigBee):
hvac_modes:
  - auto
  - heat
  - 'off'
min_temp: 7
max_temp: 32
current_temperature: 20.5
temperature: 20
offset: 0
valve: 38
locked: false
icon: phu:thermostat-v2
friendly_name: Thermostat XYZ
supported_features: 1
  1. Nothing - when being set via HA. That’s why I (need to) use the temperature as this is the only language this device is speaking.

Some worked around this behavior by adding another layer of complexity (e. g. GitHub - WolfRevo/climate.spzb0001_thermostat: A clone created from the Home Assistant generic_thermostat to use EUROTRONIC Zigbee SPZB0001 Thermostats with external temperature sensors). I‘m fine with the temperature being the only way to remotely control these devices - as long as all of my automations can set those :slight_smile:

When setting the heat mode physically/directly on the TRV („boost mode button“), HVAC jumps to heat and set temperature is set to 30 degrees. When disabling the boost mode, HVAC jumps back to auto - and set temperature back to the value set before (takes some time, up to two minutes for HA to be in sync with local screen again).

Here is the expected behavior for your thermostat I found in another thread here:
If a window opens, the thermostat turns off, once it closes, it turns back to heat, reverting to whatever temperature it was set to before turning it off.

Anyway, if it is not working, at the moment this blueprint cannot help you because variables cannot be set using blueprint. :disappointed:

But here is the updated version. You can give it a quick try :grinning:

blueprint:
  name: v3 Window open, climate off after a defined time
  description: It goes back to the previous set stage after the windows is closed 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: window
    window_entity_2:
      name: 2nd Window Sensor
      description: "Optional: The second window sensor that controls the climate entity."
      default: []
      selector:
        entity:
          domain: binary_sensor
          device_class: window
    window_entity_3:
      name: Any Binary Sensor
      description: "Optional: The third sensor that controls the climate entity."
      default: []
      selector:
        entity:
          domain: binary_sensor
          #device_class: window
    window_entity_4:
      name: Any Input Bolean
      description: "Optional: The 4th sensor that controls the climate entity."
      default: []
      selector:
        entity:
          domain: input_boolean
          #domain: binary_sensor
          #device_class: window
    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
          mode: slider
          step: 1.0
    climate_target:
      name: Climate Device
      description: The climate entity that is controlled by the window sensor.
      selector:
        entity:
          domain: climate
#  source_url:
trigger:
  - platform: state
    entity_id: !input "window_entity"
    to: "on"
    for: !input "minimum_open_time"
  #
  - platform: state
    entity_id: !input "window_entity_2"
    to: "on"
    for: !input "minimum_open_time"
  #
  - platform: state
    entity_id: !input "window_entity_3"
    to: "on"
    for: !input "minimum_open_time"
  #
  - platform: state
    entity_id: !input "window_entity_4"
    to: "on"
    for: !input "minimum_open_time"
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: !input "climate_target"
        state: "off"
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: !input "climate_target"
            state: cool
        sequence:
          - service: climate.turn_off
            target:
              entity_id: !input "climate_target"
          - wait_for_trigger:
              - platform: state
                entity_id: !input "window_entity"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_2"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_3"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_4"
                to: "off"
            continue_on_timeout: false
          - service: climate.set_hvac_mode
            target:
              entity_id: !input "climate_target"
            data:
              hvac_mode: cool
      #
      - conditions:
          - condition: state
            entity_id: !input "climate_target"
            state: heat_cool
        sequence:
          - service: climate.turn_off
            target:
              entity_id: !input "climate_target"
          - wait_for_trigger:
              - platform: state
                entity_id: !input "window_entity"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_2"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_3"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_4"
                to: "off"
            continue_on_timeout: false
          - service: climate.set_hvac_mode
            target:
              entity_id: !input "climate_target"
            data:
              hvac_mode: heat_cool
      #
      - conditions:
          - condition: state
            entity_id: !input "climate_target"
            state: heat
        sequence:
          - service: climate.turn_off
            target:
              entity_id: !input "climate_target"
          - wait_for_trigger:
              - platform: state
                entity_id: !input "window_entity"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_2"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_3"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_4"
                to: "off"
            continue_on_timeout: false
          - service: climate.set_hvac_mode
            data:
              hvac_mode: heat
            target:
              entity_id: !input "climate_target"
      # auto
      - conditions:
          - condition: state
            entity_id: !input "climate_target"
            state: automatic
        sequence:
          - service: climate.turn_off
            target:
              entity_id: !input "climate_target"
          - wait_for_trigger:
              - platform: state
                entity_id: !input "window_entity"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_2"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_3"
                to: "off"
              - platform: state
                entity_id: !input "window_entity_4"
                to: "off"
            continue_on_timeout: false
          - service: climate.set_hvac_mode
            data:
              hvac_mode: automatic
            target:
              entity_id: !input "climate_target"

My TRVs offer the hvac_modes: heat, auto, off.

Is it possible to have this automation return to auto if it was set to it before? Right now the TRVs all return to heat, which means the valve opens 100% - even it the measured room temperature did not change. This wastes energy.

Sure! I just published the modified version based on HAVC modes. :partying_face:
Please share with us the information about your TRV device (vendor and model). A link would be nice.

Happy automating!

Thank you for the quick fix, I will check it out.

Model info of my TRV
Model: TS0601
Maker: _TZE200_cwnjrr72
Recognized as: TS0601_thermostat
Product link: Tuya Smart ZigBee Radiator Actuator TRV Programmable Thermostatic Radiator Valve Temperature Controller Support Alexa|Building Automation| - AliExpress

Great, thanks for the information! What Zigbee Adon / Integration are you using - Zigbee2Mqtt, ZHA or Phoscon/Deconz? Please let us know if it is working.