AlexxIT / VacuumZones

Control zone cleaning for Xiaomi vacuum cleaners from voice assistants and Home Assistant
https://github.com/AlexxIT/Blog
72 stars 4 forks source link

repeats when cleaning a room #5

Open G1K opened 2 years ago

G1K commented 2 years ago

When cleaning a segment, there is no repeat option, although the application does. The miio service also does not have this parameter, and it’s impossible to add this parameter just like that.

There is a way to use sending a custom command

service: vacuum.send_command
target:
  entity_id: vacuum.xiaomi_vacuum
data: 
  command: app_segment_clean
  params:
    - segments:
        - 17
      repeat: 2

Or if you change the component code, for example like this


        if 'room' in self.config:
            await self.hass.services.async_call(
                'vacuum', 'send_command', {
                    'entity_id': self.config['entity_id'],
                    'command': 'app_segment_clean',
                    'params':
                        [
                            {
                                'segments': [
                                    self.config['room']
                                ],
                                'repeat': self.config.get('repeats', 1)
                            }
                        ]

                }, blocking=True)
AlexxIT commented 2 years ago

Just repeat segment number multiple times