TTS "The following windows are still open:" [dynamic list spoken]

I just started a trial of the Nabu Casa online service. So far so good in converting my automations over from pre-recorded announcement files over to TTS.

I’m wanting to have an announcement that will play at the end of the day notifying me of any windows or doors that have been left open. It would be a voice announcement along the lines of “The following windows and doors are open…” and it would read a list.

My issues are how do I do this loop and how do I beautify the entity name when spoken?

My entities are named like this
(doors)
binary_sensor.front_door_sensor
binary_sensor.garage_side_door_sensor
(windows)
binary_sensor.dining_room_left_window_sensor

I need to go from those to spoken
Front door
Garage side door
Dining room left window
etc

Also how do I build up a message string containing all the open windows and doors?
ie

message: The following windows and doors are still open front door, dining room left window,

Thanks for any advice!

Give your entity_id a friendly name, the one you want to use in the message. Then put all of them in a group, e.g. group.windows_doors_outside

Now you can use this tenplate to create your message:

message: >
  The following windows and doors are still open
  {{ expand('group.windows_doors_outside')|selectattr('state','eq','on')|map(attribute='name')|list|join(',') }}
6 Likes