name: Air quality monitor
products:
  - id: otnwbfrffhnatwxd
    model: EWC02
    manufacturer: HaoliYuan
entities:
  - entity: sensor
    class: temperature
    dps:
      - id: 2
        type: integer
        name: sensor
        unit: C
        class: measurement
        mapping:
          - scale: 10
  - entity: sensor
    class: humidity
    dps:
      - id: 3
        type: integer
        name: sensor
        unit: "%"
        class: measurement
        mapping:
          - scale: 1
  - entity: sensor
    class: carbon_dioxide
    dps:
      - id: 4
        type: integer
        class: measurement
        name: sensor
        unit: ppm
  - entity: sensor
    class: battery
    category: diagnostic
    dps:
      - id: 22
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 101
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: binary_sensor
    class: battery_charging
    dps:
      - id: 102
        type: string
        name: sensor
        mapping:
          - dps_val: chraging
            value: true
          - value: false
  - entity: switch
    name: Alarm
    category: config
    dps:
      - id: 104
        type: boolean
        name: switch
  - entity: select
    name: Screen off delay
    translation_key: timer
    category: config
    dps:
      - id: 106
        type: string
        name: option
        mapping:
          - dps_val: Never
            value: cancel
          - dps_val: 10minute
            value: "10m"
          - dps_val: 5minute
            value: "5m"
          - dps_val: 2minute
            value: "2m"
          - dps_val: 1minute
            value: "1m"
          - dps_val: 30s
            value: "30s"
  - entity: number
    name: CO2 alarm threshold
    class: carbon_dioxide
    category: config
    dps:
      - id: 107
        type: integer
        name: value
        unit: ppm
        range:
          min: 1000
          max: 9999
        mapping:
          - step: 100
