name: Litter box
products:
  - id: e2uhpgprwtq40un2
    manufacturer: Meegeem
entities:
  - entity: sensor
    translation_key: status
    class: enum
    dps:
      - id: 107
        type: string
        name: sensor
        mapping:
          - dps_val: 0
            value: standby
          - dps_val: 1
            value: cleaning
          - dps_val: 2
            value: emptying
          - dps_val: 3
            value: resetting
          - dps_val: 4
            value: deodorizing
          - dps_val: 5
            value: Cleaning paused
          - dps_val: 6
            value: Emptying paused
          - dps_val: 7
            value: Resetting paused

  - entity: button
    name: Empty
    icon: "mdi:delete-empty-outline"
    category: config
    dps:
      - id: 1
        type: boolean
        name: button

  - entity: button
    name: Clean
    icon: "mdi:delete-empty"
    dps:
      - id: 3
        type: boolean
        name: button

  - entity: button
    name: Reset
    icon: "mdi:refresh"
    dps:
      - id: 4
        type: boolean
        name: button

  - entity: button
    name: Deodorize
    icon: "mdi:scent"
    dps:
      - id: 9
        type: boolean
        name: button

  - entity: sensor
    class: weight
    dps:
      - id: 21
        name: sensor
        type: bitfield
        unit: kg
        mapping:
          - dps_val: 0
            value: null
          - dps_val: 1
            value: null
          - dps_val: 2
            value: 1
          - dps_val: 4
            value: 2
          - dps_val: 8
            value: 3
          - dps_val: 16
            value: 4
          - dps_val: 32
            value: 5
          - dps_val: 64
            value: 6
          - dps_val: 128
            value: 7
          - dps_val: 256
            value: 8
          - dps_val: 512
            value: 9
          - dps_val: 1024
            value: 10
          - dps_val: 2048
            value: 11
          - dps_val: 4096
            value: 12
          - dps_val: 8192
            value: 13
          - dps_val: 16384
            value: 14
          - dps_val: 32768
            value: 15
          - dps_val: 65536
            value: 16
          - dps_val: 131072
            value: 17
          - dps_val: 262144
            value: 18
          - dps_val: 524288
            value: 19
          - dps_val: 1048576
            value: 20

  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 22
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - dps_val: 64
            value: false
          - dps_val: 128
            value: false
          - dps_val: 256
            value: false
          - dps_val: 512
            value: false
          - value: true
      - id: 22
        type: bitfield
        name: fault_code
      - id: 22
        name: description
        type: bitfield
        mapping:
          - dps_val: 0
            value: OK
          - dps_val: 1
            value: Other
          - dps_val: 2
            value: Litter low
          - dps_val: 4
            value: Waste bin full
          - dps_val: 8
            value: Cleaning interrupted
          - dps_val: 16
            value: Litter reset failed
          - dps_val: 32
            value: Other
          - dps_val: 64
            value: Cleaning complete
          - dps_val: 128
            value: Emptying complete
          - dps_val: 256
            value: Reset complete
          - dps_val: 512
            value: Deodorizing complete

  - entity: number
    name: Auto-clean delay
    icon: "mdi:clock"
    category: config
    dps:
      - id: 101
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 20

  - entity: switch
    translation_key: auto_clean
    category: config
    dps:
      - id: 102
        name: switch
        type: boolean

  - entity: switch
    name: Auto-deodorize
    icon: "mdi:scent"
    category: config
    dps:
      - id: 103
        name: switch
        type: boolean

  - entity: binary_sensor
    name: Litter
    icon: "mdi:toilet"
    class: problem
    dps:
      - id: 104
        type: string
        name: sensor
        mapping:
          - dps_val: "0"
            value: true
          - dps_val: "1"
            value: false

  - entity: sensor
    # 0-3 in steps of 1, not shown in Smart Life app, unknown function
    name: Operating mode
    icon: "mdi:shimmer"
    hidden: true
    dps:
      - id: 105
        type: integer
        name: sensor

  - entity: binary_sensor
    name: Waste bin
    icon: "mdi:delete"
    class: problem
    dps:
      - id: 106
        type: string
        name: sensor
        mapping:
          - dps_val: "0"
            value: true
          - dps_val: "1"
            value: false
