name: Thermostat
products:
  - id: gw173aldekvpzalg
    name: Avatto WT200W-EH
primary_entity:
  entity: climate
  translation_only_key: thermostat
  dps:
    - id: 1
      name: hvac_mode
      type: boolean
      mapping:
        - dps_val: false
          value: "off"
        - dps_val: true
          constraint: preset_mode
          conditions:
            - dps_val: cold
              # manual
              value: heat
            - dps_val: hot
              # program
              value: auto
            - dps_val: wind
              # temporary program - HA does not have a distinct mode for this
              value: auto
    - id: 2
      name: temperature
      type: integer
      unit: C
      optional: true
      range:
        min: 50
        max: 700
      mapping:
        - scale: 10
    - id: 3
      name: current_temperature
      type: integer
      mapping:
        - scale: 10
    - id: 4
      name: preset_mode
      type: string
      mapping:
        - dps_val: cold
          value: manual
        - dps_val: hot
          value: program
        - dps_val: wind
          value: temp_override
          hidden: true
    - id: 5
      name: hvac_action
      type: string
      mapping:
        - dps_val: "0"
          constraint: hvac_mode
          conditions:
            - dps_val: true
              value: idle
            - dps_val: false
              value: "off"
        - dps_val: "1"
          value: heating
    - id: 16
      name: fault_code
      type: bitfield
    - id: 21
      name: max_temperature
      type: integer
secondary_entities:
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 8
        name: lock
        type: boolean
  - entity: switch
    name: Sound
    category: config
    icon: "mdi:music-note"
    dps:
      - id: 13
        type: boolean
        name: switch
  - entity: binary_sensor
    category: diagnostic
    class: problem
    dps:
      - id: 16
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
  - entity: number
    name: Temperature calibration
    category: config
    icon: "mdi:arrow-collapse-up"
    dps:
      - id: 20
        type: integer
        name: value
        range:
          min: -90
          max: 90
        mapping:
          - scale: 10
        unit: °
  - entity: number
    name: Maximum temperature
    category: config
    class: temperature
    icon: "mdi:thermometer-chevron-up"
    dps:
      - id: 21
        type: integer
        name: value
        range:
          min: 15
          max: 70
        unit: C
  - entity: select
    name: Sensor
    category: config
    icon: "mdi:home-thermometer"
    dps:
      - id: 25
        type: string
        name: option
        mapping:
          - dps_val: "1"
            value: Internal
          - dps_val: "2"
            value: External
          - dps_val: "3"
            value: Both
  - entity: switch
    translation_key: anti_frost
    category: config
    dps:
      - id: 26
        type: boolean
        name: switch
  - entity: button
    name: Reset
    category: config
    dps:
      - id: 31
        type: boolean
        name: button
  - entity: select
    name: Backlight brightness
    category: config
    dps:
      - id: 41
        type: string
        name: option
        mapping:
          - dps_val: "0"
            icon: "mdi:lightbulb-on-10"
            value: None
          - dps_val: "1"
            icon: "mdi:lightbulb-on-40"
            value: Low
          - dps_val: "2"
            icon: "mdi:lightbulb-on-70"
            value: Middle
          - dps_val: "3"
            icon: "mdi:lightbulb-on"
            value: High
  - entity: select
    name: Schedule
    category: config
    icon: "mdi:calendar-clock"
    dps:
      - id: 42
        type: string
        name: option
        optional: true
        mapping:
          - dps_val: "1"
            value: "Weekday+Weekend"
          - dps_val: "2"
            value: "Mon-Sat+Sun"
          - dps_val: "3"
            value: "Daily"
  - entity: switch
    name: Output reverse
    category: config
    icon: "mdi:swap-horizontal"
    dps:
      - id: 101
        type: boolean
        name: switch
  - entity: number
    name: Temperature hysteresis
    category: config
    icon: "mdi:thermometer-plus"
    dps:
      - id: 105
        type: integer
        name: value
        range:
          min: 5
          max: 95
        mapping:
          - scale: 10
        unit: °
  - entity: number
    name: External temperature limit
    category: config
    class: temperature
    icon: "mdi:arrow-collapse-up"
    dps:
      - id: 107
        type: integer
        name: value
        range:
          min: 20
          max: 70
        unit: C
