I’m working on an automation (full code below) that will have Google text speak to through my Sonos speakers once I trigger the automation. So far, it works if I manually type in the text via the mediaplayer interface at the home assistant, but the automation fails - even if I trigger it manually. Again - the home-assistant.log leaves a lot of questions.
Here is my code from automation.yaml:
alias: Welcome home automation
trigger:
- entity_id: device_tracker.iphone8
from: not_home
platform: state
to: home
condition: []
action:
- data:
entity_id: media_player.all_speakers
service: media_player.turn_on
- delay: 00:00:02
- data:
entity_id: media_player.all_speakers
message: 'Welcome home, Sire! It is gooood to be the KING!'
service: tts.google_say
- delay: 00:00:04
- data:
entity_id: media_player.all_speakers
service: media_player.turn_off
Any thoughts or ideas would be helpful. As stated, the sonos speakers works well and I can use them via the home assistant but I cannot seem to get the automation to work.