Yamaha musiccast binding

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

Agreed. I’m trying to reverse-engineer the commands so that I can have some automation on my Yamaha receiver. I will post a tutorials for newbies on how to sniff the packets and translate them to a command once I get this working.

No need to reverse engineer. The commands are made public by Yamaha (by a massive excel spreadsheet). You can also have a look at the binding source code.

1 Like

David, thanks for the prompt replies. Are you referring to “V673_3073_FuncTree_1.7a.xls?” I had downloaded some time ago but I did not understand how to use it. I went back just and I reread the instructions and generated a power control message.

image

So how do I insert that in a sendHttpPostRequest(String url, String contentType, String content) command? Is the following correct?

sendHttpPostRequest("http://192.168.1.xxx/YamahaRemoteControl/ctrl HTTP/1.1,?xml version="1.0" encoding="utf-8"?,YAMAHA_AV cmd="PUT"/System/Power_Control//On/Power/Power_Control/System/YAMAHA_AV?

Also, which binding source code are you referring to?

I finally got it to work. Attach are the commands I used to power on and off my receiver. The payload contents did not need to be transformed. It needs to be encased in ‘{}’; otherwise the quotes in the string would mess up the logic. The next step for me is to obtain status, parse the data, to update the state. It would be best if this was handled within a binding.

/* Yamaha Receiver Power */
rule “YamahaPwr”
when
Item YamahaPwr received update
then
if(YamahaPwr.state==ON){sendHttpPostRequest(“http://192.168.1.XXX/YamahaRemoteControl/ctrl”,‘{?xml version=“1.0” encoding=“utf-8”?}’,‘{<YAMAHA_AV cmd=“PUT”><Power_Control>On</Power_Control></YAMAHA_AV>}’)}
else if(YamahaPwr.state==OFF){sendHttpPostRequest(“http://192.168.1.XXX/YamahaRemoteControl/ctrl”,‘{?xml version=“1.0” encoding=“utf-8”?}’,‘{<YAMAHA_AV cmd=“PUT”><Power_Control>Standby</Power_Control></YAMAHA_AV>}’)}
end

Once again. There is already a Yamaha binding. No need for reinventing the wheel here.

David, the Yamaha binding uses the YXC protocol. My receiver needs a YNC binding. I installed the Yamaha binding that came with Openhab 2 and it could not initialize my receiver. Is there a YNC binding?

Nope we do not implement the extended json based protocol yet. The binding implements the XML based protocol. Might be a bug if it couldn’t connect, have u tried a recent version?

David, would it be difficult to make a copy of the Yamaha Musicast (YXC) binding and modified it for Yamaha receivers that support YNC? I’m not a programmer but I would be willing to go through the code to replace the URL structure and use the spreadsheet to replace the YXC commands for YNC as well as do debug testing. I did reinstall your binding and it recognizes the receiver but states that it can’t be initialized.

Can u please elaborate on what yxc means for you? For me it means Yamaha extended control protocol and is the newest available protocol. Ync is unknown to me. The old protocol was XML based and the first that Yamaha introduced for ethernet receivers. --edit: Apparently the old protocol was called Yamaha network control: ync. Got it.

The Yamaha binding was prepared recently to also support the new protocol. But I don’t have time to actually implement this at the moment. It is more than just replacing urls. There need to be code written. Actually not much code, a json library will translate to java objects. But it’s still a programming task.

Cheers David

Hi Team,

any news on this? Would love to use my MusicCast Setup as an alarm clock with openhab…

I probably could use the snippets provided by @ysc but i’d need to have some info on how to set the input on a master MusicCast Device - and preferably also how to switch to a certain preset.

If i could achieve this, i’d be set so far and can wait until someone with a lot more programming experience than i have has got time to update the current Yamaha binding to also support Musiccast

Thanks for any feedback in this direction!

Best regards,
Klaas.

1 Like

Dlna is a very old standard with limited codecs and bitrates allowed. And it also never worked with any device for me. On the implementation side it seems to be quite tricky to do it right. One of the proprietary protocols will win eventually. Might be Chromecast, alljoy, or Yamaha musiccast or whatever else.

Cheers David

1 Like

And isn’t openHAB just about bringing toghether and bridging as many protocols as possible under one roof?
So i’d say that we should try to develop for all major protocols to enable a seamless usage of various devices in a house.

As you said in another thread @ganesh.ingle: Music is different for everybody, so i think, openHAB should have something for everyone. :slight_smile:

I’m very happy with MusicCast so far and a working binding for Musiccast would be awesome - although http-Binding works for the time being.

Best regards,
Klaas.

3 Likes

That post doesn’t make any sense to me ganesh. How do you play synchronous multiroom music only with Kodi? Wire all speakers to a central AVR with multiple zones? Yeah possible but hardly convenient. By the way, most if not all musiccast components support DLNA. And you can of course use Kodi as a source to play music on your musiccast Network.

Two different Solutions for two different Problems.
Kodi: Audio Source
Musiccast: Network for WifiSpeaker & Co to play multiple or one source on multiple speakers at the same time

1 Like

So The Musicast API is documented and open for use for Developers! ( Posted in this Thread)
Also as I said Yamaha pretty much supports all protocols it could. So if there would be a Protocol like you described and it would gain traction. Yamaha ( and others) would probably integrate it as well.
And in all honestly, Yamaha has been around in Audio much longer than Logitech. I agree that Logitech might be more active towards the Community as they have an IT Background.

Just found my Post with the API Documentation Yamaha musiccast binding

1 Like

Hi @ganesh.ingle,

You made your point and i think everyone got it now.
If you think a native musiccast binding is not the best approach, i think this is perfectly fine for everyone here.
Some people have another opinion about this and if you respect those people it should be fine for you too to accept that.

If you want to talk about openhab as a possible distributor of a standard, a separate -topic related- discussion would be the best maybe.
At least better than flooding this topic now with off-topic content.

I definitely wouldn’t consider myself a developer. Even if I don’t really understand what that adds to the matter. I have a pretty good understanding of programming and how different types of programs work though. Due to my job I also work a lot with Restful APIs.
I don’t really understand why yamah should release an SDK isn’t that usually used to develope for a specific Plattform? Like the iOS SDK or a Java SDK? If you want your program to run on a MusicCast box then you would need a MusicCast SDK.
That’s not what anybody intends to do. Instead of this Yamaha MusicCast provides a API which is restful btw. This gives you the ability to write a program on whatever platform you want to and interface with MusicCast. Platform agnostic if you want so.
What is very helpful is of course an library for specific languages so that you don’t need to code all the calls one by one.
And yes there are community created libraries I saw python and java so far.

1 Like

May I raise my hand also to show interest in the MusicCast binding. The open-source, inofficial, non-profit one if it was up to me - whatever is on market first!

Unfortunately I am not only new to openHAB but also a poor contributor for a solution. I just can offer cheering, testing and learning.

1 Like

I think I understood that you are not going to support this binding.