- Platform information:
- Hardware: Raspberry pi4
- OS: Openhabian
- Java Runtime Environment: 17.0.7
- openHAB version: 4.0.3
I’m having an issue with the Chromecast binding. I wanted to play a URL from youtube music playlist, like: YouTube Music from within a rule. I tried two ways of loading the url but both gave me the unable to load media error. First I tried to load the Channel: “chromecast:audiogroup:Audio:playuri” with an Item (i’m running fully text based) and I tried the Actions method:
castActions.playURL("https://music.youtube.com/watch?v=UCvX656hxHk&list=OLAK5uy_mUT61aE7EqrjT5tFRrbI23qnwSuZN50s8")
I tested the Say command with the chromecast audio, and that just worked. So I searched a bit on the forum and found a couple of topic where the use of Services.cfg could work. Not sure how and why but I tested it. I created the services.cfg file in the Services directory and added the code:
binding.chromecast:callbackUrl=http://192.168.0.227:8080
&& also:
binding.chromecast:callbackUrl=http://192.168.0.227:32000
But that didn’t help and still got the error.
[.openhab.binding.chromecast.internal.ChromecastCommander] - Unable to load media: http://192.168.0.227:8080/audio/ff6c2252-b1cf-431d-afb0-f2c667547efb
With debug:
2023-11-07 22:36:30.725 [DEBUG] [nhab.binding.chromecast.internal.ChromecastEventReceiver] - Received an 'UNKNOWN' event (class=class com.fasterxml.jackson.databind.JsonNode)
2023-11-07 22:36:31.924 [DEBUG] [.openhab.binding.chromecast.internal.ChromecastCommander] - Application launched: CC1AD845
2023-11-07 22:36:32.284 [DEBUG] [nhab.binding.chromecast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 12303, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: Media{url: http://192.168.0.227:32000/audio/6b17824c-3162-44b4-b066-4969359a4e6b, contentType: audio/wav, duration: null}, repeatMode: REPEAT_OFF, idleReason: null}
2023-11-07 22:36:32.349 [WARN ] [.openhab.binding.chromecast.internal.ChromecastCommander] - Unable to load media: http://192.168.0.227:32000/audio/6b17824c-3162-44b4-b066-4969359a4e6b
2023-11-07 22:36:32.386 [DEBUG] [nhab.binding.chromecast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 12303, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: null, repeatMode: null, idleReason: ERROR}
==> /var/log/openhab/events.log <==
2023-11-07 22:36:32.402 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GoogleTitle' changed from Notification to UNDEF
==> /var/log/openhab/openhab.log <==
2023-11-07 22:36:33.424 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Type: Nest Audio
2023-11-07 22:36:33.425 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Found: 192.168.0.227 8009
2023-11-07 22:36:33.426 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Type: Nest Audio
2023-11-07 22:36:33.431 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Cast Group
2023-11-07 22:36:33.432 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Found: 192.168.0.227 32000
2023-11-07 22:36:33.433 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Cast Group
2023-11-07 22:36:33.437 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Type: Nest Audio
2023-11-07 22:36:33.438 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Found: 192.168.0.238 8009
2023-11-07 22:36:33.439 [DEBUG] [mecast.internal.discovery.ChromecastDiscoveryParticipant] - Chromecast Type: Nest Audio
2023-11-07 22:36:36.304 [DEBUG] [nhab.binding.chromecast.internal.ChromecastStatusUpdater] - MEDIA_STATUS null
So I removed the services file. But I noticed, the say command didn’t work anymore and also gave the log error. I added the services.cfg file again, empty and with another port. That didn’t do anything. I restarted Openhab, also without result. So I stopped the openhab service, cleaned cache and restarted. Again the same error when using anything regarding the chromecast. So I deleted the Chromecast Thing and added a new one. But it’s the same error with the new one.
I’m completely lost with this one. Not sure why the error persists. I’m hoping I could play a playlist from youtube music, that would open the door to NFC tags loading a playlist to my chromecast audio speakers. But most important, I want to be able to send TTS voice audio to my chromecast audio speakers.
Anyone a clue in the right direction where to search?
[edit] - The binding works when I play music, I see the song info and artist and i’m able to pause the music / change volume etc.