Yamaha Restful commands

You can utilize any feature of the Yamaha MusicCast API. Just look at the documentation. Not sure where the originals are so attaching it here. From my understanding you can more or less implement all features that are implemented in official music cast app.

@tom_l Thanks for sharing your work, I realllly appreciate: 95% of the work is done for my Yamaha RX-V4A your are awesome!

I wish with all my respect to what you have achieve here to help others avoid this small error in the code that did prevent my subwoofer level to work at first try :slight_smile:

    cinema_subwoofer_level:
      url: "http://ampli-salon.foxad.net/YamahaExtendedControl/v1/main/setSubwooferVolume?volume={{ ( states('input_number.lounge_subwoofer_level')|float * 2 )|int }}"

for

    cinema_subwoofer_level:
      url: "http://ampli-salon.foxad.net/YamahaExtendedControl/v1/main/setSubwooferVolume?volume={{ ( states('input_number.cinema_subwoofer_level')|float * 2 )|int }}"

Great job again! Have a good one

1 Like

Thanks. Fixed in the original post (and my config!).

Hi Tom,
Unfortunately I’m very new to all this HA coding. I have a musiccast Yamaha receiver and would like to use your excelent remote code. But I don’t know what tot do with this code in this post. Is it possible to make a short manual where tot copy this blocks of code and what should be adjusted to my personal situation. As I said I’m not (yet) familiar with how HA and coding works. This would help me a lot in reaching my goal an d learn a lot how to use this coding bloks.

Thanks,
Rolof

Just use the muisiccast integration.

It will provide all the entities without any need for the yaml above.

Hi Tom,

Thanks for your reply,
Sorry for being a novice but somewhere you have to start learning.
I allready have this Musicast running and I’m already using the avaiable (fround) entities.
But I’m missing a lot of the option you have above. The yamaha does have these options.
Can you tell me how (or if) I can add the missing commands. For instance a extra bas switch or subwoofer level. I know these option are controllable over IP since the official yamaha app can do this.
I hope you can push me a bit in the right direction, so I can add the needed options.

Thanks !!!

Hi All,
I totally not understand how things work. I have a yamaha amplifier RX-V581 which has all the option descibed above. All work from yamaha’s own app (over IP) so it is possible to control this over IP
but when I send: (from chrome)
http://‘MY IP’/YamahaExtendedControl/v1/main/setExtraBass?enable=true
It’s not working. (responc code: 3)
If I send:
http://‘MY IP’/YamahaExtendedControl/v1/main/setEnhancer?enable=true
It works perfectly
So what am I doing wrong (or is going wrong)

Is there anybody who can explain me a bit more on this ??

Thanks
Rolof

The extra base entity is available in the musiccast integration if your amplifier supports it.

I have MusicCast setup, everything works great.

When I choose bluetooth as the input, I want it to display the video feed from HDMI1 as well.

This works fine, except the Bluetooth menu is on top of the screen. I have to use the remote app, use the right cursor button, and press enter.

How can I capture the commands so that I can automate this in HomeAssistant?

It works from the app/remote, so there should be an API call to do it.

Those button presses are not described in the API documentation therefore not implemented. You could try to sniff the network traffic for those commands while using the mobile app and either provide it as feature request to the HA integration (it will take a while) or just implement your own REST commands to implement desired functions.

Btw, for my devices I have the back and arrows on my remote but I don’t have anything like that on the musiccast app. So based on my devices I’m afraid the only way to implement that would be via some kind of universal remote integrated with HA (e.g. broadlink) that would be firing the IR codes.

Yeah, I dont have it in the MusicCast App, but the AV controller does.

I guess I can try to sniff the network. That’s probably going to be the way to find the commands.

Thanks for your help.

OK, I didn’t know that MusicCast devices can be also controlled with AV Controller app. I have it for an amplituner without musiccast. Sniffing the network works for it, I’ve created a couple controls and sensors this way but not for the arrows or enter button.
This app uses a different API and actually there has been some work done already to get the required commands. Have a look at this repo, I think it already includes the cursor and enter commands:

And in one of my posts above you have examples on how to use this api to get data or control options from HA using REST Command integration:

1 Like

Nice, thanks, going to dig into this today hopefully

Just wanted to say this post was eye-opening and a huge help.

Being able to easily switch the input and set an exact volume level is awesome.

I’ve created home assistant helper values to remember the volume for listening to music and another one for my Apple TV so when I switch from one to the other, the volume switches too. Now the volume is always what I want it to be.

Here are some of the commands I use:

  yamaha_input_computer:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setInput?input=hdmi1"
  yamaha_input_music:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setInput?input=audio4"
  yamaha_input_apple_tv:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setInput?input=hdmi2"

  yamaha_vol_7_5db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=146"
  yamaha_vol_10db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=141"
  yamaha_vol_12_5db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=136"
  yamaha_vol_15db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=131"
  yamaha_vol_17_5db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=126"
  yamaha_vol_20db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=121"
  yamaha_vol_22_5db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=116"
  yamaha_vol_25db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=111"
  yamaha_vol_27_5db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=106"
  yamaha_vol_30db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=101"
  yamaha_vol_32_5db:
    url: "http://192.168.1.89/YamahaExtendedControl/v1/main/setVolume?volume=96"

Thanks again for sharing all of this.

Anyone know the restful command to start and shuffle; theres a toggle I think :

http://{host}/YamahaExtendedControl/v1/netusb/toggleShuffle

a (server) playlist? There’s buttons in the Musiccast iOS app in “Musiccast playlists” under the favourites buttons to do it but I’d like to automate running them. I’ve skirted the official documentation but can’t find a reference to them.

Seems that it is not documented but there must be something being sent. You can try to sniff the network traffic between your phone and the device e.g. with Wireshark software.

Another option you have is to store the playlist as a favorite and later recall it using the API (<BaseURL>/v1/netusb/recallPreset?zone=<zone>&num=<num>). I’ve tested it and it works nicely for musiccast playlists which include server files.

OK, so I’ve checked it myself and here it is. The API (undocumented) to play a musiccast playlist is:
<BaseURL>/v1/netusb/manageMcPlaylist?bank=<playlist_number>&type=play&index=<track_number>&zone=<zone>
There are also a few others, you can check below for REST API and example responses from my system.

GET /YamahaExtendedControl/v1/netusb/getMcPlaylistName
{"response_code":0,"name_list":["Playlist 1","Playlist 2","Playlist 3","Playlist 4","Playlist 5"]}

GET /YamahaExtendedControl/v1/netusb/getMcPlaylist?bank=1&index=0
{"response_code":0,"max_line":11,"bank":1,"index":0,"track_info":[{"input":"server","text":"Hello","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"Send My Love (To Your New Lover)","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"I Miss You","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"When We Were Young","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"Remedy","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"Water Under the Bridge","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"River Lea","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"Love in the Dark","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"Million Years Ago","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"All I Ask","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63},{"input":"server","text":"Sweetest Devotion","thumbnail":"http:\/\/10.144.1.162:32469\/proxy\/df5def65beafa7527493\/albumart.jpg","attribute":63}]}

GET /YamahaExtendedControl/v1/netusb/manageMcPlaylist?bank=1&type=play&index=0&zone=main
{"response_code":0}

Updated now also on my repo
Edit:

BTW, I’ve also found this repo, which includes (in the php files) above as well as some other APIs for MusicCast.

1 Like

Thank you so much.

It needed YamahaExtendedControl added before v1 but is working.

For others needing this :

ipaddress/YamahaExtendedControl/v1/netusb/manageMcPlaylist?bank=1&type=play&index=0&zone=1

Will play the first playlist starting at the first track of the playlist.

1 Like

Sure, as per the official docs: <baseURL> is http://{host}/YamahaExtendedControl
:slight_smile:
Happy it works for you too!
Btw, keep in mind that the index starts with 0 and 1 will be the second item on the playlist.

1 Like