Hi Hartmut, I feel like the service name is incorrect. Iâve never seen a service name containing a dash. Could you verify this?
Hi Malte, thank you for your hint. Replacing dash by underscore solved the issue.
I wasnât thinking about the service name due to the system tooks the device name automatically. Really good to know that!
Thank you
Hartmut
Iâd like to second this! Having channels for the notification is vital to make sure I am aware of them. Being able to eben set them to critical would even improve this!
P.S.: Great blueprint, thanks!
Hi!
Thank you very much for this blueprint, itâs very useful for my purposes Iâm just starting out with HA and maybe Iâm making another rookie mistake here:
I want to add a possibility to disable the notification globally. For this I have created a switch as an entity. I also want no notifications to be sent at temperatures above 16 degrees. It looks like this:
I now have the following behaviour:
- Temperature is below the threshold value
- Notifications are not switched off
The notifications are coming as desired.
If I now flip the switch in the entity for the switch to switch off the notifications, the notifications are still displayed. Am I making a mistake here?
I have combined the conditions with an AND, because they are actually mutually dependent.
Edit: What else I have noticed: If I have already flipped the switch for the notifications, the notifications remain muted. Could it be that the conditions are only checked once when the blueprint is called up and then no longer?
Just turn the automation on/off if you want to disable it
Thatâs not what I want. Normally, we should be told to close a window. But sometimes the temperature feels warmer than it is measured. In this case, I would simply like to have the option of temporarily switching off the notification via a switch until the windows have all been closed.
This means that if all the windows are closed and then opened again, the mechanism for the announcements takes effect as normal.
Switching off the automation would only affect the automation for one sensor in this case.
Hi Malte, I am having the same issue here - with repeat option activated.
I have several window contacts in a binary sensor group, but the notification message will list only the first one opened regardless of further windows being opened.
I would llike to get a notification like
âOpen Windows
Kitchen since 11.45
Bathroom since 11.50â
Obviously the preconfigured message template wonât achieve that as it is prepared for a single sensor only.
If not feasible I might go with dedicated automations per window.
Still saving efforts
After some more testing I need to correct: the message is containing all open windows, but only one timestamp (of first one opened) is included.
Since you are using the repeat time for any refresh, this conflicts with my intention to receive only rare notifications (when I really should act).
Here is a scenario so you might understand my point:
If I configure repeat time long term (5 min) I would walk to bathroom window, then back in living room learn that I should have closed also kitchen window.
Hi, it is possible to add {{ duration }} in the message?
Something like
The {{ friendly_name }} was left open at {{ as_timestamp(initially_triggered_at) | timestamp_custom(â%Tâ, True) }} for {{ duration }}
Thanks
Hey there, first of all thank you very much for this blueprint! I really appreciated it.
I get the following warning in the protocol, when a notification is sent:
Logger: homeassistant.helpers.template
Quelle: helpers/template.py:2758
Erstmals aufgetreten: 17:37:05 (3 Vorkommnisse)
Zuletzt protokolliert: 19:20:55
Template variable warning: 'friendly_name' is undefined when rendering 'Das {{ friendly_name }} wurde offen gelassen'
I already tried to set the âCustom Device Friendly Nameâ with Fenster Bad (OG)
, but that didnât help.
Side question, how can I find out, which automation is responsible for an error? I mean, if I would have several automations and such.
I got the same error. No notification was sent.
I have the same problem
Logger: homeassistant.helpers.template
Quelle: helpers/template.py:2758
Erstmals aufgetreten: 17:08:34 (11 Vorkommnisse)
Zuletzt protokolliert: 21:03:38
* Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.light.am_deckenleuchte_light_2_deckenleuchte_light.attributes.rgb_color == (255, 9, 0) }}'
* Template variable warning: 'friendly_name' is undefined when rendering 'Das {{ friendly_name }} ist offen'
type or paste code here
I think at 21:03 it was this sensor âEsszimmerâ:
I have noticed that the sensor has very poor reception and occasionally goes to unknown. This could explain why it canât read the friendly_name. What I donât understand, however, is why the Blueprint routine doesnât simply go to the Custom Device Friendly Name
. I wish the Blueprint could handle weak devices better. The window sensor disappears from time to time due to poor reception.
In the long run I will want to improve it, but that is the current situation.
At least it always shows the RIGHT thing, even if it disappears from time to time. Maybe you could go to the Last known value?
I am also running into the âfrom issue stateâ problem. With the current implementation, it seems to be pretty useless, because it fires way too often.
What about executing this part when the current time is > than initially_triggered_at + Time before alert?
Hi @Malte great work on this and thank you!
Question:
Does anyone have idiot proof steps on how to make this notification actionable?
I have actionable notifications already but those steps dont work for this blueprint.
I just want to add the button.contact_sensor_gate_sensor_status
to the automation.
Thanks for any help!
Hi,
I really like this blueprint!
I also faced the issue that I wanted to include the time when the sensor was opened instead of the time when the notfication was triggered the first time. I think I managed to find a solution and want to share so others can also benefit from it.
Directly using the duration_issue_state
parameter does not work for calculations as it is a JSON/string. However, we can access itâs properties and use them as input for a timedelta
:
timedelta(days=duration_issue_state.days, hours=duration_issue_state.hours, minutes=duration_issue_state.minutes, seconds=duration_issue_state.seconds)
We can use this value then for calculations and subtract it from now()
:
now() - timedelta(days=duration_issue_state.days, hours=duration_issue_state.hours, minutes=duration_issue_state.minutes, seconds=duration_issue_state.seconds)
This would be the value which could be used for a variable which could then be used in the current default template in the same way as initially_triggered_at
(evaluated once and never updated). If you want to modify the template yourself, you could adjust initially triggered at accordingly or add a second variable here.
initially_triggered_at: '{{ now() }}'
trigger_entity_status_change_at: '{{ now() - timedelta(days=duration_issue_state.days, hours=duration_issue_state.hours, minutes=duration_issue_state.minutes, seconds=duration_issue_state.seconds) }}'
If we use the calculation in the dynamic text, we will face the situation, that it will update itâs value with every repeat. Therefore, we must replace the dynamic now()
part with a static part based on initially_triggered_at
. As initially_triggered_at
is a string, we must first convert it to an object we can work with:
as_datetime(as_timestamp(initially_triggered_at))
The final template could then look like this:
{{ friendly_name }} was opened at {{ as_timestamp(as_datetime(as_timestamp(initially_triggered_at)) - timedelta(days=duration_issue_state.days, hours=duration_issue_state.hours, minutes=duration_issue_state.minutes, seconds=duration_issue_state.seconds)) | timestamp_custom('%T', True) }} and is still open. Please close it.
As this is a really âuglyâ string which is hard to read, I would appreciate if @Malte could provide the value as variable in a future update of the blueprint.
Best regards,
Tobias
Edit: I also see the âfriendly name unknownâ warning appearing in the log and it definitively is unrelated to unavailability as I used a boolean input helper for testing during the timestamp development.
Edit 2: Formatting and example for additional variable