Overwrite audio source with Alexa?


just getting started with openHAB and its pretty amazing!

I am a bit confused about the alexa integration:

I want to create a rule in openHAB, so it plays a song after my alarm goes off (from raspberry pi, to chromecast audio).

  1. Is it possible to control the audio (played from raspberry to chromecast) via alexa (“play next song”, “pause music”, etc)?

  2. If not, can I overwrite the playback by telling alexa to play a spotify song to the same audio source?

I have done a considerable ampount of alexa integration but not much with chromecast or other media players such as plex even though I have both in my home.
The main issue is the way alexa integration currently works with OH2 is not reqally suitable for an ything other than switches, temperture and lighting.
I have a couple of small exceptions to this in the media space I did integrate a ‘Mute’ rule

in this case I need to say "Alexa Turn on mute’ and she then sends the ON command to the switch item in OH, this runs a rule that sends a buttonpress on my harmony hub to my TV that then sends the IR signal that mutes the TV.

I have a similar setup for un-muting too.

So the first issue for me was the clumsy way to request the mute function. The family and guests would naturally want to say such phrases as "Alexa, mute the TV’.

so to answer your questions

1a. Is it possible to control the audio (played from raspberry to chromecast)
1b. via alexa (“play next song”. “pause music”, etc)?
Not in a intuitive way

As for question 2, I am not 100% clear to me what you are actually saying perhaps further clarity is needed.



1 Like

Thank you for sharing your experiences, much appreciated!

Let me clarify my 2nd question:

Let’s assume I have a Sonos speaker, which is connected to Alexa and OH2. Sonos is playing a song from raspberry pi, after it got triggered by a rule. While the song is still playing, I say “Alexa, play x song from spotify”. So the Sonos would have to switch from playing stuff from raspberry, to playing stuff from Alexa.

Would this work?

no idea, I am afraid I have not gone down the sonos path. but hopefully another member will have palyed in this area.