name: Humidifier
products:
  - id: iduvrkbxe1w174v7
    manufacturer: Homvana
    model: H111S
  - id: 1vgcqw5ncf8cpmk8
    manufacturer: Homvana
    model: H111S
entities:
  - entity: humidifier
    class: humidifier
    dps:
      - id: 1
        type: boolean
        name: switch
      - id: 6
        type: string
        optional: true
        name: mode
        mapping:
          - dps_val: botany
            value: Plant
          - dps_val: piano
            value: Piano
          - dps_val: pet
            value: Pet
      - id: 14
        type: integer
        name: current_humidity
      - id: 102
        type: string
        optional: true
        name: str_humidity
      - id: 105
        type: integer
        name: humidity
        range:
          min: 30
          max: 90
        mapping:
          - step: 5
  - entity: fan
    name: Spray
    icon: "mdi:sprinkler-variant"
    dps:
      - id: 1
        type: boolean
        name: switch
      - id: 3
        type: string
        name: speed
        mapping:
          - dps_val: low
            value: 33
          - dps_val: middle
            value: 66
          - dps_val: high
            value: 100
      - id: 104
        type: boolean
        optional: true
        name: preset_mode
        mapping:
          - dps_val: false
            value: continuous
          - dps_val: true
            value: auto
  - entity: light
    translation_key: display
    category: config
    dps:
      - id: 5
        type: boolean
        name: switch
  - entity: switch
    translation_key: sleep
    category: config
    dps:
      - id: 16
        type: boolean
        optional: true
        name: switch
  - entity: select
    translation_key: timer
    category: config
    dps:
      - id: 19
        type: string
        name: option
        mapping:
          - dps_val: cancel
            value: cancel
          - dps_val: "2h"
            value: "2h"
          - dps_val: "4h"
            value: "4h"
          - dps_val: "6h"
            value: "6h"
          - dps_val: "8h"
            value: "8h"
          - dps_val: "10h"
            value: "10h"
          - dps_val: "12h"
            value: "12h"
  - entity: select
    name: Heating
    icon: "mdi:fire"
    category: config
    dps:
      - id: 101
        type: string
        name: option
        mapping:
          - dps_val: cancel
            value: "Off"
          - dps_val: "1"
            value: low
          - dps_val: "2"
            value: medium
          - dps_val: "3"
            value: high
  - entity: switch
    name: Humidity setting
    category: config
    dps:
      - id: 106
        type: boolean
        name: switch
  - entity: switch
    name: Heating
    category: config
    dps:
      - id: 107
        type: boolean
        optional: true
        name: switch
  - entity: sensor
    class: temperature
    category: diagnostic
    dps:
      - id: 12
        type: integer
        name: sensor
        unit: F
        class: measurement
  - entity: sensor
    translation_key: time_remaining
    class: duration
    category: diagnostic
    dps:
      - id: 20
        type: integer
        name: sensor
        unit: h
        class: measurement
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 22
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - dps_val: 4
            value: false
          - value: true
      - id: 22
        type: bitfield
        name: fault_code
      - id: 22
        type: bitfield
        name: description
        mapping:
          - dps_val: 0
            value: ok
          - dps_val: 1
            value: other
          - dps_val: 2
            value: PTC temperature
          - dps_val: 4
            value: Water low
          - dps_val: 8
            value: PCB temperature
          - dps_val: 16
            value: UART error
          - dps_val: 32
            value: Water empty
          - dps_val: 64
            value: IIC error
  - entity: binary_sensor
    translation_key: tank_empty
    dps:
      - id: 22
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 4  # low
            value: true
          - dps_val: 32  # empty
            value: true
          - value: false
  - entity: sensor
    translation_key: status
    class: enum
    category: diagnostic
    dps:
      - id: 103
        type: string
        name: sensor
        mapping:
          - dps_val: dry
            value: dry
          - dps_val: comfortable
            value: comfortable
          - dps_val: damp
            value: damp
