name: CO2 detector
entities:
  - entity: binary_sensor
    name: CO2 level
    class: safety
    dps:
      - id: 1
        type: string
        name: sensor
        mapping:
          - dps_val: "alarm"
            value: true
          - dps_val: "normal"
            value: false
  - entity: sensor
    class: carbon_dioxide
    dps:
      - id: 2
        type: integer
        name: sensor
        unit: ppm
        class: measurement
  - entity: number
    name: CO2 alarm level
    class: carbon_dioxide
    category: config
    dps:
      - id: 7
        type: integer
        name: value
        optional: true
        unit: ppm
        range:
          min: 800
          max: 2000
        mapping:
          - step: 100
  - entity: switch
    name: Alarm enable
    category: config
    dps:
      - id: 13
        type: boolean
        name: switch
        mapping:
          - dps_val: true
            icon: "mdi:bell"
          - dps_val: false
            icon: "mdi:bell-off"
  - entity: binary_sensor
    class: battery_charging
    category: diagnostic
    dps:
      - id: 14
        type: string
        name: sensor
        mapping:
          - dps_val: normal
            value: false
          - dps_val: charge
            value: true
  - entity: sensor
    class: battery
    category: diagnostic
    dps:
      - id: 15
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    class: temperature
    dps:
      - id: 18
        type: integer
        name: sensor
        unit: C
        class: measurement
  - entity: sensor
    class: humidity
    dps:
      - id: 19
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 31
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: switch
    name: Screen sleep
    category: config
    dps:
      - id: 101
        type: boolean
        name: switch
        mapping:
          - dps_val: true
            icon: "mdi:sleep"
          - dps_val: false
            icon: "mdi:sleep-off"
  - entity: number
    name: Screen sleep time
    category: config
    dps:
      - id: 102
        type: integer
        name: value
        optional: true
        unit: s
        range:
          min: 10
          max: 300
        mapping:
          - step: 10
