Notifications to close an open door or window after a set number of minutes

The Blueprint doesnt work for me either, nothing happens even if I try to trigger it manually from the Automation. The log gives an error with the Trigger:

Logger: homeassistant.components.automation.test_notification_to_close_a_window
Source: components/automation/init.py:416
Integration: Automation (documentation, issues)
First occurred: 10:36:19 AM (1 occurrences)
Last logged: 10:36:19 AM

Error while executing automation automation.test_notification_to_close_a_window: Error rendering message: UndefinedError: ‘trigger’ is undefined

What do you mean? You need to provide the variables.

nice Blueprint!!!
is it possible to push a service instead of notifications? i want to send a tts to my Alexa and not to my phones.
also a rain sensor to add would be nice

Ofcourse you arr right - my bad, I cant test the automation manually as it is then missing its parameters!

The error was simple, I hade mis-spelled my weather-entity when I modified the blueprint.

Would it be possible to have it trigger on multiple entities? Rather than having an automation per entity.

3 Likes

Probably needs to be implemented by HA first, but having target triggers would be nice.

1 Like

How would I adapt this to replace temperature with time range?

  • condition: time
    after: ‘22:00’
    before: 07:00
1 Like

@roozbeh : Sorry for the maybe stupid question but how to import this blueprint to my Home Assistant? I see an “Import Blueprint button” on other Blueprints. Without the button I am somehow lost. Maybe someone can help. THX
Phillip

@phillipthaler there is a link to github in the author’s post, pointing to a yaml file. In home assistant you click “Import Blueprint” button (in blueprints, right down) and paste the link to the yaml file.

Thanks a lot for the hint. Worked smooth

In yaml-mode you can set up an automation like:

automation:
  trigger:
    - platform: numeric_state
      entity_id:
        - sensor.temperature_1
        - sensor.temperature_2

And in the HA-GUI automation setup you can have several trigger entities. So why not in a blueprint?

Would love to see this as well. My use case is after XX:XX time, remind me that is still open. In my case would be a garage door tilt sensor.

Any suggestions on this error? when i run the automation

Error: Error rendering message: UndefinedError: ‘dict object’ has no attribute ‘to_state’

in the step config is shows this

device_id: ab99d187465472f74f75608935b9657d
domain: mobile_app
type: notify
message: Time to close {{trigger.to_state.attributes.friendly_name}}.
title: Close {{trigger.to_state.attributes.friendly_name}}!

I have made a extended version of your version with custom sensor.

It sends three notifications to an Amazon Echo device to close a window or door after opening it, if the humidity reading (indoor) and temperature reading (outdoor) of the given sensors are below a certain level. For this blueprint you need a a working Alexa Media Player Integration, and a humidity sensor that updates its data in short intervalls. Most likely it needs a wired power connection for this. A working configuration is the SONOFF TH Sensor Si7021 connected to a Sonoff TH10.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Updates:
04.01.2022: You now can now adjust the volume of the message and the volume used by the Echo device afterwards.

1 Like

The versions with custom temperature sensor (the original one as well as mine above) aren’t working for me since last week. I found out, that the blueprint only works as long as the temperature is not below 0° Celsius. Does anybody know how to change the script to work with temperatures values like “-3” too?

I have to correct myself. Everything works again although the temperatures are still below 0° Celsius. Maybe my testing with different thermostats somehow solved the problem.

I don’t know why but the script suddenly is working again, although the temperatures are still below 0° Celsius.

Hi, I am using this blueprint for a while already, and it works perfect. Thank you.
Instead of having this send to a mobile app i would like to have it send to a telegram bot.
Would this be possible to do?

Thx för your work, will tty IT later

Hi niwi,

very nice job your version . :+1:

Is it possible to have a version with severals choices (media players ) ?

for exemple :

thx

Minos

Hi Minos,

technically it wouldn’t be a much work to change the audio output from echo to another solution. Since I only have echo speakers I don’t want to do this myself. If you want to give it a try yourself, you can find the code here: hass-blueprints/Echo-Notification to Close a Window with custom sensors at be81ae9cf3672146cb1c97b250ec380da313102d · niwi-hh/hass-blueprints · GitHub

Mostly you would have to search for all lines with “alexa” or “echo” and change it according to your hardware.

Cheers

Hi,
is it possible to set the device selector (device_identifier) to “multiple: true”?
I’ve tried this in blueprint, but I don’t know how to modity the action script to work with a list of Devices (I’m a HASS beginner :innocent:)
Has anybody already tried it?

1 Like