name: Robot vacuum
products:
  - id: lec6zthbnidtvk2g
    manufacturer: Lenovo
    model: E1
entities:
  - entity: vacuum
    dps:
      - id: 1
        type: boolean
        name: power
      - id: 17
        type: bitfield
        name: error
        hidden: true
      - id: 101
        type: string
        name: status
        mapping:
          - dps_val: SLEEP
            value: standby
          - dps_val: HALTING
            value: halting
          - dps_val: CLEANING
            value: cleaning
          - dps_val: CLEAN_COMP
            value: cleaning_complete
          - dps_val: FIND_STA
            value: returning
          - dps_val: CHARGING_STA
            value: charging
          - dps_val: CHARGING_DC
            value: charging
          - dps_val: CHARG_COMP
            value: standby
      - id: 102
        type: string
        name: command
        mapping:
          - dps_val: clean_auto
            value: auto
          - dps_val: clean_random
            value: random
          - dps_val: clean_wall
            value: wall_follow
          - dps_val: clean_spot
            value: clean_spot
          - dps_val: clean_sroom
            value: clean_room
          - dps_val: find_sta
            value: return_to_base
          - dps_val: "null"
            value: unknown
      - id: 104
        type: string
        name: fan
        mapping:
          - dps_val: FANHALTING
            value: low
          - dps_val: FANNORAM
            value: mid
          - dps_val: FANMAX
            value: high
      - id: 105
        type: string
        name: direction_control
        mapping:
          - dps_val: MoveForward
            value: forward
          - dps_val: MoveBackward
            value: backward
          - dps_val: MoveLeft
            value: left
          - dps_val: MoveRight
            value: right
          - dps_val: stop
            value: stop
      - id: 112
        type: string
        name: activate
        mapping:
          - dps_val: "0"
            value: false
          - dps_val: "1"
            value: true
      - id: 116
        type: boolean
        name: locate
        optional: true
      - id: 118
        type: integer
        name: model
      - id: 119
        type: integer
        name: data_sample
  - entity: sensor
    name: Clean area
    class: area
    category: diagnostic
    dps:
      - id: 14
        type: integer
        name: sensor
        unit: m2
        class: measurement
  - entity: sensor
    name: Clean time
    class: duration
    category: diagnostic
    dps:
      - id: 107
        type: integer
        name: sensor
        unit: min
  - entity: sensor
    class: battery
    dps:
      - id: 108
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    name: Brush life
    icon: "mdi:pinwheel"
    category: diagnostic
    dps:
      - id: 109
        type: integer
        name: sensor
        unit: "%"
  - entity: sensor
    name: Roller brush life
    icon: "mdi:tire"
    category: diagnostic
    dps:
      - id: 110
        type: integer
        name: sensor
        unit: "%"
  - entity: sensor
    name: HEPA filter life
    category: diagnostic
    icon: "mdi:air-filter"
    dps:
      - id: 111
        type: integer
        name: sensor
        unit: "%"
  - entity: button
    name: Reset brush
    icon: "mdi:pinwheel"
    category: config
    dps:
      - id: 113
        type: boolean
        name: button
        optional: true
  - entity: button
    name: Reset roller brush
    icon: "mdi:tire"
    category: config
    dps:
      - id: 114
        type: boolean
        name: button
        optional: true
  - entity: button
    name: Reset HEPA filter
    icon: "mdi:air-filter"
    category: config
    dps:
      - id: 115
        type: boolean
        name: button
        optional: true
  - entity: select
    name: Scheduled clean
    icon: "mdi:robot-vacuum"
    category: config
    dps:
      - id: 117
        type: string
        name: option
        mapping:
          - dps_val: clean_auto
            value: auto
          - dps_val: clean_random
            value: random
          - dps_val: clean_wall
            value: wall
          - dps_val: clean_spot
            value: spot
          - dps_val: find_sta
            value: dock
  - entity: select
    translation_key: mopping
    category: config
    dps:
      - id: 120
        type: string
        name: option
        mapping:
          - dps_val: water_small
            value: low
          - dps_val: water_big
            value: high
          - dps_val: water_auto
            value: auto
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 17
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 17
        type: bitfield
        name: fault_code
      - id: 17
        type: bitfield
        name: description
        mapping:
          - dps_val: 0
            value: ok
          - dps_val: 1
            value: cliff
          - dps_val: 2
            value: impact
          - dps_val: 4
            value: wheel
          - dps_val: 8
            value: brush
          - dps_val: 16
            value: fan
          - dps_val: 32
            value: roller_brush
          - dps_val: 64
            value: low_power
          - dps_val: 128
            value: give_up
          - dps_val: 256
            value: no_dust
          - dps_val: 512
            value: none
