Xiaomi Viomi V1/V2 support

Tags: #<Tag:0x00007f32698523a0>

found out a few things about this vacuum cleaner.
Here are my scripts (including remote control):

##############################################################################################################################
### NONO Parameter ###
######################

#############
#LED AN/AUS #
#############
# ViomiLedState
# Off = 0
# On = 1
####################################################################################################################
nono_led:
  alias: Nono - Leds AN od. AUS
  sequence:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{state_attr('vacuum.nono', 'light_state') == 1}}"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.nono
              command: set_light
              params: [0]
      - conditions:
          - condition: template
            value_template: "{{state_attr('vacuum.nono', 'light_state') == 0}}"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.nono
              command: set_light
              params: [1]
  


#################
# Fernbedienung #
#################
# Forward = 1
# Left = 2 # Rotate
# Right = 3 # Rotate
# Backward = 4
# Stop = 5
# Unknown = 10 # Macht einen Ton sonst NICHTS!
####################################################################################################################
nono_vorne:
  alias: Nono - Remote vorne
  sequence:
  - service: vacuum.send_command
    data:
      entity_id: vacuum.nono
      command: set_direction
      params: [1]
    
nono_zuruck:
  alias: Nono - Remote zurück
  sequence:
  - service: vacuum.send_command
    data:
      entity_id: vacuum.nono
      command: set_direction
      params: [4]
    
nono_links:
  alias: Nono - Remote links
  sequence:
  - service: vacuum.send_command
    data:
      entity_id: vacuum.nono
      command: set_direction
      params: [2]
    
nono_rechts:
  alias: Nono - Remote rechts
  sequence:
  - service: vacuum.send_command
    data:
      entity_id: vacuum.nono
      command: set_direction
      params: [3]


#########
# Zonen #
#########
####################################################################################################################
nono_ausleeren:
  alias: Nono - ausleeren bei Mistkübel
  sequence:
  - service: vacuum.xiaomi_clean_zone
    data:
      entity_id: vacuum.nono
      zone: [[-5.8,-1.5, -5, -2]]
      repeats: 1

if you found out more things I would be happy if you share that … Thanks

1 Like

Hi, does multiroom still work for you?
I send this, in nodered

{
    "entity_id": "vacuum.vacuum_viomi_hugo",
    "command": "set_mode_withroom",
    "params": [
        0,
        1,
        1,
        15,
        10
    ]
}

and it cleans just the first room, then returns to dock.

{
    "entity_id": "vacuum.vacuum_viomi_hugo",
    "command": "set_mode_withroom",
    "params": [
        0,
        1,
        2,
        15,
        10
    ]
}

This should work for you

the 3rd position indicates how many rooms are to be cleaned, followed by the room numbers

1 Like

Thanks, it seems it helped, i will monitor it next time. (cleaning is not in history, but second room seems to be vacuued (vacuumed?) too :slight_smile:

Someone already have the Viomi SE workin on HA, I used the custom integration shared here, but doesn’t work with Viomi SE.

2020-12-02 18:08:52 ERROR (MainThread) [homeassistant.components.vacuum] miio2: Error on device update!
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 359, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 466, in async_device_update
await task
File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/miio2/vacuum.py”, line 375, in update
is_mop = bool(self.vacuum_state[‘is_mop’])
KeyError: ‘is_mop’

Viomi SE support

Hi everyone. Anyone help me with this script ?! Everything works except the “repeats”. Whatever number I enter, the robot always makes only one pass. Where am I doing wrong?

giovanni_lettiera:
  alias: Giovanni Lettiera
  sequence:
  - service: vacuum.xiaomi_clean_zone
    data:
      entity_id: vacuum.giovanni
      repeats: 1
      zone:
      - - 1.4
        - 0.4
        - 2.8
        - -1.1
    entity_id: vacuum.giovanni
  mode: single
  icon: hass:robot-vacuum

your entity_id is repeating. please try this.

alias: Giovanni Lettiera
sequence:
  - service: vacuum.xiaomi_clean_zone
    data:
      entity_id: vacuum.giovanni
      zone:
        - - 1.4
          - 0.4
          - 2.8
          - -1.1
      repeats: 2
mode: single

Thanks friend.
Unfortunately, however, it doesn’t work.
Always one step.
Any other suggestions?

I just tried something he hadn’t tried yet.
I used the Xiaomi Home app, selected an area, and selected double cleaning. Not even with the Xiaomi app does the second cleaning.
Very strange.

Correction:
I did another test, using the latest version of the Xiaomi App (the first test I did it using the Xiaomi app which gives me see the token and is an older version)
Using the latest version of the app, the robot Now does the second cleaning. I tried the old version of the app again, and now it does it with that too.
Unfortunately, using the script no results.

Anyone have any idea how to make the “repeat” command work?
Could it be that my model has a different command? Mi home indicates “viomi.v8” as a model

In addition, I’m trying to understand and use the “app_goto_target” command, I’d like to create a script that when launched makes the robot move to a certain point. so I don’t intend to start cleaning but just move off the base and go to that point. Do you think it is possible?

I’ve tried to figure out the room numbers of my xiaomi mi robot vacuum mop by try and error approach but I gave up after trying from 1-50. From the 4 rooms that I have, I could find only 2 of them. Is there any other way to verify the room number? I guess you guys have also re-arranged the rooms (I had to split 1 room and merge 2 other rooms)? Strange thing is that for rooms 12-16 the vacuum goes to one place which is not reachable…

sorry for the noob question but how can I find the token?

vacuum:

  • platform: miio2
    host: 192.168.xx.xxx
    token: xxxx
    name: Bente

I think I found the answer to my question… Get the Xiaomi Home token :slight_smile:

I did the mapping, and I had to divide your rooms by a total of 4. At first I couldn’t find them too, then I got lucky and found 10 11 12 and 13 working. Numbers start at 10 in up.
Which script are you using?

Does this not work for the Viomi V3? I can somewhat “discover” my vacuum in Hassio but is is says unavailable and grayed out text so I can’t control it, any suggestions?

1 Like

I’m using the set_mode_withroom script. Not sure why it doesn’t work… Maybe I’ll try without dividing the rooms. Which device do you have?

xiaomi mii robot vacuum mop we are model mjstg1 i can’t show it in home assistant

vacuum:

  • platform: xiaomi_miio
    host: 10.0.0.134
    token: my token
    name: ‘Living Vacuum’

Help me thanks

I have a new Viomi S9 is it supported?
Thanks