Change chromecast device

Hi, with my google home i have the possibility to say “move the music to bathroom” (in german: spiele weiter im badezimmer)
Is this also possible with the chromecast binding?
So if there are motion detectors it detects that i am entering a new room and continues playing there instead of the living room?
Or when i say i go to bed that the music is changing to the sleeping room?

Interesting thought. You could test this by stopping a Chromecast’s audio stream via openHAB and then starting it on another one of your Chromecasts (also via openHAB) to see if it picks up where the original one left off.

Saying that, this kind of presence-detection automation can prove to be challenging. For example, any time you go back to the bedroom to grab something you left there, your music is going to try to jump to that device and then jump back when you go to the living room. And if there are other humans/animals setting off your motion sensors, you might find the overall experience less than stellar. You could get around this by having a “follow me” mode that you have to turn on/off, but then you might as well just be giving voice commands to Google.

Do I need to group them in Openhab? Because how should device2 know that device1 stopped playing?

Yes I already thought about this.
I also had the idea to move the device when i use TTS, because currently the stream is stopping when I use “say()” in a rule. When i move the device to one idle device, set volume to 0, then use the say on the device in the living room and afterwards move the device back and change volume of the idle device back i could get my notifications work without stopping the stream afterwards

I don’t think grouping them in openHAB will do anything. What matters is if Google understands that you want to resume on another device. All you can do in OH is pause/stop on one and play on another. I’m doubtful that this will work, as the “move music to bedroom” voice command gives specific instructions on what Google should do.

Groups wouldn’t work for that. You would need to write Rules.

ok, that would be no problem. But i only see a appid so i do not know how i could tell in a rule that the device should be changed