name: Hysen HY08ACF thermostat
products:
  - id: xhx9h0duu9b9bobs
primary_entity:
  entity: climate
  translation_only_key: thermostat
  dps:
    - id: 1
      type: boolean
      name: hvac_mode
      mapping:
        - dps_val: false
          value: "off"
        - dps_val: true
          constraint: operation
          conditions:
            - dps_val: heat
              value: heat
            - dps_val: cool
              value: cool
            - dps_val: ventilate
              value: fan_only
            - dps_val: auto
              value: heat_cool
    - id: 2
      type: integer
      name: temperature
      unit: C
      range:
        min: 50
        max: 500
      mapping:
        - scale: 10
          step: 5
    - id: 3
      type: integer
      name: current_temperature
      mapping:
        - scale: 10
    - id: 4
      type: string
      name: preset_mode
      mapping:
        - dps_val: Program
          value: program
        - dps_val: TempProg
          value: temp_override
          hidden: true
        - dps_val: Manual
          value: manual
        - dps_val: Holiday
          value: away
    - id: 5
      type: string
      name: fan_mode
      mapping:
        - dps_val: low
          value: low
        - dps_val: med
          value: medium
        - dps_val: high
          value: high
        - dps_val: auto
          value: auto
          constraint: operation
          conditions:
            - dps_val: ventilate
              invalid: true
    - id: 13
      type: bitfield
      name: fault_code
    - id: 103
      type: integer
      name: max_temperature
    - id: 104
      type: integer
      name: min_temperature
    - id: 118
      name: operation
      type: string
      hidden: true
    - id: 119
      name: hvac_action
      type: string
      mapping:
        - constraint: hvac_mode
          conditions:
            - dps_val: false
              value: "off"
            - dps_val: true
              mapping:
                - dps_val: "0"
                  value: idle
                - dps_val: "1"
                  value: heating
                - dps_val: "2"
                  value: cooling
                # another variant uses long names
                - dps_val: heatvalve
                  value: heating
                - dps_val: coolvalve
                  value: cooling
                - dps_val: closed
                  value: idle
    - id: 121
      name: program
      type: integer
      optional: true
secondary_entities:
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 7
        type: boolean
        name: lock
      - id: 105
        type: string
        name: lock_type
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 13
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
  - entity: switch
    translation_key: sleep
    category: config
    dps:
      - id: 117
        type: boolean
        name: switch
  - entity: sensor
    name: External temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: integer
        name: sensor
        unit: C
        mapping:
          - scale: 10
  - entity: number
    name: Temperature calibration
    category: config
    icon: "mdi:arrow-collapse-up"
    dps:
      - id: 102
        type: integer
        name: value
        unit: C
        range:
          min: -90
          max: 90
        mapping:
          - scale: 10
  - entity: number
    name: Maximum temperature
    category: config
    class: temperature
    icon: "mdi:thermometer-chevron-up"
    dps:
      - id: 103
        type: integer
        name: value
        unit: C
        range:
          min: 16
          max: 50
  - entity: number
    name: Minimum temperature
    category: config
    class: temperature
    icon: "mdi:thermometer-chevron-down"
    dps:
      - id: 104
        type: integer
        name: value
        unit: C
        range:
          min: 5
          max: 15
  - entity: switch
    name: Fan ECO
    category: config
    icon: "mdi:fan"
    dps:
      - id: 106
        name: switch
        type: string
        mapping:
          - dps_val: eco
            value: true
          - dps_val: nosaving
            value: false
  - entity: select
    name: Schedule
    category: config
    icon: "mdi:calendar-clock"
    dps:
      - id: 107
        name: option
        type: string
        mapping:
          - dps_val: "2daysrest"
            value: Weekdays+Weekend
          - dps_val: "1daysrest"
            value: 6 days+Sunday
          - dps_val: "0daysrest"
            value: Daily
      - id: 108
        name: workday_config
        type: string
        optional: true
      - id: 109
        name: restday_config
        type: string
        optional: true
  - entity: select
    name: Sensor
    category: config
    icon: "mdi:home-thermometer"
    dps:
      - id: 120
        type: string
        name: option
        mapping:
          - dps_val: in
            value: Internal
          - dps_val: out
            value: External
