Xiaomi Vacuum Media PLayer (for TTS Music and Rado stations )

Dear all,

I was searching for a solution to use my Vacuum more than for cleaing. After a bit of search I found a HACS integration which makes it possible to use the SOX PLayer on the vacuum to play sounds.

Requirements:

Rooted Xiaomi Vacuum with SOX Player activated. If you have Valetudo custom firmware installed then you can install sox manually OR you use on of this frimwares with SOX enabled:

https://vacuumz.info/download/

You can just upload the new firmawre via valetudo webinterface.

After just install HACS custom Integration:

Put in IP of the robot and you are ready to go!. If you need help, please don’t hesitate to ask!

Please watch the repo how to install and eventually update the sound server on the robot .

5 Likes

@thundergreen thanks for creating this topic!

A new version is out with volume control and availability reporting.

P.S.: I’m ready to answer your questions.

1 Like

Yes I already saw and installed it and closed the issue :ok_hand: works awesome thanks so much for your Support. I thought it was absolutely worth making this topic as far as I could find you were the very only one who made this awesome component. The possibilities are just Endless. I will use it as my TTS speaker as the robot is based downstairs.also I can now play radio and control the volume thanks to your quick commit. I hope people will find this threat as it is something very cool for the robot

Hello,
First, thank you for this custom integration, I was able to make it works and, update the sound server so the volume slider it’s there and tts works flawlessly. Nice work, I repeat.
What I didn’t achieve is to play music or radio stations to the vacuum, really noob in HA, indeed the first custom integration I tried…
So, my question is: How to play a sound to this entity?

Just make a service call like this:

service: media_player.play_media
data:
  media_content_id: 'http://metafiles.gl-systemhaus.de/hr/hr3_2.m3u'
  media_content_type: music
target:
  entity_id: media_player.xiaomi_vacuum_player

Tgis has been created in dev tools:

1 Like

Yeah, that works. I tried before with an script but the problem was the media content id, didn’t manage to play local files in the media directory yet…any clue?
Also, the only way I found to stop the streaming was sending a TTS command.
Other thing I noticed it’s that sending the music through the script doesn’t allow to change the volume with the slider (which works with TTS)

You can play files from your www folder. Example: media_content_id: http://hass.lan:8123/local/doorbell.mp3. Media Source integration is not supported.
OK, a stop command will be added soon.
Unfortunately, changing volume for currently playing stream is not possible with SoX player.

1 Like

You can set the volume before playing a file / location / URL and THEN after this you play the stream.

1 Like

A new version with play and stop commands has been released. Play button on the media player card doesn’t work because HA bug - already reported.

1 Like

I love this option :grinning:. However, I fail to see the usecase for it. Does anyone have some example(s) on how they use this in their daily life?

I’m using it with my local TTS component for notifications.

1 Like

When u play music… with a stream for aexample to stop it :slight_smile:

How do you install this manually? I updated my Valetudo and Sox wasn’t apart of that built image, didn’t see option to make it that way. I originally started with PKG file, but couldn’t figure out how to update to new version using that, was using SSH to update it and I cannot figure out how to install Sox manually.

I see this site, but do not see of where I would run this script at.

The easiest way is to flash latest firmware build with python-miio.
Run mirobo --ip "$IP" --token "$TOKEN" update-firmware "$PATH_TO_PKG"

Other option is to place required files manually - look at install script sources.

Thanks, having already installed, what steps am I starting at to do this? I don’t see clear instructions anywhere I looked to perform an upgrade.

Just run mirobo --ip "$IP" --token "$TOKEN" update-firmware "$PATH_TO_PKG" to upgrade.

Token is wrong, can’t get proper length one or correct one at places to look for it.

I feel like I keep making progress, but ultimately this is far from an easy task. I reset the WiFi to refresh the token, pulled it prior to connecting back to WiFi again XVacuum Firmware app, but that token doesn’t work either, seems like maybe it changes afterwards, but the device.token file is half as long as the token actually is.

Even if token was right, I would seem to still get the following error at end.

“ValueError: non-hexadecimal number found in fromhex() arg at position 2”

I looked over the command very carefully. This whole thing is a nightmare, regretting all the hours I’ve wasted trying to fix one particular thing.

You need convert 16 char token - paste it there.

You can also use python-miio to get token: mirobo --debug discover --handshake true

1 Like

Thanks, that is what I was missing. All good now.

I would love to use this, but I cannot find a way to install sox to my S5 Max. The image builder project support only gen 1 and gen 2 roborocks, but mine appears to be gen 3.

Any suggestions?

Thanks.