[SOLVED] Chromecast binding - set image (channel image) manually to a PNG file


if I play an internet radio station on my chromecast (not a local mp3 file), no cover will be displayed. I would like to set the cover manually (PNG file in the file system), is that possible and if so how?

Image Chromecast_Audio1_Kitchen_Image "Cover" { channel="chromecast:audio:Chromecast_Audio1_Kitchen:image" }
rule "play an mp3 file or radiostream ..."
    Item  Chromecast_Audio1_Kitchen_Trigger changed
    try {
    catch(Throwable t) {
      logError("Chromecast_Audio1_Kitchen", "Error " + t.toString())
    // here I would like to set the picture of the radio station!
	Chromecast_Audio1_Kitchen_Image.postUpdate("radiostaion.png") // ?????
2018-10-21 19:24:27.144 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert 'radiostaion.png' to a state type which item 'Chromecast_Audio1_Kitchen_Image' accepts: [RawType, UnDefType].

You need to store the image in the html folder of openHAB.
Then you do:


I don’t know it that will stop the radio playing though…

Unfortunately that does not work:

2018-10-22 19:56:41.185 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '' to a state type which item 'Chromecast_Audio1_Kitchen_Image' accepts: [RawType, UnDefType].

jpg returns the same error.

here is the solution:

convert the picture with e.g. https://www.base64-image.de/ and then:

// the coded picture is shortened here

by the way, the radio does not stop playing!

Thanks for this wonderfull solution! I was always working with separate items to display these kind of images.