name: Dehumidifier
products:
  - id: z6iig4fopkrzyej9
    manufacturer: HTW
    model: HTWD020A4

entities:
  - entity: humidifier
    class: dehumidifier
    translation_only_key: extended
    dps:
      - id: 1
        type: boolean
        name: switch
      - id: 4
        type: integer
        name: humidity
        range:
          min: 25
          max: 90
        mapping:
          - step: 5
      - id: 3
        type: integer
        name: current_humidity
      - id: 2
        type: string
        name: mode
        mapping:
          - dps_val: "1"
            value: normal
          - dps_val: "2"
            value: laundry
          - dps_val: "3"
            value: sleep
          - dps_val: "4"
            value: purify
  - entity: fan
    translation_key: fan_with_presets
    dps:
      - id: 1
        type: boolean
        name: switch
      - id: 6
        type: string
        name: preset_mode
        mapping:
          - dps_val: "1"
            value: high
          - dps_val: "2"
            value: low
      - id: 8
        type: boolean
        name: oscillate

  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 11
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - dps_val: 2
            value: false
          - value: true
      - id: 11
        type: bitfield
        name: fault_code
      - id: 11
        type: bitfield
        name: description
        mapping:
          - dps_val: 0
            value: "OK"
          - dps_val: 1
            value: "Sensor Fault"
          - dps_val: 2
            value: "Tank Full"
          - dps_val: 4
            value: "Pump Fault"
  - entity: binary_sensor
    translation_key: tank_full
    dps:
      - id: 11
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 2
            value: true
          - value: false
  - entity: sensor
    class: temperature
    dps:
      - id: 110
        type: integer
        name: sensor
        unit: "C"

  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 16
        type: boolean
        name: lock

  - entity: switch
    translation_key: ionizer
    category: config
    dps:
      - id: 10
        type: boolean
        name: switch

  - entity: button
    translation_key: filter_reset
    category: config
    dps:
      - id: 20
        type: boolean
        name: button

  - entity: binary_sensor
    translation_key: defrost
    category: diagnostic
    dps:
      - id: 108
        type: boolean
        name: sensor

  - entity: number
    translation_key: timer
    dps:
      - id: 106
        type: integer
        name: value
        range:
          min: 0
          max: 24
        unit: h

  - entity: sensor
    translation_key: time_remaining
    class: duration
    dps:
      - id: 18
        type: integer
        name: sensor
        unit: min
