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

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 GIT repository with the rest of my Home Assistant Blueprint collection.

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.

Option 2: Direct Link

Copy this link if you want to import the blueprint in your installation.
https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/door_open_tts_cloud_say_announcer_nabu_casa_required.yaml

: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 REPO on GitHub:
https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/door_open_tts_cloud_say_announcer_nabu_casa_required.yaml

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. 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 :tada:
    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
  • 2021-12-24: Add pick list of all the available languages and dialects.
  • 2022-01-03: Remove ‘Door’ restriction on input sensor, and expanded description.

All My Blueprints

Link to 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): WhatAreWeFixingToday

What are we Fixing Today Twitter Account (Sir GoodEnough): https://bit.ly/WhatAreWeFixingTodayTW

Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?

If you want to support me:

Buy me Coffee: Sir GoodEnough

PayPal one-off donation link: PayPal.Me

Cash App $CASHTAG: Pay $SirGoodenough on Cash App

Venmo cash link: Venmo

#WhatAreWeFixingToday

#SirGoodEnough

3 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?

I love this blueprint!! but couldn’t find an option do set a period of time to run the automation. Any ideia, thanks!!

I am not sure what you are asking.
It runs while the ‘door_entity’ sensor is on and the message repeats after every ‘cooldown’ time with the ‘final_message’ when the ‘door_entity’ sensor turns off.

Hi!!

I’ll like to have this automation to run just (for example) between 6 am to 8 pm
thanks!!

Then you write another automation that disables this automation between 20:00:01 pm until 05:59:59 am.

- id: 'control_tts_announce'
  trigger:
    - platform: time
      at: '05:59:59'
      id: go
    - platform: time
      at: '20:00:01'
      id: stop
  action:
    - choose:
      - alias: Enable the Automation
        conditions:
        - condition: trigger
          id: go
        sequence:
        - service: automation.turn_on
          entity_id: automation.announce_tts
      - alias: Disable the Automation
        conditions:
        - condition: trigger
          id: stop
        sequence:
        - alias: Stop a possible running sequence
          service: homeassistant.turn_off
          entity_id: automation.announce_tts
        - alias: disable the automation
          service: automation.turn_on
          entity_id: automation.announce_tts

Or else you edit the blueprint and add a condition:

...
trigger:
  ...
condition:
  alias: "enabled time slot"
  condition: time
  after: "05:59:59"
  before: "20:00:01"
action:
...

I guess I could add this into the blueprint without messing with people that want it on 24hrs. I’ll have to consider that, but not at 3am local… Could add days of the week as well…

I updated it on your request…
It now has start time and end time when it will be active, and if left default it will just run all the time.
I tried to play with day of week, that didn’t go well…

1 Like

thanks!!! it’s working great… and now have happy wife

1 Like

Glad could help.
Let me know if you have other suggestions.

Added a pick list for languages, so all available at the time of this release are now available.

Hi!

When i’m trying to add my door sensor i can’t find it in the list. It’s called “binary_sensor.fin_entre” . It does not show up.
Any ideas? The only sensors i get in the list is from my Volvo’s doors…

// Mattias

Add device_class: door to your binary sensor

Very nice, thanks for sharing!

Thought i’d add to the suggestion list…
It would be great to be able to expand, or change the speakers/group as time persists.
So one would have the ability to announce first locally by the door, and expand announcement to other areas of the house if door is left open.

Where should i type in that? In Automations.yaml?

I found this error aswell:

Where does this sensor come from?
If you have an entity where the sensor can be modified, you can use the selection: display as.
If you have it created manually, add it to the configuration of that sensor.

I don’t know where the “door_entity” come from. My binary sensor i use comes from my home alarm system.