just want to share my blueprint with you. Feel free to share thoughts, faults and improvements.
What does it do?
It creates a notification based on a defined state of a sensor, e.g. a window or a door. The notification disappear when the door/window/sensor leave its defined state.
New In Version 3.0
🔃 support for operators (=, >, <, !=, >=, <=)
🤯 new logic for better troubleshooting and further development
📱 multiple groups and devices for notifications possible
Features
🎯 monitor entities for a specific state and trigger a notification
📝 modify message, title, icon, color, channel, group etc
🧷 persistent notification until entity leaves specified state
🔄 periodical notification with stop functionality
🎬 custom actions
✅ custom conditions
Links
Version 2 (Deprecated)
[![Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.](upload://3IEiMyDuriGlhMmaFV0iSnXlL0b.svg)](https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https://gist.github.com/panhans/de984b7416c8470f22afcc9b7b26050a)
I don’t know what you mean. The automation pushes exactly one notification for each sensor if open. Do you want only one notification for the whole bunch of defined sensors if one hits the defined trigger state?
would it also be possible to integrate the HomeAssistant persistent.notification service?
Right now, it is required to enter a device that should receive the notification - but I would also like to use the internal notification system (if HomeAssistant is not running on a Mobile Device)
service: notify.persistent_notification
data:
title: A window is Open!
message: "{{ states('sensor.door') }}"
thanks
But the “device” for the notification is still set as required - which is bad if you don’t have a mobile device
If you use the notification provide, device is not required.
if you use the device, notification provider is not required.
One of both needs to be used, but both can be used.
Hope, this does make sense?
Maybe similar to the low battery notification - in this case, you can set an action (which can be a notification or any other thing you can imagine)
Also I did a short test, since I’ve noticed that the blueprint can also be saved as an automation without adding a device.
Unfortunately, the Notification was not triggered in my test - because the blueprint config does not include any notification config:
In addition to that:
I have tested the blueprint on another installation (where I have the mobile app connected to)…
I have set my mobile device + HomeAssistant notification service - and did not receive a notification - Either on the phone - nor on the HA Installation itself.
Furthermore:
It is only possible to add one device that should receive the notification.
It would be good, if you could also add multiple devices (if you and your partner is using homeassistant on the phone )
I’ve updated the blueprint. For me the notification in home assistant and device worked with the old versions. If you have troubles watch in the log section under system in your options or press the trace button in your automation configuration page.
well - I have only tested it on my installation without mobile app - and it was working as expected The notification has been sent successfully - and now, I can start to do all my messeging automations that I’ve already planned to do in the next days
I have now created several notifications that should be triggered from your blueprint - and… some tests worked well… But now - I don’t receive any notification when I try to test them & I have the following errors in the logs (for each persistent notification)
Logger: homeassistant.components.automation.persistent_door_open_notification
Source: components/automation/__init__.py:253
Integration: Automatisierung (documentation, issues)
First occurred: 21:54:47 (8 occurrences)
Last logged: 22:01:10
Error rendering variables: UndefinedError: 'dict object' has no attribute 'from_state'
How did you trigger the automation? As you can see in the error message the trigger entity has no attribute from_state. If the automation gets triggered by the defined entity everything should work well. Did you triggered it manually in the automation menu maybe?
let me check again - maybe, I have made some other mistakes, because I had a couple of automations which should trigger under different conditions (sometimes, they were fired - sometimes not)
Also, I got some other errors recently, which I did not understand - and I am rebuilding some of them now.
I will come back again, if I have any new information.
Run Action wont trigger the automation, because its based on the trigger entities. You can leave notification group or notification device blank.
I’ve updated the blueprint so 0 values for the time can get handled. So the notification appears immediately. But there is still a home assistant related bug with Zero values for the input_number field.
Try update the blueprint and let it get triggered by the trigger entity. If nothing happens press the trace button in the automation itself or have a look in system > logs for further information.
Hi @panhans,
I might have an idea for improvement - or a bug… depends on how you call it
I am checking for an entity, which could have three states.
→ open
→ tilted
→ closed
I would like to give a notificiation, when the state is either open or tilted - so, it would be great, if the blue print would allow one or more states that can be true.
Or a configuration “if not in state clsoed”
Then, I want to display the entities state in the message.
Therefore, I’ve tried to use:
Nicht vergessen:
{{ trigger.from_state.attributes.friendly_name }}
ist immer noch
{{ trigger.from_state.state }}
(Don’t forget, ENTITY is still STATE)
Right now, the notification will be trieggered, when the state is OPEN.
This is working as expected, BUT:
The message does show:
(Don’t forget ENTITY is still ‘closed’)
I don’t know, where the closed state does come from… ?!
I’ve tried to change the UI language - but it does not seem to be related to that setting…
Multiple states should be possible, but then the last state change will overwrite previous notifications. Also would be possible to send/delete a notification for each status but I don’t know if there is a use case for this.
For your localization problem you can try this:
Nicht vergessen:
{{ trigger.from_state.attributes.friendly_name }}
ist immer noch
{{ iif(trigger.from_state.state == 'on', 'geöffnet', 'geschlossen') }}
For more states simply copy the line and edit it like
Nicht vergessen:
{{ trigger.from_state.attributes.friendly_name }}
ist immer noch
{{ iif(trigger.from_state.state == 'open', 'geöffnet', '') }}
{{ iif(trigger.from_state.state == 'tilted', 'angekippt', '') }}
{{ iif(trigger.from_state.state == 'closed', 'geschlossen', '') }}
or stack them:
Nicht vergessen:
{{ trigger.from_state.attributes.friendly_name }}
ist immer noch
{{ iif(trigger.from_state.state == 'open', 'geöffnet', iif(trigger.from_state.state == 'tilted', 'angekippt', 'geschlossen')) }}