Skip to content

Instantly share code, notes, and snippets.

@gilliangoud
Last active September 20, 2021 06:04
Show Gist options
  • Save gilliangoud/7d6f6770c78617810ba6b1efa9887fd6 to your computer and use it in GitHub Desktop.
Save gilliangoud/7d6f6770c78617810ba6b1efa9887fd6 to your computer and use it in GitHub Desktop.
blueprint:
name: Anti Door open forget TTS announcer
domain: automation
input:
door_entity:
name: Door Sensor
description: Entity that causes announcement
selector:
entity:
domain: binary_sensor
device_class: door
speaker_target:
name: Speaker
description: Entity to announce event on
selector:
target:
entity:
domain: media_player
announcement_message:
name: Announcement message
description: What to say when door is opened
final_message:
name: Final message
description: What to say when door is closed
cooldown:
name: Announcement cooldown
description: The minimum time needed in between announcements
default: 10
selector:
number:
min: 0
max: 600
unit_of_measurement: seconds
mode: single
trigger:
platform: state
entity_id: !input door_entity
from: "off"
to: "on"
for: !input cooldown
action:
- alias: Repeat the sequence UNTIL the door is closed
repeat:
sequence:
- delay: !input cooldown
- service: tts.google_translate_say
target: !input speaker_target
data:
message: !input announcement_message
until:
- condition: state
entity_id: !input door_entity
state: 'off'
- service: tts.google_translate_say
target: !input speaker_target
data:
message: !input final_message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment