[Request/idea] Chromecast addon

Today the new Chromecast was announced, together with the new Chromecast audio. On the press-conference Google said that they will launch multi-room support for Chromecast audio (hopefully it will work for audio on Chromecast as well).

This will be a very cheap alternative to the expensive Sonos system, which is very well integrated in Openhab.
Would it be possible to make a binding for this, or is Google keeping the cards to close to be able to develop anything?



I’d say it’s a bit too early to tell but I too am interested in it for a potential replacement of some Squeezebox devices I have…

My big question would also be can i Airplay to it from an apple device? I’m android but the rest of the family is apple…

It is probably too early to say. The current generation appears to have been limited to apps written for iOS, Android, and Chrome OS.

You can Chromecast to it from an Apple device but you cannot AirPlay to it. On iOS you will have to be using an app that supports Chromecast such as Pandora, Netflix, Amazon Prime, etc. and cast the media from there.

But, for people who are up for a little DIY, you can set up a Raspberry Pi to be an AirPlay receiver. For awhile I had one set up this way connected to the main TV/Stereo system in the house and it worked really well for both audio and video (except for mirroring which didn’t work at the time but I think now works). For the non-Apple devices it also supported DLNA. Since I got the Roku though my use for the RasPi and the Chromecast dried up and I reused the RasPi in my home automation.

Yeah I currently have a raspberry pi running as a squeezebox client and it also visible as an airplay client so works a treat…
I think i’ll stick with that for a while yet :slight_smile:

Probably a bit early, yes, but I think it has a lot of potential.

Airplay will probably be hard…

OT: How is sqeezebox’s multiroomsupport? Is it possible to play to multiple rooms at once?

Yeah the squeezebox on raspberry pi is great… Multi room is working fine for me…

I use the PiCore package… But am currently testing out Max2Play which has extra features.

Somebody already started: https://github.com/ibaton/Chromecast-Openhab-Binding

Haven’t tried it yet, but I’m planning to.

@TommySharp Maybe I should look into squeezebox… I currently have couple of sonos units, but its really expensive (!!!) so I’m looking into other options… Is there any good tutorials around?

@l_grave I’ve seen it, but it needs much more development. Not very usable at the moment.

@gaute91 Yeah you should… I’d still buy Sonos stuff if I had spare cash lying around because their speakers are pretty good. With a raspberry pi you need to buy a small amp and speakers of a decent quality to be on par with the smallest Sonos speaker. I just bought some amplified computer speakers and put it all into an old busted valve radio, it sounds pretty good… I’m still working on how to get the physical volume and tuning knobs to control the raspberry pi…

1 Like

I just found castnow.
It is a linux tool to controll chromecast via command line.

I think I can cet it to work with openhab.
It will be a quick and dirty implementation, of cause. :smile:

I will keep you posted.

Nevertheless, a dedicated chromecast binding would be great!

1 Like

I think I am ready to share my solution to integrate chromecast ist openHAB.

I wrote three scripts to control castnow.
There scripts can be used by the ecex binding to get the status and title from and send some commands to chromecast via openHAB.
I tested this on a RaspberryPi with Rasbian.

You can find the scripts and more info here: https://github.com/CWempe/castnow_control

Please let me know how this works for you.
And feel free to improve the scripts! :smile:

This is my first git repository.
If I did anything wrong or did not folloow any best practise, let me know. :wink:

1 Like

I uploaded a little demo video.

1 Like

Looks interesting. I have to try this out some time!

It also works with desktop browsers (Windows, Linux, OS X), if you see the the cast icon, the video can be cast to a chromecast device. If you are using chrome, you can cast a tab, which is another way to cast video and/or audio that doesn’t suppport casting.

Correct, this is called vendor lock-in by Apple. The API’s for casting are open, and if Apple wasn’t so worried about locking people in to protect their profits, they would implement casting.

Awesome! Have you given any thought to creating a Chromecast binding rather than relying on putting a couple of things together?

I have not.
And I am not planing to.

I know a dedicated binding would be the best solution.
But I have no experience in developing with java.

“putting a couple of things together” is all I can do. ;D

I started to create a binding for Chromecast based on the Eclipse SmartHome framework. So it will also run on openHAB 2.
At the moment there are three channels:

  • play / pause
  • volume
  • play uri

For me “play uri” is currently the one I would like to use, so I started using this ones.

Need to look for a easy way to install the stuff in the openHAB distribution.
If there are more details, I will report it here.


I tested it with a fresh / clean intallation of the online distribution of “openHAB 2.0.0.b2”

I cannot give any guarantees that this will work for your and not break your openHAB installation. :wink:

Wait until OH is started completely.
Execute the following commands on the Karaf console:

feature:install openhab-transport-upnp
feature:install openhab-transport-mdns
bundle:update org.openhab.jmdns mvn:org.jmdns/jmdns/3.5.0
bundle:install mvn:com.google.protobuf/protobuf-java/2.6.0
bundle:install mvn:org.codehaus.jackson/jackson-core-asl/1.9.13
bundle:install mvn:org.codehaus.jackson/jackson-mapper-asl/1.9.13
bundle:install http://oss.jfrog.org/simple/libs-snapshot/de/maggu2810/shk/bundles/shk-library-chromecast-api/1.8-SNAPSHOT/shk-library-chromecast-api-1.8-20160311.235419-1.jar
bundle:install -s http://oss.jfrog.org/simple/libs-snapshot/de/maggu2810/shk/bundles/shk-binding-chromecast/1.8-SNAPSHOT/shk-binding-chromecast-1.8-20160311.235428-1.jar

Restart openHAB


When executing:

bundle:update org.openhab.jmdns mvn:org.jmdns/jmdns/3.5.0

I seemed to get the following error:

Error executing command: Bundle org.openhab.jmdns does not match any bundle

However the rest of the commands seemed to work and the binding was installed OK.

The commands are just an example what needs to be done.
It depends on the openHAB system and configuration.

You need at least “org.jmdns/jmdns/3.5.0”.
If there has no bundle org.openhab.jmdns installed before, the update will fail.

So, ensure the bundle is installed or use bundle:install…

If your chromecasts are found, then you can ignore this at all. :wink: