name: Robot vacuum
products:
  - id: kkwwtmio4plq4d9r
    manufacturer: ILIFE
    model: V30
entities:
  - entity: vacuum
    dps:
      - id: 1
        type: boolean
        name: activate
        mapping:
          - dps_val: false
            constraint: pause
            conditions:
              - dps_val: true
                value: false
              - dps_val: false
                value: false
                hidden: true
          - dps_val: true
            constraint: pause
            conditions:
              - dps_val: false
                value: true
              - dps_val: true
                value: true
                hidden: true
      - id: 2
        type: boolean
        name: pause
        hidden: true

      - id: 4
        type: string
        name: command
        mapping:
          - dps_val: smart
            value: smart
          - dps_val: chargego
            value: return_to_base
          - dps_val: zone
            value: zone
          - dps_val: pose
            value: clean_spot
          - dps_val: part
            value: partial
          - dps_val: edge
            value: edge
          - dps_val: explore
            value: mapping
          - dps_val: exploreclean
            value: clean_while_mapping
      - id: 5
        type: string
        name: status
        mapping:
          - dps_val: standby
            value: standby
          - dps_val: smart
            value: smart
          - dps_val: zone_clean
            value: zone
          - dps_val: part_clean
            value: partial
          - dps_val: cleaning
            value: cleaning
          - dps_val: paused
            value: paused
          - dps_val: goto_pos
            value: seeking_spot
          - dps_val: pos_arrived
            value: located spot
          - dps_val: pos_unarrive
            value: left_spot
          - dps_val: goto_charge
            value: returning
          - dps_val: charging
            value: charging
          - dps_val: charge_done
            value: charged
          - dps_val: sleep
            value: sleep
          - dps_val: edge
            value: edge_cleaning
          - dps_val: explore
            value: mapping
          - dps_val: explore_clean
            value: cleaning_and_mapping
          - dps_val: base_charging
            value: charging
          - dps_val: adapter_charging
            value: charging
          - dps_val: base_sleeping
            value: charged
          - dps_val: adapter_sleeping
            value: charged
          - dps_val: continuation_charging
            value: charging
      - id: 9
        type: string
        name: fan_speed
        mapping:
          - dps_val: closed
            value: "Off"
          - dps_val: gentle
            value: Low
          - dps_val: normal
            value: Medium
          - dps_val: strong
            value: High
          - dps_val: max
            value: Max
      - id: 11
        type: boolean
        name: locate
        optional: true
      - id: 12
        type: string
        name: direction_control
        optional: true
        mapping:
          - dps_val: forward
            value: forward
          - dps_val: backward
            value: backward
          - dps_val: turn_left
            value: left
          - dps_val: turn_right
            value: right
          - dps_val: stop
            value: stop
      - id: 28
        type: bitfield
        name: error
        hidden: true
      - id: 148
        type: string
        optional: true
        name: wifi_info
  - entity: switch
    name: Charge
    icon: "mdi:battery-charging"
    category: config
    dps:
      - id: 3
        type: boolean
        optional: true
        name: switch
  - entity: sensor
    name: Cleaning time
    icon: "mdi:progress-clock"
    class: duration
    category: diagnostic
    dps:
      - id: 6
        type: integer
        optional: true
        name: sensor
        unit: min
  - entity: sensor
    name: Cleaning area
    class: area
    category: diagnostic
    dps:
      - id: 7
        type: integer
        optional: true
        name: sensor
        unit: m2
  - entity: sensor
    class: battery
    dps:
      - id: 8
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: select
    translation_key: mopping
    category: config
    dps:
      - id: 10
        type: string
        name: option
        mapping:
          - dps_val: closed
            value: "off"
          - dps_val: low
            value: low
          - dps_val: middle
            value: medium
          - dps_val: high
            value: high
  - entity: text
    name: Path data
    category: config
    icon: "mdi:floor-plan"
    hidden: true
    dps:
      - id: 14
        type: base64
        optional: true
        name: value
  - entity: text
    name: Command
    category: config
    icon: "mdi:cogs"
    hidden: true
    dps:
      - id: 15
        type: base64
        optional: true
        name: value
  - entity: select
    name: Request
    icon: "mdi:message-question"
    category: config
    hidden: true
    dps:
      - id: 16
        type: string
        optional: true
        name: option
        mapping:
          - dps_val: get_map
            value: Map
          - dps_val: get_path
            value: Path
          - dps_val: get_both
            value: Both
  - entity: sensor
    name: Edge brush life
    category: diagnostic
    class: duration
    dps:
      - id: 17
        type: integer
        optional: true
        name: sensor
        unit: min
  - entity: sensor
    name: Roll brush life
    category: diagnostic
    class: duration
    dps:
      - id: 19
        type: integer
        optional: true
        name: sensor
        unit: min
  - entity: sensor
    translation_key: filter_life
    category: diagnostic
    class: duration
    dps:
      - id: 21
        type: integer
        optional: true
        name: sensor
        unit: min
  - entity: number
    translation_key: volume
    category: config
    dps:
      - id: 26
        type: integer
        name: value
        optional: true
        unit: "%"
        range:
          min: 0
          max: 100
  - entity: sensor
    name: Total cleaning area
    class: area
    category: diagnostic
    dps:
      - id: 29
        type: integer
        name: sensor
        unit: m2
  - entity: sensor
    name: Total cleaning times
    icon: "mdi:counter"
    category: diagnostic
    dps:
      - id: 30
        type: integer
        name: sensor
  - entity: sensor
    name: Total cleaning time
    class: duration
    icon: "mdi:history"
    category: diagnostic
    dps:
      - id: 31
        type: integer
        name: sensor
        unit: min

  - entity: button
    name: Reset map
    icon: "mdi:map-marker-remove"
    category: config
    dps:
      - id: 13
        type: boolean
        name: button
        optional: true
  - entity: button
    name: Reset edge brush
    class: restart
    category: config
    dps:
      - id: 18
        type: boolean
        name: button
        optional: true
  - entity: button
    name: Reset roll brush
    class: restart
    category: config
    dps:
      - id: 20
        type: boolean
        name: button
        optional: true
  - entity: button
    name: Reset filter
    icon: "mdi:air-filter"
    category: config
    dps:
      - id: 22
        type: boolean
        name: button
        optional: true
  - entity: switch
    translation_key: do_not_disturb
    category: config
    dps:
      - id: 25
        type: boolean
        optional: true
        name: switch

  - entity: switch
    name: Break clean
    icon: "mdi:clock-star-four-points"
    category: config
    dps:
      - id: 27
        type: boolean
        optional: true
        name: switch
  - entity: switch
    name: Auto boost
    icon: "mdi:car-turbocharger"
    category: config
    dps:
      - id: 45
        type: boolean
        optional: true
        name: switch
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 28
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 28
        type: bitfield
        name: fault_code
      - id: 127
        type: integer
        optional: true
        name: init_status
  - entity: text
    name: Voice data
    category: config
    icon: "mdi:account-voice"
    hidden: true
    dps:
      - id: 35
        type: base64
        optional: true
        name: value
  - entity: number
    name: Dust collection frequency
    category: config
    icon: "mdi:trash-can"
    dps:
      - id: 37
        type: integer
        name: value
        range:
          min: 0
          max: 99999
  - entity: switch
    name: Dust collection
    category: config
    icon: "mdi:trash-can"
    dps:
      - id: 38
        type: boolean
        optional: true
        name: switch
  - entity: text
    name: Schedule 1
    category: config
    translation_key: schedule
    hidden: true
    dps:
      - id: 120
        type: base64
        optional: true
        name: value
  - entity: text
    name: Schedule 2
    category: config
    translation_key: schedule
    hidden: true
    dps:
      - id: 121
        type: base64
        optional: true
        name: value
  - entity: text
    name: Schedule 3
    category: config
    translation_key: schedule
    hidden: true
    dps:
      - id: 122
        type: base64
        optional: true
        name: value
  - entity: text
    name: Schedule 4
    category: config
    translation_key: schedule
    hidden: true
    dps:
      - id: 123
        type: base64
        optional: true
        name: value
  - entity: text
    name: Schedule 5
    category: config
    translation_key: schedule
    hidden: true
    dps:
      - id: 124
        type: base64
        optional: true
        name: value
  - entity: text
    name: Schedule 6
    category: config
    translation_key: schedule
    hidden: true
    dps:
      - id: 125
        type: base64
        optional: true
        name: value
  - entity: text
    name: Schedule 7
    category: config
    translation_key: schedule
    hidden: true
    dps:
      - id: 126
        type: base64
        optional: true
        name: value
  - entity: text
    name: Save map
    category: config
    icon: "mdi:map-check"
    hidden: true
    dps:
      - id: 128
        type: base64
        optional: true
        name: value
  - entity: text
    name: Clear room data
    category: config
    icon: "mdi:floor-plan"
    hidden: true
    dps:
      - id: 129
        type: base64
        optional: true
        name: value
  - entity: text
    name: Add room
    category: config
    icon: "mdi:door"
    hidden: true
    dps:
      - id: 130
        type: string  # no sample to verify if base64
        optional: true
        name: value
  - entity: text
    name: Delete room
    category: config
    icon: "mdi:door-closed-cancel"
    hidden: true
    dps:
      - id: 131
        type: string
        optional: true
        name: value
  - entity: text
    name: App notifications
    category: config
    icon: "mdi:message-alert"
    hidden: true
    dps:
      - id: 132
        type: string  # Observed "0"
        optional: true
        name: value
  - entity: text
    name: Clean settings
    category: config
    icon: "mdi:cogs"
    hidden: true
    dps:
      - id: 136
        type: base64
        optional: true
        name: value
      - id: 137
        type: bitfield
        optional: true
        name: robot_info
      - id: 138
        type: integer   # incomplete spec (1=chinese, 2=english, 39=french)
        name: language  # observed value=50
  - entity: text
    name: Do not disturb schedule
    category: config
    icon: "mdi:sleep"
    hidden: true
    dps:
      - id: 143
        type: string
        optional: true
        name: value
  - entity: text
    name: Map name
    category: config
    icon: "mdi:map"
    dps:
      - id: 144
        type: string
        optional: true
        name: value
      - id: 145
        type: integer
        optional: true
        name: pending
  - entity: switch
    name: "Y mopping"
    category: config
    dps:
      - id: 149
        type: boolean
        name: switch
  - entity: binary_sensor
    name: Clean edge brush
    class: problem
    category: diagnostic
    dps:
      - id: 150
        type: boolean
        optional: true
        name: sensor
        mapping:
          - dps_val: null
            value: false
  - entity: binary_sensor
    name: Clean roll brush
    class: problem
    category: diagnostic
    dps:
      - id: 151
        type: boolean
        optional: true
        name: sensor
        mapping:
          - dps_val: null
            value: false
  - entity: binary_sensor
    name: Clean filter
    class: problem
    category: diagnostic
    dps:
      - id: 152
        type: boolean
        optional: true
        name: sensor
        mapping:
          - dps_val: null
            value: false
  - entity: select
    name: Cleaning efficiency
    icon: "mdi:vacuum"
    category: config
    dps:
      - id: 155
        type: string
        name: option
        mapping:
          - dps_val: careful
            value: Careful
          - dps_val: normal
            value: Normal
          - dps_val: fast
            value: Fast
  - entity: text
    name: Maintenance
    category: config
    icon: "mdi:wrench"
    hidden: true
    dps:
      - id: 157
        type: base64
        optional: true
        name: value
