Works with BOTH Piper and Nabu-Casa tts-cloud-say. 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.
Changelog
- 2024-06-08: Blueprint Input Sections for enhanced Descriptions.
- (Documentation change 2-7-2024 to add License notice. Changes only to Descriptions.)
- 2024-04-22: The gender option for text-to-speech in the Home Assistant Cloud integration is deprecated
- 2023-10-02: Add the ability to use Piper TTS.
- File Rename to reflect new function.
- Old Automatons will still work when pointed to new BP file name.
- Added {{ door }} variable for users to plug into the messages.
- Fixed Bug where crashed if multiple door sensors were selected.
- 2023-09-22: Add silencing ability if the warning never triggers.
- 2023-08-17: Add voice ability
- Fix language list
- Add Weekday ability
- Set door close timing to soon after door closes
- 2023-08-07: Updates for Home Assistant 2023.8
- Selector syntax change
- Condition Selector addition (where applicable)
- MQTT Discovery name changes (where applicable)
- Clean-up code formatting
- 2023-03-01: Add Author Tag. Bump HA required Version to 2023-3-0
- 2022-12-12: Add Update Method Note, minor code change.
- Name of Blueprint may have changed meaning you have to re-download with a new link.
- If name changed, it is similar. Variables have not changed.
- 2022-05-05: Updated for 2022.5.0 HA. Added Markdown to !input Descriptions.
- 2022-04-11: Add multiple to Speaker Selection and changed minimum HA to 2022.4.0
- 2022-01-03: Remove āDoorā restriction on input sensor, and expanded description.
- 2021-12-24: Add pick list of all the available languages and dialects.
- 2021-10-29: Add the ability to select the time-frame the announcement will be active
- 2021-09-03: Add Description
- 2021-06-16: First blueprint version Needs Home Assistant Core 2021.3 or higher and Nabu-Casa to work
About this blueprint
Type of blueprint: AUTOMATION
What if I am having problems getting it going?
You can contact me for help, see the links below.
Why do I need this?
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.
There are ways to enable the announcement only during time slots and/or specific weekdays, so you could have a different message every day of the weekā¦
License Notice:
-
Copies of the original Blueprint that were converted via the āTake Controlā feature or other means are officially not supported by me.
-
I may or may not be able to support you when you have a problem after you make changes to my code, as some of the code is no longer mine.
-
I & my license also require attribution as a link back to the original should you use this code in your own creation.
-
Here is a link to my license & the original github post expected to be followed & referenced as attribution should you use this code elsewhere.
Configuration
Requirements
-
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
-
Pick a voice from hass-nabucasa/hass_nabucasa/voice.py at master Ā· NabuCasa/hass-nabucasa Ā· GitHub
NOTE: For version 2023-10-02 the filename was changed to reflect the large change in function. To update, import the new Blueprint, and edit the prior automation to use the filename for the new BluePrint. Then delete the old BluePrint. Your old Automation for the prior version is compatible with the new blueprint with the exception of the path/name.
Input fields
door_entity: 'Door Sensor (or any binary_sensor will do...)'
Entity that causes the announcement. Actually any entity that
changes its state from off to on will work here, You would
just need to enter the entity manually if it's not a
binary sensor.
speaker_target: Speaker
Entity to announce event on
tts_service: 'Text to Speech Processor'
Select the configured TTS engine for media_player notifications.
[SEE for details](https://www.home-assistant.io/integrations/#text-to-speech)
announcement_message: Announcement message
What to say when door is opened.
The variable {{ door }} is available if you want the dynamic
friendly_name of the device that triggered.
This can be set to "" if you do not want a message while sensor is active.
final_message: Final message
What to say when door is closed.
The variable {{ door }} is available if you want the dynamic
friendly_name of the device that triggered.
This can be set to "" if you do not want a message after the sensor is reset.
speaker_language: Speaker Language
Select Language code.
[See here for Details](https://www.nabucasa.com/config/tts/)
speaker_voice: tts_cloud (Nabu Casa) Voice
***Here you need to be careful.***
If you are OK with the default voice then just leave this field empty.
If you want to change the voice, you need to pick from [This List, TTS_VOICES section](https://github.com/NabuCasa/hass-nabucasa/blob/master/hass_nabucasa/voice.py)
being certain to match the country code you picked above with one of
the voices available for that country code on that list.
piper_voice: Voice option for the Piper addon played thru Wyoming
Used only on Piper.
[Voice List Here](https://huggingface.co/rhasspy/piper-voices/blob/main/voices.json)
Also available in the Add-on UI configuration dropdown.
If a new one is available you can enter it manually.
cooldown: Announcement cooldown
The minimum number of seconds needed before AND between between
announcements.
reminded: 'Did I remind you?'
This is optional.
You can leave this at the default (empty) and the behavior of the BP will
be exactly what it was in the past. This ensures your old set-up will not
break if you upgrade the BluePrint.
Or if you create an 'input_boolean'/'toggle' helper and put the name in
here, the behavior will be the door is silent as long as you do not
exceed the time it takes to get to the warning message that the door is
open. If that warning message triggers once, it will then thank you after
you close it.
start_time: StartTime
Time of day you want to enable the announcement each day.
end_time: EndTime
Time of day you want to disable the announcement each day.
additional_conditions:
Extra conditions you may want to add to this automation
(Example: Home occupied, TV on, etc)
Walk-thru:
- The header of the Blueprint contains the required info plus the URL from where it came from.
- 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.
- The Trigger section will start everything when your Binary Sensor changes state from off to on.
- 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.
- When the binary_sensor flips to off it will play the closing message,
Troubleshooting tip
If you are troubleshooting and you want to see more traces back when doing so, here is a TIP Iāve found.
Manually edit the automation created with the ui editor (or manually with a text editor) and add the following to have this automation contain 10 traces instead of the normal 5. Then if the automation is triggering often, you can see the last 10 traces to help you decide what the issue is.
HA Docs on this here.
trace:
stored_traces: 10
Version Updates
Updates will be published on my GIT repository with the rest of my Home Assistant Blueprint collection.
There is not an official version control system for Blueprints. However I have found something that comes pretty close. It is not perfect, but for MOST Blueprints, it does just fine. I encourage you to check this script out and use it to easily check if I have updated this blueprint. koter84 Blueprint Update Script
Please Click the at the end of this top Post if you find this Useful
Software to Download
HA link to download blueprint:
Direct link to download Blueprint: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/door_open_tts_cloud_say_and_Piper_announcer_Piper_OR_nabu_casa_required.yaml
All My Blueprints
https://github.com/SirGoodenough/HA_Blueprints/blob/master/README.md
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
Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?
If you want to support me
Buy me Coffee: https://www.buymeacoffee.com/SirGoodenough
PayPal one-off donation link: PayPal.Me
#WhatAreWeFixingToday
#SirGoodEnough