name: Thermostat
products:
  - id: ohdk8akzkfjkqkbs
    manufacturer: Moes
    model: WHT-S01-GAC-WH-MS
entities:
  - entity: climate
    translation_key: thermostat
    dps:
      - id: 1
        type: boolean
        name: hvac_mode
        mapping:
          - dps_val: false
            value: "off"
          - dps_val: true
            value: heat
      - id: 2
        type: string
        name: preset_mode
        mapping:
          - dps_val: auto
            value: program
          - dps_val: manual
            value: manual
          - dps_val: ECO
            value: eco
      - id: 23
        type: string
        name: temperature_unit
        mapping:
          - dps_val: f
            value: F
          - value: C
      - id: 36
        type: string
        name: hvac_action
        mapping:
          - dps_val: open
            value: heating
          - dps_val: close
            value: idle
      - id: 111
        type: integer
        name: temperature
        range:
          min: 41
          max: 700
        mapping:
          - constraint: temperature_unit
            conditions:
              - dps_val: c
                scale: 10
                step: 5
                range:
                  min: 50
                  max: 700
              - dps_val: f
                value_redirect: temp_set_f
                range:
                  min: 41
                  max: 158
      - id: 112
        type: integer
        optional: true
        name: temp_set_f
        hidden: true
        range:
          min: 41
          max: 158
      - id: 113
        type: integer
        optional: true
        name: max_temp_f
        hidden: true
      - id: 114
        type: integer
        name: max_temperature
        mapping:
          - constraint: temperature_unit
            conditions:
              - dps_val: f
                value_redirect: max_temp_f
              - dps_val: c
                scale: 10
      - id: 115
        type: integer
        optional: true
        name: min_temp_f
        hidden: true
      - id: 116
        type: integer
        name: min_temperature
        mapping:
          - constraint: temperature_unit
            conditions:
              - dps_val: f
                value_redirect: min_temp_f
              - dps_val: c
                scale: 10
      - id: 117
        type: integer
        name: current_temperature
        mapping:
          - constraint: temperature_unit
            conditions:
              - dps_val: f
                value_redirect: current_temp_f
              - dps_val: c
                scale: 10
      - id: 118
        type: integer
        optional: true
        name: current_temp_f
        hidden: true
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 23
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: number
    translation_key: temperature_calibration
    class: temperature_delta
    category: config
    dps:
      - id: 27
        type: integer
        name: value
        range:
          min: -18
          max: 18
        mapping:
          - constraint: unit
            conditions:
              - dps_val: f
                value_redirect: temp_correct_f
              - dps_val: c
                range:
                  min: -9
                  max: 9
      - id: 23
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
      - id: 110
        type: integer
        optional: true
        name: temp_correct_f
        hidden: true
        range:
          min: -18
          max: 18
  - entity: button
    translation_key: factory_reset
    category: config
    hidden: true
    dps:
      - id: 39
        type: boolean
        optional: true
        name: button
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 40
        type: boolean
        name: lock
  - entity: select
    name: Temperature sensor
    icon: "mdi:home-thermometer"
    category: config
    dps:
      - id: 43
        type: string
        name: option
        mapping:
          - dps_val: in
            value: Internal
          - dps_val: out
            value: External
          - dps_val: both
            value: Both
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 45
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 45
        type: bitfield
        name: fault_code
  - entity: light
    translation_key: display
    category: config
    dps:
      - id: 52
        name: brightness
        type: string
        mapping:
          - dps_val: closed
            value: 0
          - dps_val: "20_bright"
            value: 51
          - dps_val: "50_bright"
            value: 128
          - dps_val: "100_bright"
            value: 255
  - entity: sensor
    name: Floor temperature
    class: temperature
    dps:
      - id: 101
        type: integer
        name: sensor
        class: measurement
        mapping:
          - constraint: unit
            conditions:
              - dps_val: f
                value_redirect: floor_temp_f
              - dps_val: c
                scale: 10
      - id: 23
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
      - id: 102
        type: integer
        optional: true
        name: floor_temp_f
        hidden: true
  - entity: switch
    translation_key: anti_frost
    category: config
    dps:
      - id: 103
        type: boolean
        name: switch
  - entity: select
    name: Program type
    icon: "mdi:calendar-week"
    category: config
    dps:
      - id: 104
        type: string
        name: option
        mapping:
          - dps_val: "off"
            value: "off"
          - dps_val: weekend
            value: Weekdays+Weekend
          - dps_val: single_break
            value: Mon-Sat+Sun
          - dps_val: no_day_off
            value: Daily
  - entity: number
    name: Temperature hysteresis
    class: temperature_delta
    category: config
    icon: "mdi:thermometer"
    dps:
      - id: 106
        type: integer
        name: value
        range:
          min: 1
          max: 30
        mapping:
          - constraint: unit
            conditions:
              - dps_val: f
                value_redirect: temp_diff_f
                range:
                  min: 1
                  max: 6
              - dps_val: c
                scale: 10
                step: 5
                range:
                  min: 5
                  max: 30
      - id: 105
        type: integer
        optional: true
        name: temp_diff_f
        hidden: true
        range:
          min: 1
          max: 6
      - id: 23
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: number
    name: Eco temperature
    category: config
    class: temperature
    dps:
      - id: 107
        type: integer
        name: value
        range:
          min: 5
          max: 95
        mapping:
          - constraint: unit
            conditions:
              - dps_val: c
                range:
                  min: 5
                  max: 35
              - dps_val: f
                value_redirect: eco_temp_f
                range:
                  min: 41
                  max: 95
      - id: 23
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
      - id: 109
        type: integer
        optional: true
        name: eco_temp_f
        range:
          min: 41
          max: 95
  - entity: text
    translation_key: schedule
    category: config
    hidden: true
    dps:
      - id: 108
        type: base64
        optional: true
        name: value
