Skip to content

Instantly share code, notes, and snippets.

@smoki3
Last active January 8, 2024 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smoki3/9e38e03d6ae180326ab1c80282ec6d78 to your computer and use it in GitHub Desktop.
Save smoki3/9e38e03d6ae180326ab1c80282ec6d78 to your computer and use it in GitHub Desktop.
blueprint:
name: Window Open, Notify HomeMatic IP Local CCU
description:
An automation blueprint that reduces the set temperature of your climate
device or group if a window sensor is open for more than the preset wait time.
It uses the Homematic window sensor channel to set the temperature to the "Open-window
temperature" set in the device configuration. You should set the "Mode for temperature
fall detection" to Inactive to avoid conflicts. It waits until the window is closed
again in order to restore the climate entity temperature after 5 seconds. It has an optional blocking
entity to prevent the automation running unnecessarily, for example during the
Summer season.
domain: automation
input:
window_entity:
name: Window Sensor
description: The window sensor that will control the climate entity.
selector:
entity:
domain: binary_sensor
multiple: false
open_delay:
name: Windows Open Wait Time
description: Time to delay after window opens before notifying HomeMatic.
default: 30
selector:
number:
min: 0.0
max: 600.0
unit_of_measurement: seconds
mode: slider
step: 1.0
close_delay:
name: Windows Close Wait Time
description: Time to delay after window closed before notifying HomeMatic.
default: 5
selector:
number:
min: 0.0
max: 600.0
unit_of_measurement: seconds
mode: slider
step: 1.0
blocking_entity:
name: (OPTIONAL) Blocking Entity
description:
If this entity's state is off, it will prevent the automation from
running. E.g. summer mode or away mode.
default:
selector:
entity:
domain: input_boolean
multiple: false
climate_entity:
name: Climate Device
description: The climate entity that is controlled by the window sensor.
selector:
entity:
domain: climate
multiple: false
source_url: https://gist.github.com/smoki3/9e38e03d6ae180326ab1c80282ec6d78
variables:
blocking_entity: !input blocking_entity
climate_target: !input climate_entity
climate_id: "{{ device_id(climate_target) }}"
open_delay: !input open_delay
close_delay: !input close_delay
trigger:
- platform: state
entity_id: !input window_entity
to: "on"
for: !input open_delay
condition:
- condition: template
value_template:
"{{ (blocking_entity == none) or (states[blocking_entity].state
== 'on') }}"
action:
- service: homematicip_local.set_device_value
data:
device_id: "{{ climate_id }}"
channel: 1
parameter: WINDOW_STATE
value: "1"
value_type: int
- wait_for_trigger:
- platform: state
entity_id: !input window_entity
to: "off"
for: !input close_delay
continue_on_timeout: false
- service: homematicip_local.set_device_value
data:
device_id: "{{ climate_id }}"
channel: 1
parameter: WINDOW_STATE
value: "0"
value_type: int
mode: restart
max_exceeded: silent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment