Chromecast bindings

Hi, is anyone else experiencing a long delay 10-30sec) when making commands to chrimecast? When i change the url, pres play or pause or adjust the volume it takes 10-30sec for the command to be executed on the chromecast. Im using chromecast audio, openhabian on rpi3 running OH.2.4.0 . I’m writing this on my phone with no access to my openhab so i will add items, rules and sitmaps files when i get home.

Is there an alternative way of using Google Home as Audio Sink. Then i can uninstall this binding.


My current knowledge is:

  1. Chromecast Binding
    • Able to play media file on a device or group
    • NOT able to send text to use google internal TTS (so you need third party TTS service)
    • NOT able to resume
    • NOT able to broadcast
  2. Node Red in combination with MQTT binding or openHAB node
    • Able to play audio files, videos, internet radios, etc. on a device
    • NOT Able to play audio files, videos, internet radios, etc. on a group
    • Able to send text to use google internal TTS
    • NOT able to resume
    • NOT able to broadcast
    • All openHAB nodes where not stable during my test…
  3. OrangeAssist
    • Could solve all problems, but is more a PoC at the moment…

So… we get caught between a rock and a hard place. :frowning_face:

Any success?

Yeah. We have some new features for node-red. The node-red-contrib-cast learned to talk to groups. So OH + MQTT + NR are my current choice.

It is very sad that there is currently no development for this binding.

I´m trying to cast a jpeg image from openhab to my Google Home Nest Hub. I managed to cast a mp4 video file. But an jpeg image seems to cause some problems. This is what the log says:

2019-06-11 00:43:01.173 [WARN ] [su.litvak.chromecast.api.v2.Channel ] - Error while handling, caused by com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'ERROR' as a subtype of [simple type, class su.litvak.chromecast.api.v2.StandardResponse]: known type ids = [CLOSE, DEVICE_ADDED, DEVICE_REMOVED, DEVICE_UPDATED, GET_APP_AVAILABILITY, INVALID_REQUEST, LAUNCH_ERROR, LOAD_FAILED, MEDIA_STATUS, PING, PONG, RECEIVER_STATUS]
 at [Source: (String)"{"requestId":841,"responseType":"ERROR","reason":"NOT_SUPPORTED"}"; line: 1, column: 33]

Isn´t is possible to cast a simple jpeg image file? If no, which format will work?

This is my rule for this test:

rule    "Image casting Rule"
		Item  HUE_Occu changed from OFF to ON
        logInfo("debug", "motion ON, cast image")
        logInfo("debug", "Image Casted")

It will probably work if the HEADERS are exactly what google is looking for. My guess is it the method that you are using the basic openhab serving of the file that causes it not to work. Changing the headers to what the chromecast expects is probably the missing key. Find an example jpeg that is online that does work and then we can copy the http headers that the working one uses.

I should have a home hub to play with Soon. But it won’t be for two weeks before I have the time to look into it in depth.

I did add the ability to create and serve jpeg files from the ipcamera binding recently and it is possible it will work already I just have not tried it yet as I prefer to cast a full high res and high framerate moving picture which the binding can do.


animated gif also working:

If you place any jpg or gif file into the folder that the ipcamera binding uses it can be served and casted using my code. It is the headers that my binding uses which are the key to making it work and what your methods lacks.

This will work if you place the file in the correct folder that you specify in the config called FFMPEG_OUTPUT


1 Like

I dont understand… When you say headers, I assume it´s the jpeg header you mean?
I tried with an .png file as well, (the same jpg file saved in .png format from Windows10 Paint). It gave exactly the same error.

All I will say is it is nothing that you are doing wrong, and has nothing to do with the file. You can google “http headers” and read a wiki. I have already said the easiest way for u to get it working, tested it for you and replied to you in multiple threads on this.

I know Matt… And I really do appreciate all you´re doing, including your ipcamera binding, which I ofcouse will prefere to use.

Duplicate items in INBOX.

Hi I defined chromecast devices in *.THINGS file
chromecast:audio:speaker1 “speaker1” [ ipAddress=“”]
chromecast:audio:speaker2 “speaker2” [ ipAddress=“”]
chromecast:audio:speaker3 “speaker3” [ ipAddress=“”]

but every time when switching on google home spekaer ON those things reappears in INBOX
Could dev add option to check for duplicates or add option disable auto-discovery please?

Has anyone made chromecast broadcast youtube?

Thing chromecast:chromecast:chromecast01 "chromecast01" @ "media" [ipAddress="", port=8009]


Switch	Chromecast_Test 	"Test CC"	{ expire="1s,command=OFF" }
Player	Chromecast_Player	"Player"	{ channel="chromecast:chromecast:chromecast01:control" }	
Dimmer	Chromecast_Volume	"Volume"	{ channel="chromecast:chromecast:chromecast01:volume" }	
Switch	Chromecast_Stop		"Stop"		{ channel="chromecast:chromecast:chromecast01:stop" }	
String	Chromecast_PlayURI	"PlayURI"	{ channel="chromecast:chromecast:chromecast01:playuri" }	


rule "Chromecast"
    Item Chromecast_Test changed to ON
    //Chromecast_PlayURI.sendCommand("")     // working
    //Chromecast_PlayURI.sendCommand("")                      // working
    //Chromecast_PlayURI.sendCommand("")                // working

    Chromecast_PlayURI.sendCommand("")		// does not work


1 Like

I have a Ring Video Doorbell that MP4’s downloaded to my OH when motion/dings occur; is there anyway to play the MP4 file in an object within Habpanel? Not so much streaming; more like downloading and playing automatically.

I see chromecast has this option; looking for another way.

Best, Jay

widget - frame - url source

I’m assuming you mean iFrame? If so, kinda of looking for something more native with a widget alone. Do you happen to have the code for something like that?

Best, Jay

sorry, unfortunately no

Hi Matt, apologies for pinging after so many years but I’m running into this problem with your ipcamera binding where nothing casts to a nest hub. I’ve tried ipcamera.jpg and ipcamera.mjpeg (generated by ffmpeg).

Mjpeg does not cast, you need
To use hls. See ipcamera documentation.