The problem is the action with tts because it doesn’t get executed (at least I cannot hear a word and also nothing in the error log). I have tried the same action in the service tool of Home Assistant and it worked. How can I fix it in this project as well?
I have it already changed as above because I also thought that would solve the problem but with the updated code I cannot hear a difference (I have restarted Home Assistant).
Looking at the code again I think the MP3/4 won’t make a difference, I would remove the template to simplify the code and try just sending “Good Morning”, since it’s probably the templating that’s not working.
I have noticed that sometimes google home get into a funny state where it’s marked as a source not a sink and will not then accept any input from HA, you can usually tell when it’s in this state by looking at it’s media card.
I have added base_url: https://myaccount.dyndns.com and now I can hear a short notification sound twice in a row but still no TTS output.
Is the message: "Guten Morgen. Es ist {{now().hour}} Uhr {{now().minute}}"
not valid?
I had the same requirement, and the same problems - up to the point where I thought that templating does not work with services and / or google say. Through trial and error, I got the following configuration to work.
- action:
- data_template:
message: The temperature is {{ states.sensor.temperatur.state }} degrees
entity_id: media_player.kuche
cache: false
service: tts.google_say
I don’t know exactly what did the trick, but comparing our two configurations, here are my suggestions. Maybe you could try them one by one, and give feedback if one worked out, and which? Ordered from most promising to least.
Put the entity_id inside the data_template
Message always as the first item of the data_template, even though that doesn’t seem to matter any more
Message without quotes
What made the debugging a real nightmare for me was that the integrated script editor doesn’t support data_template, and that scripts updated in /config/ via SMB don’t seem to update immediately. Therefore, frequent restarts were necessary.