Door open tts.cloud_say Announcer (Nabu-Casa required)

Tags: #<Tag:0x00007fc3f0b17248> #<Tag:0x00007fc3f0b16ff0>

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.

:arrow_down: Get Started

Updates will be published on my GIST repository with the rest of my Home Assistant Blueprint collection.

Option 1: My Home Assistant

Click the badge 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.

Option 2: Direct Link

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

:page_facing_up: 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: Cloud 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 Cloud 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. Select the speaker Gender and Language from the Nabu Casa website
  5. Enter the messages for when it is found open and when it finally closes
  6. 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 :tada:
    needs Home Assistant Core 2021.3 or higher and Nabu-Casa to work
  • 2021-09-03: Add Description.

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: Sir GoodEnough
PayPal one-off donation link: https://www.paypal.me/SirGoodenough
Cash App $CASHTAG: https://cash.me/$SirGoodenough
Venmo cash link: Venmo | Sirius GoodEnough

2 Likes

Nice idea. Would use it if it offered an option to configure a door open persistent time period. I mean: if the door is open for more than X sec./min. then make the voice announcement. Like the example show on Nabu Casa page:

Below is an automation which plays a spoken message to a specific media player when a sensor has had an open state for 10 minutes.

- id: DoorOpen10min
  alias: Door is still open
  trigger:
    platform: state
    entity_id: sensor.garage_status
    to: Open
    for:
      minutes: 10
  action:
    service: tts.cloud_say
    data:
      entity_id: media_player.family_room_speaker
      message: the door has been open for 10 minutes
      options:
        gender: female
      language: en-US

It does that. The delay before message is in the start of the sequence before it plays the message, so set it for 600 seconds, it will delay 10 minutes play message, repeat until the binary sensor flips back.

    repeat:
      sequence:
        - delay: !input cooldown 
        - service: tts.cloud_say

If the binary-sensor flips back before it plays, you hear nothing.

Oh, good to know that. I read this in the code, and I didn’t see a for: minutes: X so I thought the announcement would be made at every status change.

trigger:
  platform: state
  entity_id: !input door_entity
  from: "off"
  to: "on"

That’s fine, glad to help.

TTS Nabu Casa stopped working today. Does anyone have the same problem?