name: Thermostat
products:
  - id: 9u1pognermrqhicq
    manufacturer: Hysen
    model: HY101RF
entities:
  - entity: climate
    translation_key: thermostat
    dps:
      - id: 1
        type: boolean
        name: hvac_mode
        mapping:
          - dps_val: false
            value: "off"
          - dps_val: true
            constraint: level
            conditions:
              - dps_val: cool
                value: cool
              - dps_val: heat
                value: heat
      - id: 3
        type: integer
        name: temperature
        range:
          min: 5
          max: 700
        mapping:
          - scale: 10
            constraint: preset_mode
            conditions:
              - dps_val: Holiday
                value_redirect: away_temperature
      - id: 4
        type: string
        name: preset_mode
        mapping:
          - dps_val: Manual
            value: manual
          - dps_val: Program
            value: program
          - dps_val: Holiday
            value: away
          - dps_val: TempProg
            value: temp_override
      - id: 24
        type: integer
        name: current_temperature
        mapping:
          - scale: 10
            constraint: ext_temp_display
            conditions:
              - dps_val: true
                value_redirect: external_temperature
      - id: 28
        type: string
        name: level
        hidden: true
      - 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: false
            value: idle
          - constraint: level
            conditions:
              - dps_val: cool
                value: cooling
              - dps_val: heat
                value: heating
      - id: 103
        type: integer
        name: external_temperature
        class: measurement
        mapping:
          - scale: 10
      - id: 105
        type: integer
        name: away_temperature
      - id: 108
        type: boolean
        name: ext_temp_display
      - 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: 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
  - 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: number
    name: Holiday length
    class: duration
    category: config
    icon: "mdi:calendar"
    dps:
      - id: 104
        type: integer
        name: value
        unit: d
        range:
          min: 1
          max: 30
  - entity: switch
    name: High temperature protection
    icon: "mdi:thermometer-alert"
    category: config
    dps:
      - id: 106
        type: boolean
        name: switch
  - entity: switch
    name: Low temperature protection
    icon: "mdi:thermometer-alert"
    category: config
    dps:
      - id: 107
        type: boolean
        name: switch
  - entity: number
    name: Room temperature compensation
    category: config
    icon: "mdi:thermometer-check"
    dps:
      - id: 109
        type: integer
        name: value
        unit: °
        range:
          min: -180
          max: 180
        mapping:
          - scale: 10
  - entity: number
    name: Room temperature zone
    category: config
    icon: "mdi:thermometer-plus"
    dps:
      - id: 110
        type: integer
        name: value
        unit: °
        range:
          min: 1
          max: 180
        mapping:
          - scale: 10
  - entity: number
    name: External temperature zone
    category: config
    icon: "mdi:thermometer-plus"
    dps:
      - id: 111
        type: integer
        name: value
        unit: °
        range:
          min: 1
          max: 18
  - entity: number
    name: High temperature limit
    category: config
    class: temperature
    icon: "mdi:thermometer-alert"
    dps:
      - id: 112
        type: integer
        name: value
        range:
          min: 20
          max: 70
      - 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
    icon: "mdi:thermometer-alert"
    dps:
      - id: 113
        type: integer
        name: value
        range:
          min: 1
          max: 10
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: Maximum temperature
    category: config
    class: temperature
    icon: "mdi:thermometer-chevron-up"
    dps:
      - id: 114
        type: integer
        name: value
        range:
          min: 20
          max: 70
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: Minimum temperature
    category: config
    class: temperature
    icon: "mdi:thermometer-chevron-down"
    dps:
      - id: 115
        type: integer
        name: value
        range:
          min: 1
          max: 10
      - id: 101
        type: boolean
        name: unit
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: select
    name: Temperature sensor
    icon: "mdi:home-thermometer"
    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: Program type
    icon: "mdi:calendar-week"
    category: config
    dps:
      - id: 118
        type: string
        name: option
        mapping:
          - dps_val: "2days"
            value: "Weekdays+Weekend"
          - dps_val: "1days"
            value: "Mon-Sat+Sun"
          - dps_val: "0days"
            value: Daily
      - id: 119
        type: string
        optional: true
        name: program_workday_1
      - id: 120
        type: string
        optional: true
        name: program_workday_2
      - id: 121
        type: string
        optional: true
        name: program_restday_1
      - id: 122
        type: string
        optional: true
        name: program_restday_2
