Xiaomi Miio Vacuum questions

Hello everyone,
I am trying to make a custom UI for myself and would really like to implement specific commands of the Xiaomi Miio Vacum controls (Roborock S5 Max in my case).

When I left click on the automatically generated entity for the vacuum, I can set all kinds of things, including fan speed etc. etc.
But where can I find the code for all these features?

I would basically like to add this:


to a grid card and organize it properly. But I cannot find the code for this anywhere.

Could someone help me with this? I thought it should be in one of the yaml files but I could not find it.

Thank you
Alex

They are attributes of the sensor. You can see them in the Developer tools / State menu.

Open your Home Assistant instance and show your state developer tools.

You can add attributes to entity cards (and some other cards).

Otherwise you can break the attribute out into it’s own sensor using a template sensor.

1 Like

Perfect, thank you!

May I ask one more thing, that is not directly related: if I now want to show an attribute, e.g. the current fan_speed, how do I add this without any icons, entity name etc. Just the pure text of the result?
I tried creating a manual card with

type: entity
entity: vacuum.roborock_vacuum_s5e
attribute: fan_speed
show_name: false
show_icon: false

or

type: state-label
entity: vacuum.roborock_vacuum_s5e
attribute: fan_speed

but it doesn’t work.

Those options are only valid for the glance card

type: glance
entity: vacuum.roborock_vacuum_s5e
attribute: fan_speed
show_name: false
show_icon: false

The other option would be a Markdown card:

type: markdown
content: >
  {{ state_attr('vacuum.roborock_vacuum_s5e', 'fan_speed') }}
1 Like

Ah, very nice. Now we are getting somewhere. I guess it is not possible to define indidvidual background colors, text colors or fonts without creating themes? Like with simple syntax alla background_color: #000000 ?

One more thing, since the markdown works nicely but I was playing also with Picture Elements Cards, how do you implement it there? Picture Elements does not offer a visual editor, only code. And it seems I cannot use either your markdown syntax nor any of mine above.

I could only find an approach in which a sensor is created for each attribute. Something I am hesitant to do right now.

Have a look at card-mod for styling.

For the picture elements card use the State Label