name: TH213 thermostat
entities:
  - entity: climate
    dps:
      - id: 1
        name: hvac_mode
        type: boolean
        mapping:
          - dps_val: true
            value: "heat"
          - dps_val: false
            value: "off"
      - id: 2
        name: temperature
        type: integer
        unit: C
        range:
          min: 5
          max: 30
      - id: 3
        name: current_temperature
        type: integer
      - id: 4
        name: preset_mode
        type: integer
        mapping:
          - dps_val: 1
            value: home
          - dps_val: 2
            value: away
          - dps_val: 3
            value: activity
          - dps_val: 4
            value: sleep
      - id: 102
        type: integer
        name: sensor
        mapping:
          - dps_val: 0
            value: "Internal"
          - dps_val: 1
            value: "External"
          - dps_val: 2
            value: "Internal & External"
      - id: 103
        type: integer
        name: temperature_calibration_offset
        range:
          min: -9
          max: 9
      - id: 104
        type: integer
        name: temperature_calibration_swing
        range:
          min: 1
          max: 9
      - id: 105
        type: boolean
        name: hvac_action
        mapping:
          - dps_val: true
            value: heating
          - dps_val: false
            value: idle
      - id: 107
        type: boolean
        name: unknown_107
      - id: 108
        type: boolean
        name: unknown_108
      - id: 110
        type: integer
        name: unknown_110
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 6
        type: boolean
        name: lock
  - entity: sensor
    name: External temperature
    class: temperature
    dps:
      - id: 101
        type: integer
        name: sensor
        class: measurement
        unit: C
  - entity: select
    name: Temperature sensor
    icon: "mdi:thermometer"
    category: config
    dps:
      - id: 102
        type: integer
        name: option
        mapping:
          - dps_val: 0
            value: Internal
          - dps_val: 1
            value: External
          - dps_val: 2
            value: Both
  - entity: number
    name: Calibration offset
    category: config
    icon: "mdi:arrow-collapse-up"
    dps:
      - id: 103
        type: integer
        name: value
        unit: C
        range:
          min: -9
          max: 9
  - entity: number
    name: Calibration swing
    category: config
    icon: "mdi:arrow-expand-vertical"
    dps:
      - id: 104
        type: integer
        name: value
        unit: C
        range:
          min: 1
          max: 9
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 12
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 12
        type: bitfield
        name: fault_code
