Chromecast bindings

chromecast
binding
Tags: #<Tag:0x00007fe054bae938> #<Tag:0x00007fe054bae7d0>

(Jean Baptiste Perrin) #1

Hi there,

First of all , thanks to all developper and contributer for this nice project.

Recently, I have observed a new bindings in openhab2.

One that allows to control a Chromecast.

Unfortunately I do not see it in the list of paper IU.

Can you tell me how to install it ?

thank you !


(Kai Kreuzer) #2

It is part of the latest snapshot distro:

Note that it currently is rather in a beta state and has a few issues. It would be great to find someone interested to further improve this binding (I’m myself am lacking the time to dive deeper into it).


(Dominic Lerbs) #3

Is it possible to play YouTube videos via the chromecast binding? I tried sending the URL to the playuri channel but that didn’t work…


(AE) #4

hi there, I was also just recently trying to play with the chromecast binding. volume worked fine, however I tried to send a command to the playuri control, I get the following error. Wondering if anyone knows what might be wrong?

[ERROR] [chromecast.handler.ChromecastHandler] - Missing media player app - cannot process media

error is coming from here:

looks like it requires the CC1AD845 media player or something. Just wondering if anyone has seen this before and knows how to fix?

thanks.


(Kai Kreuzer) #5

Is it a Google Chromecast device or some 3rd party chromecast-enabled receiver? I’ve never seen this message with my Chromecasts.


(AE) #6

mine are LG speakers (HiFi/MusicFlow) with built in chromecast. I am able to cast to them fine using things like stream2chromecast

I think i’ll just create an exec based item to start/stop the streams for now, but would be nice to get the built in chromecast binding working. As mentioned, volume controls work fine, just not the playuri.

I was trying to do something similar to below in one of my rules. I just want a switch which will enable playing my favorite radio stream. Works fine from stream2chromecast

sendCommand(chromecast_playuri, "http://.....)

If anyone has any ideas, would love to know.


(Erik) #7

I have a similar interest in using a switch to select from several youtube URL’s. I tried both regular and embed-type youtube URL’s without success using the Karaf command:

 smarthome:send Chromecast https://www.youtube.com/watch?v=...

However, I was able to get the chromecast (standard HDMI dongle v2) to play web-based mp4 files using the following command in Karaf:

smarthome:send Chromecast http://techslides.com/demos/sample-videos/small.mp4

Looking forward to figuring this one out :slight_smile:


(Vee Cortes) #8

I was able to use the following code to cast the video on OpenHAB2 with the chromecast binding:

Items

Player CastLRTV_Control { channel= “chromecast:chromecast:2aaa81d166fd34024d9ae49a2ebdaaaa:control”}

String CastLRTV_URI { channel=“chromecast:chromecast:2aaa81d166fd34024d9ae49a2ebdaaaa:playuri”}

Switch Play_Switch

Sitemap:

Switch item=Play_Switch mappings=[ON=Play]

Rule:

rule "Play Switch Rule" when Item Play_Switch received update then CastLRTV_URI.sendCommand(     "http://techslides.com/demos/sample-videos/small.mp4") CastLRTV_Control.sendCommand(PLAY) end

(AndroidDeveloperJoe) #9

@veetrik Are you using the Chromecast binding from the PaperUI? I don’t see the “playuri” channel in Paper (only volume and control are there), so I’m wondering if that is my problem. I can get chromecast to play voice commands using “say,” so I’m close!


(Lolodomo) #10

Look at advanced channels.


(AndroidDeveloperJoe) #11

Thanks @Lolodomo - didn’t see it there!

@nallerz did you ever figure out how to stream a youtube video? The mp4 works nicely, but other formats would be great!


(Vee Cortes) #12

Yes I am using the Chromecast binding in the PaperUI in a windows 10 system. I see the playuri when I select show more:


(Erik) #13

Unfortunately this one took a back burner and I have not gotten around to figuring it out. If I find a solution I will be sure to post it… I know there are some very knowledgeable folks on here; maybe they will chime in if the issue is getting some traction. Good luck in the meantime…


(Vee Cortes) #14

Yes I am using the Chromecast binding in the PaperUI in a windows 10 system. You need to click on the ‘see more’ button when looking at the channel items.


(AndroidDeveloperJoe) #15

So I’m up and running with the binding. I can cast audio to a Google Home and video to a smart TV, but I’m getting an error when trying to broadcast to an a Chromecast Audio. It looks like it should be supported. Has anyone ever run into this issue?

ChromecastAudio1PlayURI.sendCommand("https://allthingsaudio.wikispaces.com/file/view/Bzoark.mp3/139196327/Bzoark.mp3")
ChromecastAudio1.sendCommand(PLAY)
2017-03-04 08:55:48.472 [ItemStateChangedEvent     ] - ChromecastAudio1PlayURI changed from NULL to https://allthingsaudio.wikispaces.com/file/view/Bzoark.mp3/139196327/Bzoark.mp3
2017-03-04 08:55:48.632 [ItemCommandEvent          ] - Item 'ChromecastAudio1' received command PLAY
2017-03-04 08:55:48.632 [hingStatusInfoChangedEvent] - 'chromecast:audio:46bcd962cee988d794c539084d2a6f51' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No application is running in ChromeCast

It almost looks like I’m hitting the error at line 240 of https://github.com/vitalidze/chromecast-java-api-v2/blob/master/src/main/java/su/litvak/chromecast/api/v2/ChromeCast.java, but I have no idea what could be causing this. I can’t find any other references to it anywhere.

Thanks in advance!


(Marcus) #16

Hi I’, having problem with my HDMI chromecast I would like to play a file hosted on my http server (local) fileslocated and works with squeezelite bute would be fun to make it work even with chromecast.

Items
Dimmer Volume { channel=“chromecast:chromecast:ffbe7ccc:volume” }
Player Music { channel=“chromecast:chromecast:ffbe7ccc:control” }
String CCplayuri { channel=“chromecast:chromecast:ffbe7ccc:playuri”}

Rule
rule “kitchen_door”

    when
                    Item gDO_kokknapp changed from OFF to ON
                            then
                                    if (gDO_bells.state==ON){
                                                                 CCplayuri.sendCommand("http://192.168.0.4:65535/doorbell.mp3")
                                    Music.sendCommand(PLAY)

but no soiund is played any ideas are wlecomed.


(AndroidDeveloperJoe) #17

Are you also using a Chromecast Audio device? Maybe it’s an issue specific to Audio? Mine works on regular chromecasts, but I can’t get the Chromecast audio to work.


(Marcus) #18

No I’m using normal chromecast for tv, I even tried to set up volume control bute thats doesn’t work either. I added my CC device manually since it didn’t show in inbox.


(Marcus) #19

And today I’vegot my livingroom chromecast discoverd in inbox added that one and linked my channels to that one and things where going better now i can control volume from openhab but havn’t really got the playuri string to work properly anyone whos got an idea of how to make it.


(Daniel Walters) #20

In theory you send a URI to that channel and your Chromecast will play it. But Chromecasts can only play certain file types, what are you sending it?