name: Robot vacuum
products:
  - id: fptshnsx98tak0zo
    manufacturer: Airrobo
    model: P20
entities:
  - entity: vacuum
    dps:
      - id: 2
        type: boolean
        name: activate
        optional: true
      - id: 3
        type: string
        name: command
        mapping:
          - dps_val: standby
            value: stop
          - dps_val: smart
            value: smart
          - dps_val: wall_follow
            value: wall_follow
          - dps_val: spiral
            value: clean_spot
          - dps_val: partial_bow
            value: partial_bow
          - dps_val: chargego
            value: return_to_base
      - id: 4
        type: string
        name: direction_control
        mapping:
          - dps_val: forward
            value: forward
          - dps_val: turn_left
            value: left
          - dps_val: turn_right
            value: right
          - dps_val: stop
            value: stop
      - id: 5
        type: string
        name: status
        mapping:
          - dps_val: standby
            value: idle
          - dps_val: smart_clean
            value: auto
          - dps_val: wall_clean
            value: edge
          - dps_val: spot_clean
            value: spot
          - dps_val: mop_clean
            value: mopping
          - dps_val: goto_charge
            value: returning
          - dps_val: charging
            value: charging
          - dps_val: charge_done
            value: docked
          - dps_val: paused
            value: paused
          - dps_val: cleaning
            value: cleaning
          - dps_val: sleep
            value: idle
      - id: 13
        type: boolean
        name: locate
        optional: true
      - id: 14
        type: string
        name: fan_speed
        mapping:
          - dps_val: gentle
            value: Silent
          - dps_val: normal
            value: Normal
          - dps_val: strong
            value: Strong
      - id: 18
        type: bitfield
        name: error
        optional: true
        hidden: true
      - id: 104
        type: string
        name: serial_number
  - entity: sensor
    class: battery
    dps:
      - id: 6
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    name: Edge brush life
    category: diagnostic
    icon: "mdi:arrow-expand-all"
    dps:
      - id: 7
        type: integer
        name: sensor
        unit: "%"
  - entity: sensor
    name: Roll brush life
    category: diagnostic
    icon: "mdi:tire"
    dps:
      - id: 8
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    translation_key: filter_life
    category: diagnostic
    dps:
      - id: 9
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: button
    name: Reset edge brush
    class: restart
    category: config
    dps:
      - id: 10
        type: boolean
        name: button
        optional: true
  - entity: button
    name: Reset roll brush
    class: restart
    category: config
    dps:
      - id: 11
        name: button
        type: boolean
        optional: true
  - entity: button
    name: Reset filter
    class: restart
    category: config
    dps:
      - id: 12
        name: button
        type: boolean
        optional: true
  - entity: sensor
    name: Clean area
    class: area
    category: diagnostic
    dps:
      - id: 16
        type: integer
        name: sensor
        unit: m2
        class: measurement
  - entity: sensor
    name: Clean time
    class: duration
    category: diagnostic
    dps:
      - id: 17
        type: integer
        name: sensor
        unit: min
        class: measurement
  - entity: number
    translation_key: volume
    category: config
    dps:
      - id: 28
        type: integer
        name: value
        unit: "%"
        range:
          min: 0
          max: 100
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 18
        type: bitfield
        name: sensor
        optional: true
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 18
        type: bitfield
        name: fault_code
        optional: true
      - id: 18
        type: bitfield
        name: description
        optional: true
        mapping:
          - dps_val: 0
            value: OK
          - dps_val: 1
            value: Edge sweep
          - dps_val: 2
            value: Middle sweep
          - dps_val: 4
            value: Left wheel
          - dps_val: 8
            value: Right wheel
          - dps_val: 16
            value: Dustbin Removed
          - dps_val: 32
            value: Land check
          - dps_val: 64
            value: Collision
          - dps_val: 128
            value: Power low
          - dps_val: 256
            value: Raise up
          - dps_val: 512
            value: Safe place
          - dps_val: 1024
            value: Can't go through
          - dps_val: 2048
            value: Fan error
          - dps_val: 4096
            value: Power lowsp
          - dps_val: 8192
            value: Middle sweep stop
          - dps_val: 16384
            value: Charging error
          - dps_val: 32768
            value: Charging no contact
  - entity: select
    translation_key: language
    category: config
    dps:
      - id: 29
        type: string
        name: option
        mapping:
          - dps_val: english
            value: english
          - dps_val: german
            value: german
          - dps_val: french
            value: french
          - dps_val: russian
            value: russian
          - dps_val: spanish
            value: spanish
          - dps_val: italian
            value: italian
  - entity: switch
    name: Quick clean
    category: config
    dps:
      - id: 101
        type: string
        name: switch
        mapping:
          - dps_val: careful_clean
            value: false
          - dps_val: speed_clean
            value: true
