[SOLVED] OH2 - Chromecast Binding - Audio output on multiple Google Home (Mini) at the same time?

I first of all want to thank the developer of the Chromecast binding for his great work!
I was a user of Amazon Echo dot and bought a Google Home Mini to experiment with.

The ability to send voice output to the Mini using the Chromecast binding is such a great thing that I now bought a second one and want to output some messages simultaniously on all my Google Home Mini’s. (example -> intruder or fire alarms)

When I installed my two devices as two manually set up things, each of the devices represents it’s own audio sink. This is good, but I would also like to put the “Default Sink” to all my Chromecasts.

So I could simply use one line in my rules to output to all Google Home devices at the same time.

Here is my current setup:

Thing definition - chromecast.things 

chromecast:audio:floor                [ ipAddress="192.168.1.220"]
chromecast:audio:sleeping         [ ipAddress="192.168.1.219"]

The Audio settings ( org.eclipse.smarthome.audio ) are set to one (the first) Chromecast device, but two appear in the selection box.

An example rule to say something is like this:

rule "Away On"
 when
	Item Away received update ON 
 then
 	say("The alarm has now been activated ...  ")
 end

This is only send to the one (first - default) audio sink.

Is there a way to either tell in the “say” command to output to multiple audio sinks or is there a way to select “All”/Multiple Chromecast devices as default audio sink?

I did not find an answer gooling around.

Thanks for your help.

3 Likes

I saw on the binding in PaperUI that the Chromecast Binding is supporting Chromecast Audiogroups, which is what I think could be the solution to my question above.

Here is the definition:

Chromecast Audio Group

chromecast:audiogroup

A Google Chromecast Audio Group device

I don’t know what to provide as connection parameter. Would it be enough to give one of the IP addresses of my devices or do I need to provide all IP addresses, if so how?

I don’t have any google home mimis (saidly) but I have 3 CC audio. I groups them in the “home” app, and they appear as an thing in OH.

OK - so you make use of the automatically appearing things.
I was hoping to configure them in my chromacast.things file to have a consistent way to define my things.
But good to know that this way is an valid option. Thanks.

I think you can define it as an thing, my setting for the chromcast gruop shares ip with on of my chromcasts

OK - interesting - yes on the automatic/via PaperUI I can make it a thing (easily).
There it is using the IP address of my first device, but the port is different.

So I will now try to migrate this to my chromecast.things file …

A very good hint Brian, thanks.

Problem solved!

Here is the manual thing configuration which works.

chromecast:audio:floor                [ ipAddress="192.168.1.220" ]
chromecast:audio:sleeping             [ ipAddress="192.168.1.219" ]

/* Chromecast Audio Group - this works with the Google Home Mini */
chromecast:audiogroup:House           [ ipAddress="192.168.1.220", port=42576]

Furthermore I selected “Chromecast Audio Group” as Default Audio Sink.

When I now use the “say” command like this:

say("The alarm has now been activated ...  ")

I get my output on all the chromecast audio devices (all my Google Home devices) which are in the same group as device 1.

Who could update the Chromecast Binding documentation with an example for Chromecast Audio Groups?

4 Likes

Hello,

it seems that i be to stupid to get this to work :frowning:

the cromecast binding and the voice Mary Text-to-Speech is installed and i use openhab 2.3

here is my thing config:

chromecast:audio:schlafz [ ipAddress=“192.168.188.54” ]
chromecast:audio:office [ ipAddress=“192.168.188.53” ]
chromecast:audio:wohnz [ ipAddress=“192.168.188.52” ]
chromecast:audio:kazi [ ipAddress=“192.168.188.51” ]
/* Chromecast Audio Group - this works with the Google Home Mini */
chromecast:audiogroup:house [ ipAddress=“192.168.188.54” ]//, port=8009]//42576]

if i set the port to 42576 i get the following message:

chromecast:audiogroup:house’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Verbindungsaufbau abgelehnt (Connection refused)

if i use the port 8009 / or no port only one of my four google mini talks to me

in my rules file i use this command :

say(“test nachricht”, “marytts:bits1hsmm:deDE”, “chromecast:audiogroup:house”)

can someone explain me what i do wrong here ?

Thanks for your help.

I started to get errors like this too. I seems like my audio groups broke somehow. I’m not sure how. I didn’t make any changes to the system for some time - as I recall, so Im thinking its a software update somewhere that broke the connection.

In my case it breaks and reconnects abit later without doing anything, see the errors below I get

2018-11-28 06:58:10.572 [hingStatusInfoChangedEvent] - ‘chromecast:audiogroup:Benedenverdieping’ changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Connection refused (Connection refused)

2018-11-28 06:59:00.776 [hingStatusInfoChangedEvent] - ‘chromecast:audiogroup:Benedenverdieping’ changed from OFFLINE (COMMUNICATION_ERROR): Connection refused (Connection refused) to ONLINE

google_tts.txt (3.7 KB)

Hello,

I have a problem with Chromecast binding. I have 3 google homes, 1 Chromecast HD and 1 Chromecast audio. No matter witch device I select, I have the same problem/result. In attached file there is a simple rule and result of the rules in case of Chromecast binding. It needs to say “Front door is open” when the sensor triggers. It works perfect with both Google Cloud and VoiceRSS services as well if the output audio channel is system speaker with MP3 support. But I can’t redirect them to any of the Chromecats. All Chromecast makes a wierd beep sound, nothing else. I have Intel NUC windows 10 PC running OH as a service OH ver: openHAB 2.5.0 Build #1490. I have read this problem in several threads and tried the solutions, but non of them worked for me.

@gloeckner_ronny, thank you for your guide here

However, I’m a bit confused about the port numbers. May I ask how did you find this port number? Does it become available when you create a Google Home speakers group from the Google Home app? How to know which speaker of the group is the master one when you set the IP in the audiogroup thing?

I have successfully managed to announce sound on the speakers’ group without creating the audiogroup or adding the port in the .things file and it worked, but not always, it keeps silence.

Steps I did:

  • create a Google Home speakers group using the app on your mobile.
  • from openHAB Inbox, add a new thing, choose the Chromecast binding and it will auto-detect the speakers’ group.
  • to confirm the speakers group is added, go to “openhab-cli console” and run “smarthome:audio sinks” and you will find the group sink already there added or navigate to Paper UI -> Configuration -> System -> Audio -> Default Sink, in the list you will see the speakers group is already showing, make sure you select it (if you want to make it the default sink of your openHAB setup).
  • Now from your rules, you can simply play sound for per action, for example:
rule "Bell"
when
    Item Bell received command ON
then
    playSound("chromecast:audiogroup:1AF620D8-66DE-425F-879A-758509FB473E1","doorbell.mp3"
    Bell.postUpdate(OFF)
end

Never mind, found how to get port number and followed your guide, now all seems working fine.

Just wondering how Google speakers group elects one of the speakers to become the master and assign its IP to the group that I see in openHAB when auto-discover the thing in the inbox?

Hi, how did you get the port number? I just want to play a .mp3 sound

Thank you

First create your speakers group using your Google Home App on your mobile phone. Once done, go to openHAB paper UI -> inbox and scan for the new things. Your speakers group thing will appear there, now you need to add it. Once added, now navigate through your things in openHAB, find the speaker group you just added, click on it, then press edit the thing and click on show more section, you will see it as in the screenshot below:

To add it to your .things file as an audiogroup, you can do that as the following:

chromecast:audiogroup:HomeSpeakers "Home Speakers" [ ipAddress="192.168.8.231", port=42190 ]

The IP address 192.168.8.231 is the IP address of your speakers’ group that’s elected once the speakers group is created.

Once all of this is done, go to Configuration -> System and select it as your default sink:

Then you need to make two more steps to play an MP3 file. For example, you can play the default doorbell.mp3 file located in the default sounds directory:

In your .items file add this line:

Switch Bell "Bell"

In your .rules file add this rule:

rule "Bell"
when
        Item Bell received command ON
then
        playSound("chromecast:audiogroup:HomeSpeakers","doorbell.mp3", new PercentType(100))
        Bell.postUpdate(OFF)
end
2 Likes

Hello,

id do everything as written, but can not get Group initialised. I get

'chromecast:audiogroup:home' changed from OFFLINE (COMMUNICATION_ERROR): No route to host (Host unreachable) to OFFLINE (COMMUNICATION_ERROR): Connection refused (Connection refused)

How can i repair it?

1 Like

Haha, nobody mentioned here and in other threads, that first of all, speakes must be added to group in Google Home App)))
I hope that other will read it and make it faster)))

To answer your question, share the following:

  • items, things, rules configuration related to the speakers

  • did you create the speakers group in your Google Home app, what did you name it?

  • did your speakers group showed in your OH inbox?

  • is your home speakers are sitting on the same local network with your openhab? For example if your OH IP is 192.168.1.x, your speakers should be has an IP from the same subnet 192.168.1.x

I guess perhaps you missed my earlier reply to this post, as I have already mentioned that the first point first is creating a speaker group using Google Home mobile app.

Happy that you managed to solve it.

1 Like