This is what I’ve built so far. What I’d like to do is have mulitple messages so I’m not hearing the same one over and over everyday. Is there a way to play a different message each time? I guess I’m thinking a group of messages that it an choose from like an array… Pretty sure it’s possible not sure how to make that work… Any suggestions would be awesome!
Thank you!
- alias: 16 - Arrival Home
id: Getting home
trigger:
- platform: state
entity_id: device_tracker.sm_f926u1
from: not_home
to: home
action:
- service: tts.cloud_say
data:
entity_id: media_player.sonos_five
message: So nice to have you home John. Is there anything I can do for you?
action:
- service: tts.cloud_say
entity_id: media_player.sonos_five
data_template:
message: >
{{ ('Great to have you home John, is there anything I can do for you?',
'Hello Master.. what is thy bidding?'
)|random }}
A way to get more random messages is to not write the name and use replace
action:
- service: tts.cloud_say
entity_id: media_player.sonos_five
data_template:
message: >
{{ ('Great to have you home AAAA, is there anything I can do for you?',
'Hello AAAA.. what is thy bidding?'
)|random | replace("AAAA", ("John", "Master", "Johnnyboy")| random) }}