This is possible but with a workaround. Just create a helper (boolean) that will be on when you want to receive the notification. Booleans are like switches. So let’s assume that when the boolean is on, you will receive the notification. Then your notification automation should be:
Trigger:
Motion sensor or camera or whatever
Condition:
boolean is on
Action:
send the notification
turn the boolean off
This way, because the boolean is also in the condition, next time that the trigger will be triggered it will be off and the notification will not be sent.
Then, you can create another automation (it can be timed) to turn on the boolean again when you want to be receiving notifications.
I have such set up with my bed sensor… For example, when i go to bed, all lights are turning off and i receive a notification on my phone to set up an alarm. When i didn’t have the boolean in place, if i would stood up and go to bed again, i was receiving the notification again. I implemented the boolean and now i receive it only once when i go to bed.
I have another automation that turns the boolean on about 19:00 in the afternoon so when i go to bed i can receive again the notification.
Ah that is interesting, I never worked with blueprints before, I’m going to try this, thanks!
(So basically it should act as a template where the sensor is the variable right?)
My initial thoughts was to have something in the frontend where it would be a standard option for a sensor (seems more user friendly imho)
You’re welcome and here’s an example to get you started.
blueprint:
name: One-Time Notification
description: Notify when a given entity changes state.
domain: automation
input:
entity:
name: Sensor Entity
description: The sensor entity to monitor.
selector:
entity:
domain: sensor
notify_title:
name: Title
description: The notification's title.
selector:
text:
trigger:
- platform: state
entity_id: !input entity
condition: []
action:
- service: notify.persistent_notification
data:
title: !input notify_title
message: 'Changed state to {{ trigger.to_state.state }}'
- service: automation.turn_off
target:
entity_id: '{{ this.entity_id }}'
After you copy-paste it into a new blueprint file, it can be used to create an automation that monitors a selected sensor and posts a persistent notification when the sensor changes state and then disables itself.