Thanks, Iām glad that the blueprint is helping you! What you are trying to achieve is not possible and neither do I intent to add a custom trigger. Itās not that I donāt want to, but put simple the design of the blueprint wonāt allow me to add such a feature.
Awesome blueprint, thx a lot!
For Android users it could be helpful to add an option to add the following two fields to the data object:
ttl: 0
priority: high
That will make the notifications appear immediately.
See documentation:
I use it for all my notifications and itās a day and night difference in delivery speed.
Hi @Malte
thank you very much for this great blueprint.
Got a question if the following scenario is already supported (and how this can be achieved) or the blueprint may be enhanced to support it.
What I want to achieve is the following:
-
when a window is opened and the outside temperature is below, say, 20 degree Celcius, I want get a notification.
-
however, when a window is opened and the outside temperature is above, say, 20 degree celcius, I donāt want a notification yet.
However if the outside temperature is dropping, the window is still open (so no new trigger), below that temperature I want to get (repeating) notification(s).
Thanks in advance.
Thanks @wfrey! Iām glad that you like it.
Sorry but currently the automation does not trigger when the custom condition changes. Thus this is neither possible currently nor do I intend to add this as a feature because this would add a lot of overhead. Hope you can understand!
Sorry for the late reply. Iāll add that to my todo list.
Hello,
Thanks for the blueprint itās a big help. I am new to home assistant so it possible I am not using the blueprint correctly but I canāt get exactly the use I am looking for. I want to check if a window is open late in the day i.e. in the evening before going to bed. The window may have been open all day. I have tried to use and additional time trigger with setting a range of optional times but I have noticed if the window is open before this time the automation doesnāt trigger. Am I doing something incorrectly ?
hi @Malte
thanks for your Blueprint. Somehow it does not work as I expected.
I have combined all my windows in a binary sensor (binary_sensor.window). I have entered this in your blueprint under Entity.
When I open window 1, I get a message from the window. If I also open a second window (which is in the sensor group), I do not receive a new message about the open second window after the timer has expired.
Even if the first window is closed and the second window is still open, I do not receive a message about the second window.
Have I configured your Blueprint incorrectly? I thought that every single window is monitored in the binary_sensor.window.
You are not doing anything incorrectly but your use-case is not what this blueprint is intended for. You could just write your own small automation and straight up use the window sensors value for that as it represents the current state. I hope a understood your requirement.
I understand what you are trying to achieve. This is not possible. The behavior you are describing is expected. The notification does only trigger once if you havenāt set the repeat option and specified a time. With the repeat option turned on and the friendly name left empty you will get an enumeration of all sensors within that binary_sensor
group that are in the issue state. Hope that this helps.
If you still want exactly your behavior you will have to create an individual automation for every sensor.
Hi Malte,
thanks for the blueprint I use it with several sensors.
But I am to stupid to do one automation.
Garagedoor should give an Alarm when it is open above 15 min but just after sunset before sunrise because during the day it is OK.
When I open my door before or after Sunrise/Sunset the automation works well but when I forgot to close my door during the day in donāt get a message after sunset that the door is still open (because it is over 15 mins open). Any suggestions how I can set the time from 15 min to 15+ mins?
I hope that you got what I like to say.
Thanks for your help.
Mathias
Iām wondering why the notifier always shows the time of the first message and not the time of the event that fires the notify the first time. The message says some ādoor-open-timeā, but if I use a wait time the value is incorrect.
I tried to fix it with
{{ as_timestamp(initially_triggered_at - timedelta(minutes=10)) | timestamp_custom('%T', True) }}
in the notification message inside the frontend. It saves without problems, but I dont get a notification on the companion app, even though the trigger said its fired. Any suggestions?
Seems that somebody is interested in the idea. I realised it by tweaking the blueprint at line 254 by changing the variable āinitially_triggered_atā:
initially_triggered_at: "{{ now() - timedelta(minutes=10) }}"
Sadly this only works if all delays of your corresponding automations are e.g. 10 min.
But Iāve got one other question:
I would love to use a dynamic delay for the notification. Reason: it makes sense to adjust the opening duration for the windows depending on the outside temperature. So I set up a helper āsensor.dauer_luftenā which has the outputs: 5, 10 or 15 depending on the temperature. But Iām just not able to include this information into the blueprint.
I tried changing the !input variable āduration_issue_stateā in lines 223 and 241 to "{{ states('sensor.dauer_luften') }}"
. But I realised, that āforā needs something like
minutes: 10
seconds: 5
So I put the variables back where they were and tried to change the selector in the gui to ātemplateā, but the notification wonāt fire. I tried
but realised that YAML this gives
Are the quotation marks the problem? Iām running out of ideasā¦
Hey there, I currently do not have the time to check how to do this myself but from my quick research of the official documentation what you are trying to achieve seems pretty doable:
- About your definition of
initially_triggered_at
. You could just use the value of the variableduration_issue_state
in thetimedelta
object to make that dynamic. - About your sensor value not being in the correct format (that seems to be the problem): maybe these two links can help you:
- Templating - Home Assistant probably what you need are convert functions like
as_datetime
- Time calculations with input_datetime and timedelta (I know itās
input_datetime
but maybe there still is some useful information)
- Templating - Home Assistant probably what you need are convert functions like
If you are not already using the template option of the developer tools Iād highly suggest them for your testing.
@Malte This script is awesome! Exactly what I was looking for to announce a door is left open.
How can I combine custom actions to play on multiple echos more elegantly? I tried a comma, but got an error.
alias: Door Left Open 240916 v1
description: ""
use_blueprint:
path: Raukze/contact-sensor-left-open-notification.yaml
input:
trigger_entity: binary_sensor.doors
duration_issue_state:
hours: 0
minutes: 0
seconds: 10
days: 0
notify_services_string: notify.mobile_app_sw_s23
custom_action_issue_state:
- action: notify.alexa_media_wylie_s_echo_show
metadata: {}
data:
message: >-
door {{friendly_name}} is open at {{
as_timestamp(initially_triggered_at) | timestamp_custom('%T', True)
}}.
- action: notify.alexa_media_everywhere
metadata: {}
data:
message: >-
door {{friendly_name}} is open at {{
as_timestamp(initially_triggered_at) | timestamp_custom('%T', True)
}}.
- action: notify.alexa_media_echo_master_bed
metadata: {}
data: {}
message: >-
door {{friendly_name}} is open at {{
as_timestamp(initially_triggered_at) | timestamp_custom('%T', True)
}}.
- action: notify.alexa_media_library_fire_tv
metadata: {}
data: {}
message: >-
door {{friendly_name}} is open at {{
as_timestamp(initially_triggered_at) | timestamp_custom('%T', True)
}}.
notification_click_url: /lovelace-doors/0
Is there a recommended path or modification to allow for a quick dismiss to temporarily disable the alert from the notification on iOS? e.g. Itās alerting me the garage is open, but I know I need it open for the next x amount of time, so I suspend the repeat for a period of time?
No, sadly this is not something that can be easily added with the current blueprint implementation.
Hello Malte, thank you for your very useful blueprint. I use it to prevent open windows at low outside temperatures in some rooms. This works almost perfect for me. I only have two open points that I canĀ“t figure out as I am a HA beginner:
-
I want to be informed about the minutes since the window was opened instead of the time. The message should be like āWindow is open since 15 Minutesā. I found the info that the following should work:
{{ (as_timestamp(now()) - as_timestamp(as_datetime(initially_triggered_at, default))) | timestamp_custom(ā%Mā, false) }}
But there is an error message that I canĀ“t deal with. -
The second question is related to the click-url. I donĀ“t want to use this feature so I put noAction into this field. But nevertheless when pressing on the message IĀ“m pushed to the overview of all rooms. How can I disable this feature?
Regards
Thomas
Hi, I often get this warning message in the logs, but everything seems to be working properly. Get a message when a window is opened.
Logger: homeassistant.helpers.template
Quelle: helpers/template.py:2742
Erstmals aufgetreten: 15:08:44 (2 Vorkommnisse)
Zuletzt protokolliert: 15:59:34
Template variable warning: āfriendly_nameā is undefined when rendering āDas{{ friendly_name }} ist noch offenā
Hello Malte, thanks for this useful blueprint. I tried to use it creating the first automation in my HA.
Unfortunately it throws the error message āTemplate rendered invalid service: notify.mobile_app_SM-A725Fā. It tried it with my second mobile too but got the same error.
Any ideas what the reason can be?
Regards
Hartmut