Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiroom support #6

Open
ZeroZXD opened this issue Dec 24, 2022 · 8 comments
Open

Multiroom support #6

ZeroZXD opened this issue Dec 24, 2022 · 8 comments

Comments

@ZeroZXD
Copy link

ZeroZXD commented Dec 24, 2022

Hello,

Would it be possile to add multiroom support to this like the linkplay Home Assitant integration?

@mitrokun
Copy link

mitrokun commented Jan 2, 2023

As a temporary solution, you can use the Rest API ( https://www.home-assistant.io/integrations/rest )

Here is my example of using to connect and disconnect WiiM to the master (up2stream)

wiim2main:
  url: 'https://192.168.1.72/httpapi.asp?command=ConnectMasterAp:JoinGroupMaster:eth192.168.1.219:wifi0.0.0.0'
  verify_ssl: false
wiimoutmain:
  url: 'http://192.168.1.219/httpapi.asp?command=multiroom:SlaveKickout:192.168.1.72'
  verify_ssl: false

But you can use any other commands from the official API, including on the arilyc website.

@onlyoneme
Copy link
Owner

Hello,

Would it be possile to add multiroom support to this like the linkplay Home Assitant integration?

No plan for that ATM, but you can use @mitrokun solution as a workaround. Commands possibly available for WiiM can be found here:

https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Mini.pdf
https://developer.arylic.com/httpapi/#http-api
https://github.com/AndersFluur/LinkPlayApi/blob/master/api.md

@mitrokun
Copy link

mitrokun commented Jan 2, 2023

Only there is not enough attribute to track the 'slave' state. It helps a lot when building control logic.
There is a 'slave' attribute in Linkplay integration. It would be great if you can add this to your integration. As far as I understand, it is based on the value "group": from JSON, which is received after the status request (http api.asp?command=getstatuses)

@onlyoneme
Copy link
Owner

I guess you've meant getPlayerStatus and type property.
I've added slave and master_uuid attributes taken from upnp interface to the beta branch as I do not use httpapi for player status here.

@mitrokun
Copy link

mitrokun commented Jan 3, 2023

I'm using a translator, and I didn't notice a replacement error :)

image

I have installed the latest beta version of your integration (0.3.2-beta), but, unfortunately, the streamer does not react in any way to the fact that it is in a slave state and plays sound.

image

@onlyoneme
Copy link
Owner

onlyoneme commented Jan 3, 2023

Well, the latest one is v0.3.4-beta actually. New properties are not yet available in v0.3.2-beta.

Regarding player status, it's not reflected when in slave mode. You can check it yourself with getPlayerStatus:

{"type":"1","ch":"0","mode":"99","loop":"2","eq":"0","status":"stop","curpos":"299451","offset_pts":"63860","totlen":"305640","alarmflag":"1","plicount":"0","plicurr":"0","vol":"100","mute":"0"}

I would need to change the code to get the status from the master and propagate to all slaves, but as I said before, no plans for that ATM.

@mitrokun
Copy link

mitrokun commented Jan 3, 2023

image
Thank you very much.

@nbeirne
Copy link

nbeirne commented Feb 11, 2024

Hey y'all I found a few API commands which might change how this looks. LinkPlay supports multiroom for their own components, but we can also do it for any airplay devices (including homepods!!!). It might work with Chromecast or bluetooth as well, but I've not experimented with those yet.

here are a few API commands which I found which can be used to support this:

https://${ip}/httpapi.asp?command=audio_cast:get_speaker_list
https://${ip}/httpapi.asp?command=audio_cast:speaker_disable:${speaker_id}
https://${ip}/httpapi.asp?command=audio_cast:speaker_enable:${speaker_id}
https://${ip}/httpapi.asp?command=audio_cast:speaker_set_password:${speaker_id}:${password}
https://${ip}/httpapi.asp?command=audio_cast:speaker_set_volume:${speaker_id}:${volume}
https://${ip}/httpapi.asp?command=audio_cast:speaker_stereo_group_disable:${group_id}
https://${ip}/httpapi.asp?command=audio_cast:speaker_stereo_group_enable:${group_id}
https://${ip}/httpapi.asp?command=getNewAudioOutputHardwareMode
https://${ip}/httpapi.asp?command=setAudioOutputHardwareMode:${output_mode}

The getNewAudioOutputHardwareMode tells us how the Wiim is currently outputting. The setter takes an integer where 1=optical out, 2=line out, and 3=coax out (for the Wiim pro).

I have a proof of concept using CURL and bash, and it seems to work pretty well just running from my own command line. This is what the Wiim app does to support airplay/casting. The one caveat here is that I found that switching to line-out output will reset the input to Wifi streaming (so if you use a line in as a source, it goes silent after the output switch).

There are many more API commands available to use, I have only scratched the surface here. They are mostly undocumented, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants