name: AlecoAir D12 ECO dehumidifier
products:
  - id: gcthce4ejb8nzgow
    name: D12 ECO 2.0
primary_entity:
  entity: humidifier
  class: dehumidifier
  dps:
    - id: 1
      name: switch
      type: boolean
    - id: 2
      name: humidity
      type: integer
      range:
        min: 20
        max: 95
      mapping:
        - step: 5
    - id: 5
      name: mode
      type: string
      mapping:
        - dps_val: Continuous
          value: boost
        - dps_val: Sunny_Day
          value: eco
        - dps_val: Rain_Day
          value: normal

    - id: 6
      name: current_humidity
      type: integer
    - id: 19
      name: error
      type: bitfield
      # E2 might be a compressor fault.
      mapping:
        - dps_val: 0
          value: OK
        - dps_val: 1
          value: "Water Tank Full or Removed"
        - dps_val: 2
          value: "E2 Compressor Fault"
secondary_entities:
  - entity: fan
    dps:
      - id: 1
        type: boolean
        name: switch
      - id: 4
        type: string
        name: speed
        mapping:
          - dps_val: low
            value: 50
          - dps_val: high
            value: 100
  - entity: sensor
    class: temperature
    dps:
      - id: 7
        type: integer
        name: sensor
        unit: C
        class: measurement
  - entity: switch
    translation_key: sleep
    category: config
    dps:
      - id: 14
        type: boolean
        name: switch
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 16
        type: boolean
        name: lock
  - entity: binary_sensor
    translation_key: tank_full
    dps:
      - id: 19
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 1
            value: true
          - value: false
  - entity: binary_sensor
    class: problem
    dps:
      - id: 19
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - dps_val: 1
            value: false
          - dps_val: null
            value: false
          - value: true
