Hi Home assistant forums
I am trying to develop a blueprint that will allow me to create automations for turning off the heat when an open window is detected and send me a notification that it is happening.
The open window functionality is working, but I wanted to include the area name in the notification, and I’m really struggling getting this working. I keep getting “None” for area name (if I get anything at all…)
Heres the blueprint:
blueprint:
name: Open window detection
description: Joachims version of turn off heating when open window is detected.
domain: automation
input:
thermostat:
name: Thermostat
description: Thermostat that will be used for the open window detection.
selector:
entity:
domain: binary_sensor
climate:
name: Climate
description: The climate entity to use for the automation. This is where the heating weill be turned off.
selector:
target:
entity:
domain: climate
description: ""
trigger:
- platform: state
entity_id: !input thermostat
to: "on"
for:
hours: 0
minutes: 0
seconds: 10
condition: []
action:
- service: climate.set_hvac_mode
data:
hvac_mode: "off"
target: !input climate
- service: notify.notify
data:
message: >-
{{ states('sensor.time') }} | Open window detected in {{ area_name('climate') }} turning off heating.
title: Open window detection
- wait_for_trigger:
- platform: state
entity_id: !input thermostat
to: "off"
for:
hours: 0
minutes: 0
seconds: 10
- service: climate.set_hvac_mod
data:
hvac_mode: "auto"
target: !input climate
mode: restart
I have tried to put many many different combinations in the message to get something out of it…
I have tried using the template tester to get a good result, but there must be something I’m doing wrong…
I will post some screenshots that I hope will help clarify further:
Thanks