Roborock S5 Max, using both with HA and the Roborock App?

You can get tokens from the roborock app, but there are lots of reports that the token often changes with that app, sometimes even at a 24 hr interval. So not really usable at all for the moment.

Mi home app only change token when you reset the wifi settings and sometimes with a firmware update.

More information in this topic: New Roborock S5 Max Vacuum Cleaner

Thanks for the answer.

How do you do that? I haven’t been able to get the token from the roborock app? Changes of the token or not.

As far as I know it’s exactly the same method as with the mi app. Didn’t try it myself as the token changes all the time.

@DendelX - Can you share the code you used to create this card? i.e.

  • Lovelace
  • Config
  • Scripts
  • etc.

I have changed the card since y post it but I can share my config now. Now I use the @3_14 custom component that create a live map camera, great!!.

The card is Vacuum Card and you can find it in hacs:

This is the card now:

Lovelace code is:

cards:
  - actions:
      - icon: 'mdi:play-circle'
        name: Comenzar
        service: python_script.enviar_aspiradora
        service_data:
          room: limpiar
      - icon: 'mdi:cancel'
        name: Cancelar
        service: python_script.enviar_aspiradora
        service_data:
          room: cancelar
      - icon: 'mdi:tools'
        name: Mantenimiento
        service: script.turn_on
        service_data:
          entity_id: script.roborock_punto_mantenimiento
    entity: vacuum.roborock_s5_max
    map: camera.xiaomi_cloud_map_extractor
    stats:
      cleaning:
        - attribute: cleaned_area
          subtitle: Cleaning area
          unit: m2
        - attribute: cleaning_time
          subtitle: Cleaning time
          unit: minutes
      default:
        - attribute: filter_left
          subtitle: Filtro
          unit: horas
        - attribute: side_brush_left
          subtitle: C. Lateral
          unit: horas
        - attribute: main_brush_left
          subtitle: C. Central
          unit: horas
        - attribute: sensor_dirty_left
          subtitle: Sensores
          unit: horas
    type: 'custom:vacuum-card'
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        icon: 'mdi:television'
        name: SALON
        styles:
          card:
            - height: 45px
            - font-size: 10px
            - margin: 5px
        tap_action:
          action: call-service
          service: python_script.enviar_aspiradora
          service_data:
            room: 18
      - type: 'custom:button-card'
        icon: 'mdi:fridge'
        name: COCINA
        styles:
          card:
            - height: 45px
            - font-size: 10px
            - margin: 5px
        tap_action:
          action: call-service
          service: python_script.enviar_aspiradora
          service_data:
            room: 20
      - type: 'custom:button-card'
        icon: 'mdi:door'
        name: RECIBIDOR
        styles:
          card:
            - height: 45px
            - font-size: 10px
            - margin: 5px
        tap_action:
          action: call-service
          service: python_script.enviar_aspiradora
          service_data:
            room: 16
      - type: 'custom:button-card'
        icon: 'mdi:human-male-female'
        name: BAÑO
        styles:
          card:
            - height: 45px
            - font-size: 10px
            - margin: 5px
        tap_action:
          action: call-service
          service: python_script.enviar_aspiradora
          service_data:
            room: 19
      - type: 'custom:button-card'
        icon: 'mdi:washing-machine'
        name: AMARILLA
        styles:
          card:
            - height: 45px
            - font-size: 10px
            - margin: 5px
        tap_action:
          action: call-service
          service: python_script.enviar_aspiradora
          service_data:
            room: 17
  - entities:
      - type: divider
      - entity: input_text.rooms_limpiar
        name: Habitaciones
      - automation.limpieza_automatica
      - cover.puerta_robocochera
    type: entities
type: 'custom:vertical-stack-in-card'



The last 2 entities in card “Limpieza Automática” and “Puerta Robocochera” only are a automation based on alarm system to clean each day when all people leaves home and an esphome controlled garage door for the vacuum cleaner (hidden under the kitchen cabinets). You can delete it.

The buttons, call a python script that I made, this python script concatenate rooms ids, (don’t be cruel, my python is very basic).

This is the enviar_aspiradora.py python_script:

room = data.get('room');
entity = 'vacuum.roborock_s5_max';

input_text = hass.states.get('input_text.rooms_limpiar').state;

if room == 'limpiar':
  input_text_lista = set(input_text.split(','));
  input_text_lista_int = [int(i) for i in input_text_lista];
  service_data = {'entity_id': entity, 'command': 'app_segment_clean', 'params': input_text_lista_int}
  hass.services.call('vacuum', 'send_command', service_data, False)
  service_data = {'entity_id': 'input_text.rooms_limpiar', 'value': ''}
  hass.services.call('input_text', 'set_value', service_data, False)
elif room == 'cancelar':
  service_data = {'entity_id': 'input_text.rooms_limpiar', 'value': ''}
  hass.services.call('input_text', 'set_value', service_data, False)
else: 
  if input_text == '':
    service_data = {'entity_id': 'input_text.rooms_limpiar', 'value': room}
    hass.services.call('input_text', 'set_value', service_data, False)
  else:
    input_text = input_text + ',{}'.format(room)
    service_data = {'entity_id': 'input_text.rooms_limpiar', 'value': input_text}
    hass.services.call('input_text', 'set_value', service_data, False)
  

I hope it is useful

7 Likes

Thanks so much - I will tackle over the next few days.

Hey Folks

I’ve added S5 Max to Home assistant on a very basic level… But i want to further integrate with homekit and show maps and do various things? Is it possible? Just shows as a switch currently in homekit… So no notifications on finish or other controls.

Can anyone guide on how to make this integration full with maps, scripts, zones etc so that we can do automation etc? But new to this so some good scripts copy/paste will help :slight_smile:

Thanks

I found this recently and wanted to share incase it helps anyone with ideas on how to implement w/o API. https://developer.aliyun.com/mirror/npm/package/homebridge-xiaomi-roborock-vacuum/v/0.2.1

Did not expect homekit to get a roborock (app) implementation before HA

2 Likes

how is going the integration of roborock in HA?? i’m interested to can keep both app working: the one that is configure in roborock and try to get the token of this app to share it with HA.
any idea?

1 Like

I wish it were actually HomeKit and not just Siri shortcuts. But yeah…I’m surprised this doesn’t work better with HA.

Yeah especially with how popular the s5+and s4 are. Would love to integrate this.

1 Like

If I connect the roborock to the xiaomi app, this no longer works with the roborock app and therefore with Alexa. Via xiaomi app, alexa does not detect it.

Could you please share the custom app to get token.

Thank!

did you try this already?

if yes, I will need to look up the apk again I used. some digging.

… update few minutes later…
Dud some digging. Here is the apk anyway.

Hi guys, I’m trying to set up my roborock s5 in HA, The system says discovered new device, I have added it into the system, however at every restart device is discovered again and again. What I’m doing wrong?
Also integration can’t retrieve the map, have somebody managed to get it working?
image

1 Like

Roborock S5 Max working 100% on HA, with Xiaomi App.

Is it possible to use the Roborock app now?

I have a quick question.
My roborock s5 is set to turbo mode, and when i give him coordinates to clean,
He first turn himself on on turbo mode - making a lot of noise, and then driving to the requested spot to clean it.

I would like it to set it’s fan to “quite”, drive to the requested area, switch to turbo and then clean.

That way if he passes through the living room for example while i’m watching TV, he doesn’t annoys me.

What i did, is i added a command to the script which first send the vacuum to a near spot (so he drives there quietly) and then start to clean the requested area.
However in reality, once he get to the requested spot - nothing happens he ignores all the rest of the commands.

Any thoughts?

Has anyone been able to get the S5 to work successfully with both HA the roborock app (not xiaomi app)?