Last active
October 11, 2024 20:39
-
-
Save andersonimes/1a7aa4771c4ab994a0b95822abdde7f5 to your computer and use it in GitHub Desktop.
Blueprint for a Home Assistant voicemail automation for Technithusiast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Voicemail Reminder Automation | |
description: If you have uncompleted items on a to-do list when occupancy is detected, announce it on a speaker. | |
domain: automation | |
input: | |
occupancy_sensor: | |
name: Occupancy Binary Sensor | |
description: You can use any sensor as an occupancy sensor as long as it's a binary sensor | |
selector: | |
entity: | |
filter: | |
- domain: binary_sensor | |
todo_voicemail: | |
name: Urgent Todo List | |
description: Select the todo list that contains items you want read to you | |
selector: | |
entity: | |
filter: | |
- domain: todo | |
announce_player: | |
name: Media Player | |
description: What device do you want your todo items read to you on? | |
selector: | |
entity: | |
filter: | |
- domain: media_player | |
announcement_volume: | |
name: Announcement Volume | |
description: Set the volume of the device used for announcements | |
default: 0.4 | |
selector: | |
number: | |
min: 0.00 | |
max: 1.00 | |
step: 0.05 | |
mode: slider | |
variables: | |
voicemail_name: !input todo_voicemail | |
trigger: | |
- platform: state | |
entity_id: | |
- !input occupancy_sensor | |
from: null | |
to: "On" | |
condition: | |
- condition: template | |
value_template: "{{ states(voicemail_name) | int > 0 }}" | |
action: | |
- service: scene.create | |
metadata: {} | |
data: | |
scene_id: tempscene | |
snapshot_entities: | |
- !input announce_player | |
- service: media_player.volume_set | |
metadata: {} | |
data: | |
volume_level: !input announcement_volume | |
target: | |
entity_id: !input announce_player | |
- service: todo.get_items | |
target: | |
entity_id: !input todo_voicemail | |
data: | |
status: needs_action | |
response_variable: the_todos | |
- service: tts.cloud_say | |
metadata: {} | |
data: | |
cache: false | |
message: > | |
{% set list_voicemail = the_todos[voicemail_name]['items'] | | |
map(attribute='summary') %} | |
You have {{the_todos[voicemail_name]['items'] | list | count }} | |
{% if the_todos[voicemail_name]['items'] | list | count | int > 1 %} | |
messages. | |
{% else %} | |
message. | |
{% endif %} | |
{% for vm in list_voicemail %} | |
{{ loop.index }}: {{ vm }} | |
{% endfor %} | |
End of messages. | |
entity_id: !input announce_player | |
- wait_for_trigger: | |
- platform: state | |
entity_id: | |
- !input announce_player | |
from: null | |
to: idle | |
- service: scene.turn_on | |
metadata: {} | |
target: | |
entity_id: scene.tempscene | |
mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! I don't know if you can do pull requests on a repository....but I've amended to your blueprint and thought I'd share.