name: TH213 thermostat
primary_entity:
  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: 12
      type: bitfield
      name: error
      mapping:
        - dps_val: 0
          value: OK
    - id: 105
      type: boolean
      name: hvac_action
      mapping:
        - dps_val: true
          value: heating
        - dps_val: false
          constraint: hvac_mode
          conditions:
            - dps_val: true
              value: idle
            - dps_val: false
              value: "off"
    - id: 116
      type: string
      name: unknown_116
secondary_entities:
  - 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
    category: diagnostic
    class: problem
    dps:
      - id: 12
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
