name: Air purifier
products:
  - id: 0ala38ikctugsmng
    manufacturer: Cecotec
    model: TotalPure 7500
entities:
  # -------------------------------------------------------
  # Fan (On/Off + Preset modes + Speed)
  # -------------------------------------------------------
  - entity: fan
    translation_key: fan_with_presets
    icon: mdi:air-purifier
    dps:
      - id: 1
        name: switch
        type: boolean
      - id: 4
        name: speed
        type: string
        mapping:
          - dps_val: "1"
            value: 25
          - dps_val: "2"
            value: 50
          - dps_val: "3"
            value: 75
          - dps_val: "4"
            value: 100
      - id: 3
        name: preset_mode
        type: string
        mapping:
          # Map HA preset values to defined presets (keep device DP values)
          - dps_val: auto
            value: smart
          - dps_val: sleep
            value: sleep
          - dps_val: manual
            value: normal

  # -------------------------------------------------------
  # Sensors
  # -------------------------------------------------------
  - entity: sensor
    class: pm25
    dps:
      - id: 2
        name: sensor
        type: integer
        unit: ugm3
        class: measurement

  - entity: sensor
    name: Filter
    category: diagnostic
    dps:
      - id: 5
        type: integer
        name: sensor
        unit: "%"
        class: measurement

  - entity: sensor
    class: temperature
    dps:
      - id: 12
        name: sensor
        type: integer
        unit: C

  - entity: sensor
    class: humidity
    dps:
      - id: 13
        type: integer
        name: sensor
        unit: "%"

  # -------------------------------------------------------
  # Timer
  # -------------------------------------------------------
  - entity: select
    translation_key: timer
    category: config
    dps:
      - id: 18
        name: option
        type: string
        mapping:
          - dps_val: "cancel"
            value: cancel
          - dps_val: 1h
            value: 1h
          - dps_val: 4h
            value: 4h
          - dps_val: 8h
            value: 8h

  # -------------------------------------------------------
  # Misc
  # -------------------------------------------------------
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 7
        name: lock
        type: boolean

  - entity: light
    translation_key: indicator
    category: config
    dps:
      - id: 8
        name: switch
        type: boolean
