Xiaomi network Speaker

Did anyone get home assistant to work with Xiaomi network speaker? Its a Wifi speaker that supports internet radio, DLNA, Qplay, app support etc.

https://www.gearbest.com/speakers/pp_590443.html

Depends on what you want to use it for. I have it but I’m not really using it as it cannot play sound directly from network sources (e.g. the internet radio works by adding radio stations approved by xiaomi to it and then those can be controlled). DLNA & Airplay are working fine, but I’m not sure what would be the best way to integrate this into homeassistant.

For DLNA it uses the standard UPnP/DLNA endpoints over SSDP, changing the settings works also over SSDP with their own SetValue/GetValue method calls. I have some code for that if someone is interested in working on a library to get more of its features supported I can maybe be of help. However, in its current state it is not really useful for end-users.

Hi,

Do you have news about add this device in HA? maybe @syssi can help to add?

Do you know if supports multiroom?

I ask this, because i’m interested.

thanks

The device integration will be time consuming because the exposed features via the miIO api is very limited and not really useful for end-users as @teprrr stated. We should focus on other devices to integrate.

Hi,

I just got mine and to integrate it in HA, I installed logitech media server (squeezebox) with the upnp/dlna plugin. Once setup and platform: squeezebox added to the config.yaml, I’ve a new media_player.wifispeaker in HA.

3 Likes

Thanks for the idea,
what was the profile you choose under ā€˜Apply pre-defined player profile’ for Xiaomi network player.

Credits go to https://lesbonstuyauxgeeks.fr/test-enceinte-reseau-xiaomi-mi-wifi-smart-network-speaker-dlna-airplay-smb
For the profile, I’m not sure anymore, I think I left it blank, but then I also have a ggmm-m4 speaker and I took the ggmm-e5 profile.
When using tts (google_say) I’ve noted a delay of 8 seconds, so the first words are cut off, I’m not yet sure if this is HA related or rather some LMS setting.

Hello,

I have been trying for several days to install plugin / dlna plugin in my raspberry pi but I do not know how to do it.
Could you tell me the commands and the process used to install it?
I am using hassio installed on a raspberry pi.

Thank you!

Hi,
You need a machine where you can run the Logitech Media Server, I’m not sure that this can be done on the same RasPi with Hassio. I installed the server on a Linux machine.
Once installed and the component activated in HA, activate the ā€œUpnP/DLNA bridgeā€ plugin and start the bridge, it scans for available UPnP speakers in your network and add your speaker as new player.
Once this is done, HA should see this player as new media _player.
I don’t use this configuration any more as I no longer have the Mi-Speaker any more so can’t share any more details unfortunately.

Thanks for your help,

Finally I decided to install it in a macOS to test and I managed to make the logitech media server plugin upnp / dlna recognize my device and this appears in the list of players, also in HA as a media player.

The problem is that I can not reproduce any sound on the speaker, either through HA with tts or an mp3 in local or through logitech media server. I can add the audio and see it through HA but when I click on play it does not respond.

Attached screenshot of my plugin configuration UPnp / DLNA in case anyone can help me.

1 Like

it may be issue with codec. Under LMS- Setting-advanced, check the file types. Check the codec selected against each file type. if any file type is disabled, you may have to enable it.
FFmpeg is one such codec you can focus on

I think you have a reason and it’s a codec problem because the Logitech server log shows me the message: ā€œError: Could not create the command line for mp3 playback forā€, it also happens to me if it’s a radio station or music file through the server.

I still have not managed to fix it because I find very little information about the server. I tried changing the codecs settings but it did not work.

If I can finally solve it, I will write the solution here.

Thanks for the help.

in the Upnp bridge plugin, stop the bridge,
Under common parameters - >Transcode - change to flac -> start the bridge
This works for Xiaomi Speakers.

Most online radio are in m3u8 format which is not supported by default in LMS. You can search for Play HLS plugin and install the same to play online radio streams.

But ffmpeg should be install on the box for most formats to work.
hope it helps

1 Like

As I was not very happy with this speaker, I opened it and replaced the xiaomi motherboard with a raspi (+amp). I still didn’t figure out if it would possible to use the top buttons but for now it works fine with Volumio.

1 Like

Mi network speaker is working with the new media Brower + DLNA. check it out.

Will throw out my Xiaomi shit-speaker. Cant get it to work properly with HA. I can see it as an entity but not avaliable as a source anywhere.

Sonos here we come!

for me yesterday speaker arrive and is work ok with Logitech server and Music Assistant, without any problem

When you say

does it mean it needs the logitech server to work, or can it work in Music Assistant without it? Thanks for clarification.