I'd like to create a text to speech automation, ideally using Rule Machine to play my Sonos. One part of this announcement is the current and forecast weather for my local area, perhaps similar to what happens when asking Google "what's the weather today" etc.
Does anyone know of an external site or service that I can point a rule to that will pull back the statement I need to announce? With an example as I am novice?
I've experimented with trying to integrate into different weather apps/sites before but not seen a Web service that returns a Tts string in such a way.
Maybe there is a way to convert the Google result to play on the sonos somehow?
My suggestion would be to look at what weather service(s) you have available in HE, in particular with weather results as attributes (Current States) for a device, then look at how you can construct a string that includes those details (attributes) mixed together to form a coherrent message. Once you have a message (STRING), then I expect it will be a simple exercise to play this on the speaker (famous last words)
I just made this, took about 2 mins, Works fine. I used the Wunderground driver. Simply use any attributes in the announcement you want. Even multiple ones.
I've explored setting up a Wunderground account and creating an Api having added the virtual driver from the Package Manager. A Google search suggested that if I add a device to the site (which I don't actually have) it doesn't matter and I can still use the credentials.
Ive added them to the virtual driver but get no other response
Thank you, yes you were correct. For some reason the site didn't display on my phone. I've created the key and put it in and I get a full list of variables and states.
So it's funny. I made the rule above as an example for you and I forgot to delete it when I was done posting. So now it announces today's weather and my wife loves it... WAF for the win!
I got home from holiday yesterday having set up a very extended set of messages in a single long rule that include the forecast element of this chat (current, UV and also forecast for tomorrow) but I also extended it to include some information from Hub Information Driver such as CPU temp, Free Memory and if an update was available. Its been fun learning how to pull through the different values and setting up Hub variables in some cases.
I was so smug - seeing the messages to my phone when it ran, but I got up this morning and it played it for the first time for me out loud through the Sonos and it didnt work. It cut off or didnt play certain parts of the messages or when I put them into single shorter messages in the rule to try and simplify it it skips through them all too quickly and doesnt finish each one. I then realised I've only ever ran single announcements in a rule before and hadnt realised I might need to add in wait steps to account for the length of the message.
Does anyone know how to add an artifical pause within a single TTS statement or add a wait/pause between seperate statements/rules that can handle TTS messages that might handle messages of slightly different lengths? Also setting this up is really tricky, each time I change a wait for x seconds I have to go down the rest of the rule and modify their waits by the same amount?
If I have to split up the messages into different lines in the rule (because I have to manage the audio experience) that it means they will also be sent in different messages to my phone which is rubbish - I will probably have to have a copy of this that runs independently so the messages are all sent in one go?
I feel like I am missing an obvious/easy way of doing this and making it hard for myself
I keep chipping away at this when I have some free time.
My latest attempt at some functionality is to try to announce the time since someone came to our front door or came onto our drive.
I have a few different cameras that indicate human presence, Reolink and Google, the reolink (which is local via Home Assistant) brings in this device/entity.
Thanks for your suggestion. Just so I understand, I am looking to store the time that the status changed (when presence was detected) in the variable so that when the rule is ran, at a later time, it reads it out.
Wouldn't the proposed solution above assume that the announcement occurs at the same time the status changes?
Sorry yes, I thought you meant at the time the event happened. But yes, you can create any variable you want and send the time the event and send %whatevervariableyounamed% how ever you want.