Chromecast Integration not working

I've been trying to include text to speech in my rules and notifications. I can trigger the app and I see my Nest Hub show that it's trying to play something but nothing reasonable is audible. I'm sending text using variables like this:
image
I have also tried text literals but to no avail. I know the Chromecast Integration is beta but is it working for anyone else on a regular basis?
Also, when I rerun the Discovery action within the Chromecast Integration app it shows unique names as they have been set up.


However, when I select an audio device within an app it shows duplicates of some of them.
Screenshot 2024-11-01 142153
Any idea why I see duplicates of only some of them?

Yes I think I know from head banging experience.
If you have a rule or piston using CC Integration you must be careful of re-running the app discovery.
It will find all the available devices but in doing so create duplicates of some.
Your rule was attached to the old Device and now there is a newly created Device you must migrate to; delete the old one.

When I was creating pistons I would often re-run the Discovery as I wasn't getting the output from the speakers I desired. In doing so things would stop working totally until I finally discovered it was creating new Devices and leaving me attached to the deprecated one.
Hope this helps.

I have a rule that every 30 minutes, runs, "initialize () on Hallway speaker" (the name for my GH Mini). Doing so, I get my voice announcements as expected with extremely rare occasions where the queue seems to get hung up. I have not had that happen in quite a while. CC integration may be beta, but it is reliable enough for me.

1 Like

Same here. I'm running 9 Google Assistant devices and using a DHCP reservation for each one in the router, and a rule similar to the one mentioned above, I can't remember the last time I had an issue. They have been running like this for around 3 years or so now.

Take the displays out of the equation for the moment. Only use actual google devices while diagnosing.

Set DHCP reservations for all your speakers.

Enable Chromecast polling.

If all else fails, use the google community integration instead.

1 Like

I have set up DHCP reservations for my Google devices and have power cycled them so that they are using the new addresses. I removed my Google devices from Hubitat and then ran the device discovery process in the Chromecast Integration app. I went into each Google device and entered the IP addresses for each, even though the correct addresses were already displayed for the devices.
I have set up an initialization rule for my Nest Hub device. I have also manually run that rule. I have set up a rule to announce that the garage door has changed. I trigger the garage door and I ultimately see the event in the logs.
image
On the Nest Hub device I see the screen switch to Chromecast mode and it makes the alert sound and animates as if it were playing audio but the text I set it to say "Garage door action" does not get spoken.
Here is how my Nest Hub device "Larry Display" is configured.



Have I missed something? Am I hoping for too much?

There is an option to add A delay before speaking in the Chromecast settings. Add 1 second delay and see if that helps.

I have had to do that on some of my displays. I can't remember if it was the gen 1 or gen 2 devices.

I added a one second delay. That seemed to have helped. I put in a literal text string and I was able to hear it. Thank you.

I am now trying to use the variables like %device%, %value% and %text% and those do not seem to result in any audio. The Nest Hub is going through the motions but no voice is heard. I removed the variables and put in a literal text string and a voice could be heard again.

I don't have any video display devices. I just have the one speaker.

Can you use variables and have it translated to audio correctly on your speaker?

I tested from WebCore and vars do indeed work.

So is WebCore working while a regular HE rule is not? This may actually be a notification instead of a rule, per se.

Try assigning these variables to local variables and then use the local variables within the Google speak command. I seem to recall running into something like this but it's been a long time since I set this up.

I set up a local variable "DeviceName" and set it to '%device%'. I then put in '%DeviceName%' for what to speak. This time it pronounced "percent device percent'. Can you dereference a nested variable like this?


Do I need to make the local variable names start and end with percent signs?

Show me the entire rule please. It really has been a long time and I don't actually use the built in variables anymore

Here's the rule:


Here's the action page:

It looks like you set the variable to the string "%device%" while creating it or by clicking on the variable name. You need to set it from a rule action.

So make the first action of the rule "set variable" and set that local variable to %device% in that action.

@LarryZing

I apologize, I was at a campsite this weekend so wasn't able to do any testing until I got home. I was working from memory, which isn't so great.

I just created the rule below and ran it. %device%, %value% and %text% work as-is within the speak command. You do not have to assign them to other variables. I couldn't remember if it was required that is why I suggested it. If they are not working in your rule it is because of something else within your rule or the Google device itself.

If you want to show the rule that doesn't work with the above variables in it I am sure we can figure out why it is not working.

1 Like

I wound up adding the local variables to the rule and everything worked just fine. I then saw your message about not having to use the local variables. I then used the default %text% %date% and %time% variables. That worked as well!

It could be that I got a little off track at the start because I was not using a Rule Machine app but rather a Notification app. My success today has been on a Rule Machine app. Perhaps the default variables don't work in a Notification like I thought they do?

I don't think I've ever tried to use the variables in the notification app. Glad you were able to finally get everything working. Here is hoping your setup is as trouble free as mine has been for spoken notifications.

As a side note, polling never worked for me, I have to use an initialization rule to keep my speakers alive.