I have a door I monitor when opened. How can suspend a notification for a period of time after it is opened for occasions where we are going in and out of the door. For instance, suspending the trigger for 30 minutes.
trigger:
- type: opened
platform: device
device_id: 511eb344e60e78c9fd6e04c4fde4dee4
entity_id: 98109a5df09cc2558885fba03c417988
domain: binary_sensor
enabled: true
id: GarageEntrry
condition: []
automation.turn_off
then do a wait or timer to turn it back on.
to protect against not turning back if a restart happens in the middle safer to use a timer to turn on and make sure it’s set to restore on restart.
1 Like
holler if you need help.
by the way, i’d encourage you to use friendly named entity_id’s for your automation an not use device id’s and device triggers.
here’s more depth into why:
Don’t forget that the first post in a community guide is a wiki - feel free to add to it or correct it.
This guide was written with reference to:
Home Assistant 2023.8.3
Supervisor 2023.08.1
Operating System 10.5
Frontend 20230802.1 - latest
Background
When you start writing automations, a device trigger seems the obvious choice. Everybody knows what a device is and it comes at the top of the UI dropdown list.
[image]
It works… but it is certainly not a “great way to start” because it …
but your automation should get much simpler if you do that, and more readable:
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.test_sensor
to: "true"
condition: []
action:
- service: automation.turn_off
data:
stop_actions: true
target:
entity_id: automation.wait_test
- delay:
minutes: 30
- service: automation.turn_on
target:
entity_id: automation.wait_test
ignore the names of the entities… replace them with your own. i just chose a random set of my own
I did give it a friendly name and did exactly as you describe and it worked like a charm. Thanks again for your help.