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
periodical notification with adjusable duration
actionable notification to stop periodical notification
BREAKING CHANGE: check your custom messages and title. use entity_name and active_state variables instead of the old trigger variables. Entity ID is stored in a variable called sensor
What can you tweak?
sensors that should be monitored
trigger states of the sensors
the time the sensors must be in the defined state before the notification will be send
the notification device or group
notification message, title and icon
Updates
open blueprint for any entity with any state (not only binary_sensors)
add option for home assistant persistent notification
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')) }}