name: Robot Vacuum
products:
  - id: ise3eub6pvacnzdw
    manufacturer: Proscenic
    model: M9
entities:
  - entity: vacuum
    dps:
      - id: 1
        type: boolean
        name: activate
        optional: true
      - id: 2
        type: boolean
        name: pause
        optional: true
      - id: 3
        name: return_to_base
        type: boolean
        optional: true
      - id: 4
        type: string
        name: command
        optional: true
        mapping:
          - dps_val: smart
            value: Auto clean
          - dps_val: zone
            value: Zone cleaning
          - dps_val: pose
            value: pose
          - dps_val: part
            value: clean_spot
          - dps_val: goto_charge
            value: return_to_base
          - dps_val: wallfollow
            value: wallfollow
          - dps_val: select_room
            value: Select room cleaning
      - id: 5
        name: status
        type: string
        optional: true
        mapping:
          - dps_val: standby
            value: standby
          - dps_val: smart
            value: cleaning
          - dps_val: zone_clean
            value: cleaning
          - dps_val: part_clean
            value: cleaning
          - dps_val: cleaning
            value: cleaning
          - dps_val: paused
            value: pause
          - dps_val: goto_pos
            value: go to target point
          - dps_val: pos_arrived
            value: arrived to target point
          - dps_val: pos_unarrive
            value: cannot arrive to target point
          - dps_val: goto_charge
            value: returning
          - dps_val: charging
            value: charging
          - dps_val: charge_done
            value: charged
          - dps_val: sleep
            value: sleep
          - dps_val: fault
            value: error
          - dps_val: wall_follow
            value: wall_follow
          - dps_val: direction_control
            value: direction_control
          - dps_val: repositing
            value: repositing
          - dps_val: select_room
            value: select_room
          - dps_val: seek_dust_bucket
            value: seek_dust_bucket
          - dps_val: collecting_dust
            value: collecting_dust
      - id: 9
        name: fan_speed
        type: string
        mapping:
          - dps_val: closed
            value: "Off"
          - dps_val: gentle
            value: Gentle
          - dps_val: normal
            value: Normal
          - dps_val: strong
            value: Strong
          - dps_val: max
            value: Max
            hidden: true
      - id: 11
        name: locate
        type: boolean
        optional: true
      - id: 12
        name: direction_control
        type: string
        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
          - dps_val: exit
            value: exit
      - id: 13
        name: map_reset
        type: boolean
        optional: true
        hidden: true
      - id: 14
        name: path_data
        type: string
        optional: true
      - id: 15
        name: command_trans
        type: base64
        optional: true
      - id: 16
        name: request
        type: string
        optional: true
      - id: 25
        name: do_not_disturb  # cannot be used, set an automation instead
        type: boolean
      - id: 32
        name: device_timer  # set an automation for scheduled cleaning
        type: string
        optional: true
      - id: 33
        name: disturb_time
        type: base64
        optional: true
      - id: 34
        name: device_info
        type: base64
        optional: true
      - id: 35
        name: voice_data
        type: base64
        optional: true
      - id: 36
        name: language
        type: string
        optional: true
      - id: 132
        name: chaging_base_type
        type: string
        optional: true
      - id: 133
        name: water_tank_type
        type: string
        optional: true
      - id: 134
        name: realtime_fanspeed
        type: string
        optional: true
      - id: 135
        name: realtime_water_level
        type: string
        optional: true
      - id: 137
        name: cloud_map  # not useful without the app
        type: boolean
      - id: 141
        name: cleanspot
        type: boolean
        optional: true
  - entity: sensor
    name: Cleaning time
    category: diagnostic
    class: duration
    dps:
      - id: 6
        name: sensor
        type: integer
        unit: min
  - entity: sensor
    name: Cleaned area
    class: area
    category: diagnostic
    dps:
      - id: 7
        name: sensor
        type: integer
        unit: m2
  - entity: sensor
    class: battery
    dps:
      - id: 8
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: select
    translation_key: mopping
    dps:
      - id: 10
        name: option
        type: string
        mapping:
          - constraint: mopstate
            conditions:
              - dps_val: installed
                mapping:
                  - dps_val: closed
                    value: "off"
                  - dps_val: low
                    value: low
                  - dps_val: middle
                    value: medium
                  - dps_val: high
                    value: high
              - dps_val: none
                mapping:
                  - dps_val: closed
                    value: "off"
      - id: 40
        name: mopstate
        type: string
  - entity: sensor
    name: Side brush life
    category: diagnostic
    class: duration
    dps:
      - id: 17
        name: sensor
        type: integer
        unit: min
        range:
          min: 0
          max: 12000
  - entity: button
    name: Side brush reset
    category: diagnostic
    class: restart
    dps:
      - id: 18
        type: boolean
        name: button
        optional: true
  - entity: sensor
    name: Main brush life
    category: diagnostic
    class: duration
    dps:
      - id: 19
        name: sensor
        type: integer
        unit: min
        range:
          min: 0
          max: 18000
  - entity: button
    name: Main brush reset
    category: diagnostic
    class: restart
    dps:
      - id: 20
        type: boolean
        name: button
        optional: true
  - entity: sensor
    name: Filter life
    category: diagnostic
    class: duration
    dps:
      - id: 21
        name: sensor
        type: integer
        unit: min
        range:
          min: 0
          max: 9000
  - entity: button
    translation_key: filter_reset
    category: diagnostic
    dps:
      - id: 22
        type: boolean
        name: button
        optional: true
  - entity: sensor
    name: Mop life
    category: diagnostic
    class: duration
    dps:
      - id: 23
        name: sensor
        type: integer
        unit: min
        range:
          min: 0
          max: 9000
  - entity: button
    name: Mop reset
    category: diagnostic
    class: restart
    dps:
      - id: 24
        type: boolean
        name: button
        optional: true
  - entity: number
    name: Volume
    category: config
    icon: "mdi:volume-high"
    dps:
      - id: 26
        type: integer
        name: value
        range:
          min: 0
          max: 100
  - entity: switch
    name: Resume cleaning option
    icon: "mdi:replay"
    category: config
    dps:
      - id: 27
        name: switch
        type: boolean
  - entity: sensor
    name: Total cleaned area
    class: area
    category: diagnostic
    dps:
      - id: 29
        name: sensor
        type: integer
        unit: m2
  - entity: sensor
    name: Total clean count
    category: diagnostic
    icon: "mdi:counter"
    dps:
      - id: 30
        name: sensor
        type: integer
  - entity: sensor
    name: Total clean time
    category: diagnostic
    class: duration
    icon: "mdi:archive-clock-outline"
    dps:
      - id: 31
        name: sensor
        type: integer
        unit: min
        range:
          min: 0
          max: 99999
  # - entity: select
  #   translation_key: language
  #   dps:
  #     - id: 36
  #       name: option
  #       type: string
  #       optional: true
  #       mapping:
  #         - dps_val: chinese_simplified
  #           value: chinese
  #         - dps_val: chinese_traditional
  #           value: chinese_traditional
  #         - 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: korean
  #           value: korean
  #         - dps_val: latin
  #           value: latin
  #         - dps_val: portuguese
  #           value: portuguese
  #         - dps_val: japanese
  #           value: japanese
  #         - dps_val: italian
  #           value: italian
  - entity: select
    name: Dust collection frequency
    category: config
    dps:
      - id: 37
        name: option
        type: integer
        mapping:
          - dps_val: 0
            value: Never
            icon: "mdi:numeric-0"
          - dps_val: 1
            value: After each clean
            icon: "mdi:numeric-1"
          - dps_val: 2
            value: After 2 cleans
            icon: "mdi:numeric-2"
          - dps_val: 3
            value: After 3 cleans
            icon: "mdi:numeric-3"
  - entity: button
    name: Empty dustbin
    category: config
    icon: "mdi:delete-restore"
    dps:
      - id: 38
        name: button
        type: boolean
  - entity: switch
    name: Customize mode
    icon: "mdi:store-cog"
    category: config
    dps:
      - id: 39
        name: switch  # required so the mop and suction options work
        type: boolean
  - entity: binary_sensor
    name: Mop installed
    category: diagnostic
    icon: "mdi:connection"
    dps:
      - id: 40
        name: sensor
        type: string
        mapping:
          - dps_val: "installed"
            value: true
          - dps_val: "none"
            value: false
  - entity: select
    name: Working mode
    icon: "mdi:vacuum"
    dps:
      - id: 41
        name: option
        type: string
        mapping:
          - dps_val: both_work
            value: Vacuum and mop
            icon: "mdi:robot-vacuum-variant"
          - dps_val: only_sweep
            value: Vacuum only
            icon: "mdi:broom"
          - dps_val: only_mop
            value: Mopping only
            icon: "mdi:liquid-spot"
  - entity: switch
    name: LED lights
    category: config
    icon: "mdi:car-parking-lights"
    dps:
      - id: 130
        name: switch
        type: boolean
  - entity: switch
    name: Mute sound
    category: config
    icon: "mdi:volume-mute"
    dps:
      - id: 131
        name: switch
        type: boolean
  - entity: switch
    name: Mop rotation
    icon: "mdi:rotate-360"
    dps:
      - id: 138
        name: switch
        type: boolean
  - entity: sensor
    name: Sensor life
    category: diagnostic
    class: duration
    icon: "mdi:eye-circle-outline"
    dps:
      - id: 139
        name: sensor
        type: integer
        unit: min
        range:
          min: 0
          max: 1800
  - entity: button
    name: Sensor reset
    category: diagnostic
    class: restart
    dps:
      - id: 140
        type: boolean
        name: button
        optional: true
  - entity: sensor
    name: Event message
    class: enum
    category: diagnostic
    icon: "mdi:eye-circle-outline"
    dps:
      - id: 198
        name: sensor
        type: integer
        mapping:
          - dps_val: 20001
            value: Start auto clean
          - dps_val: 20002
            value: Start mopping
          - dps_val: 20003
            value: Start room clean
          - dps_val: 20004
            value: Start area clean
          - dps_val: 20005
            value: Start spot clean
          - dps_val: 20006
            value: Start partial clean
          - dps_val: 20008
            value: Relocating
          - dps_val: 20019
            value: Job finished
          - dps_val: 20020
            value: Low power, return to charge
          - dps_val: 20021
            value: Charging
          - dps_val: 20022
            value: Battery low
          - dps_val: 20024
            value: Emptying dustbin
          - dps_val: 20025
            value: Dustbin empty completed
          - value: unknown
      - id: 198
        name: event_code
        type: integer
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 199
        name: sensor
        type: integer
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 199
        name: fault_code
        type: integer
      - id: 28
        name: error_flag
        type: bitfield
      - id: 199
        name: description
        type: integer
        mapping:
          - dps_val: 21003
            value: Dustbin not installed
          - dps_val: 21005
            value: Mopping cloth not fitted
          - dps_val: 21008
            value: Vacuum not on floor
          - dps_val: 21012
            value: Dust bag full
          - dps_val: 21013
            value: Dust bag not installed
          - dps_val: 22001
            value: Check anti-collision sensor
          - dps_val: 22006
            value: Jammed or stuck
          - dps_val: 23011
            value: Dust collection error due to insufficient pressure
          - value: unknown
