Yamaha musiccast binding

Thanks a lot! that’s great, this will accelerate my learning in this area of OH. :slight_smile:

Glad to see that there’s something going forward in this topic. :slight_smile:
I was really busy with things i had to do for my master degree
and Master thesis will take some time too in the 2nd half of this year,
but i will try to push this topic forward again in the next time.

Your reverse engineering and created stuff looks great btw.@ysc

1 Like

I was looking around a bit and found this:

I dont know if it could help us, but wanted to pin it here.

This seems to be controlling musiccast from code, but has anyone looked into creating a zone for a linux server? Then I can stream to it. Was thinking a Raspberry PI in the garage.

Hey ysc,

i assume the two green buttons set the input t spotify and start the respective playlists? How does that exactly work. That would be lovely to be able to select at least some standard playlist to play on musiccast. even better would obviously an option to brows through spotify

@Tomibeck sure, but it’s not exactly MusicCast, it’s actually a channel of the yamahareceiver binding.
So it will only work with a receiver capable of communicating with the legacy protocol.

What I found is you can add favorites with the MusicCast app to your receiver, including Spotify playlists (just use the context menu & add to a favorites slot while you’re playing it):

Then using an item linked to the “netradiotune” channel, like this:

Number Yamaha_NetRadio  "Net Radio" {channel="yamahareceiver:yamahaAV:xxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx:netradiotune"} 

You can send a playlist number to the item and it will tune your receiver to the corresponding playlist, including those which “rotate” once a week like Discover Weekly and Release Radar.

Hey @FrankZimmer,

Would it be ok if i host your already existing code on GitHub to have a public base for contributing to the binding?

If yes it would be great, to have your “signed off by”-data to mention it within commits. :slight_smile:

Hi, I’m just trying to show the AlbumArt on the HABPanel…
Right now I managed to get back the current jpg, but the beginning of the link seems to be missing…

String Ymh_sz_Aurl	"albumart_url"	{http="<[http://192.168.77.78/YamahaExtendedControl/v1/netusb/getPlayInfo:3000:JS(ymh_sz_albumart_url.js)]"}

returns the following:

/YamahaRemoteControl/AlbumART/AlbumART4415.jpg

Has anybody an idea how to modify the script to get

http://192.168.77.78/YamahaRemoteControl/AlbumART/AlbumART4415.jpg

Hardcoding it in ymh_sz_albumart_url.js is not an option?

var urlbase = "http://192.168.77.78"

// Get the Albumart url from API
var albumart_url = * here goes the code *

return (url_base + albumart_url)

You just have to manage that the device always gets the same ip,
but you have to do that anyway for the http binding.

(Of course a dynamic solution would be more comfortable, but this should work for now.)

Off-Topic:

I didn’t imagine that i am owning 22% of the whole topic. :smiley:
Sry for that.

Hi,

here you get the Code

1 Like

Hey all,

I prepared the Yamaha binding to include the new Json based protocol. Yamaha calls it Yamaha extended control protocol. It is exclusively used in all AVRs produced later than ~2013 and therefore the addition is a good thing to have.

The first step is this PR:

If anybody wants to help implementing the actual protocol (based on the linked java library for example), you are very welcome.

Hopefully we get this protocol merged fast.

Cheers,
David

1 Like

It might make sense to include the album art URL in a separate channel, what do you guys think?

Amazing! I’m really looking forward to test it with my RX-A2060 and two WX-030s

Very cool indeed!

It might make sense to include the album art URL in a separate channel, what do you guys think?

Or even image items?

https://github.com/eclipse/smarthome/blob/master/extensions/binding/org.eclipse.smarthome.binding.sonos/src/main/java/org/eclipse/smarthome/binding/sonos/handler/ZonePlayerHandler.java#L670

An AudioSink implementation would also be awesome - similar to this:

I was looking for a standard image type. In the linked source code they use a RawType. I’m not sure if all UIs (android, iOS, Habmin, ClassicUI) can render this? With a StringType assigned to an Image in a sitemap they would all be able to display it, I guess.

@David_Graeff check out the remark from @Kai here for a similar feature in the Kodi binding:

I think ImageType is preferable to an URL when possible now - all UIs support it.
If I’m not mistaken it’s simply a RawType with an appropriate content type which is handled automatically by HttpUtil.downloadImage(url) - have a look at the commit by @cweitkamp here: https://github.com/openhab/openhab2-addons/pull/2304#issuecomment-320505293 and https://github.com/eclipse/smarthome/pull/3457.

I have a question that is somewhat related. I’m trying to issue HTTP commands to my receiver. I captured the messages using wireshark so I know it uses /YamahaRemoteControl/ctrl HTTP/1.1. However, I don’t know how to compose the sendHttpPostRequest(String url, String contentType, String content) message. I’m getting confused going around in circles. Here is a snippet of a trace.

POST /YamahaRemoteControl/ctrl HTTP/1.1
Host: 192.168.1.xxx:80
Content-Type: text/xml; charset=UTF-8
Connection: keep-alive
X-AppName: NP_CONTROLLER/4.50 (iOS)
X-AppPort: 53163
Accept: /
User-Agent: NP_CONTROLLER/4.50 (iOS)
Content-Length: 125
Accept-Language: en-us
Accept-Encoding: gzip, deflate

“<?xml version="1.0" encoding="utf-8"?><YAMAHA_AV cmd=“GET”><Basic_Status>GetParam</Basic_Status></YAMAHA_AV>”

Can someone help in getting me started. Thanks.

take a look at his:

https://github.com/rsc-dev/pyamaha/tree/master/doc

Thanks Christ for replying. I looked at those documents some time ago but the protocol on my receiver is not YXC. That is why I had to sniff the wire to capture the messages. I tried to follow the example that Yannick gave early on but I’m not getting far. First, I don’t know if I should use the Openhab.core Http action or the HTTP binding. Second, I don’t know If I have the syntax correct. I tried using a HTTP editor to test out the syntax but I get Http 404 messages back. I believe Yannick in his example query to get a status and json for power and then issued the respective commands. I would like do something similar. The following is the message sent to the Yamaha reciever when power is turned on.

image

What are you trying to archive that is not handled by the Yamaha binding?

That feature might just need to be added.

Cheers, David