I’m trying to create a blueprint that will respond to a window open event by calling a service to notify the associated heating zone. This will cause the thermostat set temperature to be reduced while the window remains open. The blueprint just asks for the window sensor and the target climate device. I’m then using a template to capture the device id from the thermostat in a variable (climate_id) which is passed to the service call:
input:
window_entity:
name: Window Sensor
description: The window sensor that controls the climate entity.
selector:
entity:
domain: binary_sensor
device_class: window
climate_entity:
name: Climate Device
description: The climate entity that is controlled by the window sensor.
selector:
entity:
domain: climate
source_url: https://gist.github.com/sotatech/500b53ee64ca5ad5299c22cde47407ed#file-window-open-notify-homematic-yaml
variables:
climate_target: !input climate_entity
climate_id: '{{ state_attr( climate_target, "id") }}'
trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'on'
action:
- service: homematic.set_device_value
data_template:
address: climate_id
channel: 1
param: 'WINDOW_STATE'
value: 1
- wait_for_trigger:
- platform: state
entity_id: !input 'window_entity'
to: 'off'
continue_on_timeout: false
- service: homematic.set_device_value
data_template:
address: climate_id
channel: 1
param: 'WINDOW_STATE'
value: 0
The template works when I test it, but when I create an automation with the blueprint, the logs just show “CLIMATE_ID not found!”
Any ideas how to debug this, or can anyone spot whatever glaring errors I have made?
Thanks!