name: Thermostat
products:
  - id: gu4vs8axzlw5ptw3
    manufacturer: Hysen
    model: HY08WE-4
entities:
  - entity: climate
    translation_only_key: thermostat
    dps:
      - id: 1
        type: boolean
        name: hvac_mode
        mapping:
          - dps_val: true
            value: heat
          - dps_val: false
            value: "off"
      - id: 2
        type: integer
        name: temperature
        range:
          min: 5
          max: 1220
        mapping:
          - scale: 10
            constraint: temperature_unit
            conditions:
              - dps_val: false
                step: 5
              - dps_val: true
                step: 10
      - id: 3
        type: integer
        name: current_temperature
        mapping:
          - scale: 10
      - id: 4
        type: string
        name: preset_mode
        mapping:
          - dps_val: Manual
            value: manual
          - dps_val: Program
            value: program
          - dps_val: TempProg
            value: temp_override
            hidden: true
          - dps_val: Holiday
            value: away
      - id: 101
        type: boolean
        name: temperature_unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
      - id: 102
        type: boolean
        name: hvac_action
        mapping:
          - dps_val: true
            value: heating
          - dps_val: false
            value: idle
      - id: 106
        type: boolean
        name: unknown_106
      - id: 107
        type: boolean
        name: unknown_107
      - id: 108
        type: boolean
        name: temperature_display
        mapping:
          - dps_val: false
            value: internal
          - dps_val: true
            value: external
      - id: 114
        type: integer
        name: max_temperature
      - id: 115
        type: integer
        name: min_temperature
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 6
        type: boolean
        name: lock
  - entity: sensor
    name: External temperature
    class: temperature
    dps:
      - id: 103
        type: integer
        name: sensor
        class: measurement
        mapping:
          - scale: 10
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: Holiday days
    category: config
    dps:
      - id: 104
        type: integer
        unit: d
        name: value
        range:
          min: 1
          max: 30
  - entity: number
    name: Holiday temperature
    category: config
    class: temperature
    dps:
      - id: 105
        type: integer
        name: value
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
      - id: 114
        type: integer
        name: maximum
      - id: 115
        type: integer
        name: minimum
  - entity: number
    name: Calibration offset
    category: config
    dps:
      - id: 109
        type: integer
        name: value
        range:
          min: -9
          max: 9
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: Calibration swing internal
    category: config
    dps:
      - id: 110
        type: integer
        name: value
        range:
          min: 5
          max: 25
        mapping:
          - scale: 10
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: Calibration swing external
    category: config
    dps:
      - id: 111
        type: integer
        name: value
        range:
          min: 1
          max: 10
        mapping:
          - scale: 10
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: High temperature protection
    class: temperature
    category: config
    dps:
      - id: 112
        type: integer
        name: value
        range:
          min: 35
          max: 70
        mapping:
          - constraint: unit
            conditions:
              - dps_val: true
                range:
                  min: 95
                  max: 158
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: Low temperature protection
    category: config
    class: temperature
    dps:
      - id: 113
        type: integer
        name: value
        range:
          min: 1
          max: 10
        mapping:
          - constraint: unit
            conditions:
              - dps_val: true
                range:
                  min: 34
                  max: 50
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: High temperature limit
    category: config
    class: temperature
    dps:
      - id: 114
        type: integer
        name: value
        range:
          min: 2
          max: 70
        mapping:
          - constraint: unit
            conditions:
              - dps_val: true
                range:
                  min: 36
                  max: 158
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: Low temperature limit
    category: config
    class: temperature
    dps:
      - id: 115
        type: integer
        name: value
        range:
          min: 1
          max: 10
        mapping:
          - constraint: unit
            conditions:
              - dps_val: true
                range:
                  min: 34
                  max: 50
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: select
    name: Temperature sensor
    category: config
    dps:
      - id: 116
        type: string
        name: option
        mapping:
          - dps_val: in
            value: Internal
          - dps_val: ext
            value: External
          - dps_val: all
            value: Both
  - entity: select
    translation_key: initial_state
    category: config
    dps:
      - id: 117
        type: string
        name: option
        mapping:
          - dps_val: keep
            value: memory
          - dps_val: "off"
            value: "off"
          - dps_val: "on"
            value: "on"
  - entity: select
    name: Schedule
    category: config
    dps:
      - id: 118
        type: string
        name: option
        mapping:
          - dps_val: 0days
            value: 7 day
          - dps_val: 1days
            value: 6 + 1 day
          - dps_val: 2days
            value: 5 + 2 day
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 101
        type: boolean
        name: option
        mapping:
          - dps_val: false
            value: celsius
          - dps_val: true
            value: fahrenheit
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 12
        name: sensor
        type: bitfield
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 12
        type: bitfield
        name: fault_code
