Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HA Blueprint Automation for a TTS.cloud-say version of another Door Announcer. This blueprint is set up to watch a binary sensor. When it goes from off to on (closed to open) it triggers a message to be sent to the google enabled speaker of your choice. The message will play after a delay you set and repeat on that same delay. Home assistant.
blueprint:
name: Door open tts.cloud_say announcer (Nabu-Casa required) 2021-10-29
description: This uses tts.cloud_say from Nabu-Casa to tell you a door is open too long and a door has been closed.
# Community link for blueprint: source_url: https://community.home-assistant.io/t/door-open-tts-cloud-say-announcer-nabu-casa-required/316046
source_url: https://gist.github.com/SirGoodenough/ed99bd75a65088f4a41c46d1ce19f103
domain: automation
input:
door_entity:
name: Door Sensor
description: Entity that causes announcement
selector:
entity:
domain: binary_sensor
device_class: door
start_time:
name: StartTime
description: >
Time of day you want to enable the announcement each day.
Leave at 12:00:00 if you want it to always be on.
selector:
time:
default: 00:00:00
end_time:
name: EndTime
description: >
Time of day you want to disable the announcement each day.
Leave at 12:00:00 if you want it to always be on.
selector:
time:
default: 00:00:00
speaker_target:
name: Speaker
description: Entity to announce event on
selector:
entity:
domain: media_player
speaker_gender:
name: Speaker Gender
description: Select speaker gender male or female
default: male
selector:
select:
options:
- female
- male
speaker_language:
name: Speaker Language
description: Select Language code. See-> https://www.nabucasa.com/config/tts/
default: en-AU
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 number of seconds needed before AND between between
announcements. This is your initial delay and pause between messages...
default: 10
selector:
number:
min: 0.0
max: 7200.0
unit_of_measurement: seconds
step: 1.0
mode: slider
mode: single
trigger:
platform: state
entity_id: !input 'door_entity'
from: 'off'
to: 'on'
condition:
alias: "Active time for the announcement"
condition: time
after: !input 'start_time'
before: !input 'end_time'
action:
- alias: Repeat the sequence UNTIL the door is closed
repeat:
sequence:
- delay: !input 'cooldown'
- service: tts.cloud_say
data:
entity_id: !input 'speaker_target'
message: !input 'announcement_message'
options:
gender: !input 'speaker_gender'
language: !input 'speaker_language'
until:
- condition: state
entity_id: !input 'door_entity'
state: 'off'
- service: tts.cloud_say
data:
entity_id: !input 'speaker_target'
message: !input 'final_message'
options:
gender: !input 'speaker_gender'
language: !input 'speaker_language'
@SirGoodenough

This comment has been minimized.

Copy link
Owner Author

@SirGoodenough SirGoodenough commented Jul 15, 2021

⬇️ Get Started

Option 1: My Home Assistant

Click the link below to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

[Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.(upload://laxW40s3fqX5zPNuVspYWHAstt9)

Option 2: Direct Link

Copy this link if you want to import the blueprint in your installation.
https://gist.github.com/SirGoodenough/ed99bd75a65088f4a41c46d1ce19f103

📄 Description

This is a TTS.cloud-say version of another Door Announcer I found in the HA Blueprint Exchange. For people that have Nabu-Casa, TTS.cloud-say is far superior to TTS.google_say as it adds languages and gender to the voices available. If you are a Nabu-Casa subscriber, I highly recommend using this.

This blueprint is set up to watch a binary sensor. When it goes from off to on (closed to open) it triggers a message to be sent to the google enabled speaker of your choice. The message will play after a delay you set and repeat on that same delay until the switch returns to off (closed), at which time it sends a different message. The delay time and all the other parameters are adjustable.

You will need to select a country code as listed in the TTS.cloud_say documentation listed here: https://www.nabucasa.com/config/tts/

How the Blueprint works:

To import this Blueprint:

• Open Home Assistant with administrator privileges and on a Lovelace screen, click anywhere in the main entity area and type the letter ‘c’. A selection box should pop up. Type blue and select the button to navigate to blueprints. You can also find blueprints by selecting configuration from the left menu and then blueprints from the center menu.
• Once there, click on the ‘Import Blueprint’ button in the lower right side of the main screen.
• In the ‘URL of the blueprint’ line type or paste in the URL of my Blueprint. I have the blueprint stored on my Public GIST on GitHub:
https://gist.github.com/SirGoodenough/ed99bd75a65088f4a41c46d1ce19f103

To make the blueprint work it will need:

• 1 binary_sensor entities to sense the action you are announcing
• 1 media_player, group of media _players, or list of media_players to send the words to
• Pick a gender and language from https://www.nabucasa.com/config/tts/

Once you have the entities created or decided upon you can build the Automation. To build the automation:

  1. Click on 'Create Automation
  2. Add a Description so you can tell what this one is for
  3. Use the Drop-downs to select the Entities for the listed purposes
  4. Set the time-frame that the automation will be active. Default is always on.
  5. Select the speaker Gender and Language from the Nabu Casa website
  6. Enter the messages for when it is found open and when it finally closes
  7. Set the time delay before the first message and between the open messages

HOW the Blueprint / Automation works

Walk-thru:

  1. The header of the Blueprint contains the required info plus the URL from where it came from.
  2. The input: section is where it gets the information it needs to fill in the blanks. This information is stored in the actual automation referencing this Blueprint when executing the task.
  3. The Trigger section will start everything when your Binary Sensor changes state from off to on.
  4. Once triggered it goes into a repeat loop that starts with the delay time selected. This repeat loop will immediately abort if the binary sensor flips back to off. If the binary sensor stays on long enough to get passed the delay time, the initial announcement will be sent to the speaker and it will cycle back to the top and start the repeat loop again.
  5. When the binary_sensor flips to off it will play the closing message,

Changelog

  • 2021-06-16: First blueprint version 🎉
    needs Home Assistant Core 2021.3 or higher and Nabu-Casa to work
  • 2021-09-03: Add Description
  • 2021-10-29: Add the ability to select the time-frame the announcement will be active

All My Blueprints

Contact Links or see my other work:

What are we Fixing Today Homepage / Website: https://www.WhatAreWeFixing.Today/
Channel Link URL: (WhatAreWeFixingToday) https://bit.ly/WhatAreWeFixingTodaysYT
What are we Fixing Today Facebook page (Sir GoodEnough): https://bit.ly/WhatAreWeFixingTodayFB
What are we Fixing Today Twitter Account (Sir GoodEnough): https://bit.ly/WhatAreWeFixingTodayTW
Discord Guild: (Sir_Goodenough#9683) https://discord.gg/Uhmhu3B

If you want to support me:

Buy me Coffee: https://www.buymeacoffee.com/SirGoodenough
PayPal one-off donation link: https://www.paypal.me/SirGoodenough
Cash App $CASHTAG: https://cash.me/$SirGoodenough
Venmo cash link: https://venmo.com/SirGoodenough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment