name: Thermostat
products:
  - id: 1oi7spyvsihkwrrr
    manufacturer: Drexma Industries inc.
    model: "WiStat"
    model_id: "ET-7AW"
entities:
  - entity: climate
    translation_key: thermostat
    dps:
      - id: 101
        type: boolean
        name: hvac_mode
        mapping:
          - dps_val: false
            value: "off"
          - dps_val: true
            value: heat
      - id: 102
        type: integer
        name: temperature
        range:
          min: 50
          max: 400
        mapping:
          - scale: 10
            step: 5
            constraint: temperature_unit
            conditions:
              - dps_val: true
                step: 10
                range:
                  min: 410
                  max: 1040
      - id: 103
        type: string
        name: preset_mode
        mapping:
          - dps_val: "Smart"
            value: program
          - dps_val: "Manual"
            value: manual
          - dps_val: "Anti_frozen"
            value: away
      - id: 105
        type: integer
        name: current_temperature
        mapping:
          - constraint: sensor
            conditions:
              - dps_val: "0"
                scale: 10
              - dps_val: "1"
                value_redirect: floor_temperature
              - dps_val: "2"
                scale: 10
      - id: 106
        type: integer
        name: floor_temperature
        hidden: true
        mapping:
          - scale: 10
      - id: 107
        name: temperature_unit
        type: boolean
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
      - id: 111
        type: string
        name: sensor
        hidden: true
      - id: 118
        type: boolean
        name: hvac_action
        mapping:
          - dps_val: true
            value: heating
          - dps_val: false
            value: idle
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 104
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 104
        type: bitfield
        name: fault_code
      - id: 104
        type: bitfield
        name: description
        mapping:
          - dps_val: 0
            value: ok
          - dps_val: 1
            value: Room sensor fault
          - dps_val: 2
            value: Floor sensor fault
          - dps_val: 4
            value: GFCI fault
  - entity: sensor
    name: Room temperature
    class: temperature
    icon: "mdi:home-thermometer"
    dps:
      - id: 105
        type: integer
        name: sensor
        class: measurement
        mapping:
          - scale: 10
      - id: 107
        name: unit
        type: boolean
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: sensor
    name: Floor temperature
    class: temperature
    icon: "mdi:thermometer-lines"
    dps:
      - id: 106
        type: integer
        name: sensor
        class: measurement
        mapping:
          - scale: 10
      - id: 107
        name: unit
        type: boolean
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: select
    category: config
    translation_key: temperature_unit
    dps:
      - id: 107
        name: option
        type: boolean
        mapping:
          - dps_val: false
            value: celsius
          - dps_val: true
            value: fahrenheit
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 108
        type: boolean
        name: lock
  - entity: select
    name: Location
    category: config
    icon: "mdi:map-marker-multiple-outline"
    hidden: true
    dps:
      - id: 109
        name: option
        type: boolean
        mapping:
          - dps_val: false
            value: Home
          - dps_val: true
            value: Office
  - entity: select
    category: config
    name: Auto schedule
    icon: "mdi:calendar-sync"
    dps:
      - id: 110
        type: integer
        name: option
        mapping:
          - dps_val: 0
            value: "7"
          - dps_val: 1
            value: "5+1+1"
          - dps_val: 2
            value: "7 (Adaptive)"
          - dps_val: 3
            value: "5+1+1 (Adaptive)"
  - entity: select
    category: config
    name: Temperature sensor
    icon: "mdi:thermometer-check"
    dps:
      - id: 111
        type: string
        name: option
        mapping:
          - dps_val: "0"
            value: "Room"
            icon: "mdi:home-thermometer"
          - dps_val: "1"
            value: "Floor"
            icon: "mdi:heating-coil"
          - dps_val: "2"
            value: "Both"
            icon: "mdi:thermometer"
  - entity: number
    category: config
    name: Room temperature calibration
    class: temperature_delta
    icon: "mdi:tune-vertical-variant"
    dps:
      - id: 112
        type: integer
        name: value
        range:
          min: -50
          max: 50
        mapping:
          - scale: 10
            step: 5
            constraint: unit
            conditions:
              - dps_val: true
                step: 10
                range:
                  min: -90
                  max: 90
      - id: 107
        name: unit
        type: boolean
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    category: config
    name: Floor temperature calibration
    class: temperature_delta
    icon: "mdi:tune-variant"
    dps:
      - id: 113
        type: integer
        name: value
        range:
          min: -50
          max: 50
        mapping:
          - scale: 10
            step: 5
            constraint: unit
            conditions:
              - dps_val: true
                step: 10
                range:
                  min: -90
                  max: 90
      - id: 107
        name: unit
        type: boolean
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
  - entity: number
    name: Heater wattage
    class: power
    category: config
    hidden: true
    dps:
      - id: 116
        type: integer
        name: value
        unit: W
        range:
          min: 0
          max: 4500
  - entity: sensor
    name: Runtime
    class: duration
    hidden: true
    dps:
      - id: 117
        type: integer
        name: sensor
        unit: d
        mapping:
          - scale: 2
  - entity: number
    category: config
    class: temperature
    name: Floor temperature limit
    icon: "mdi:thermometer-chevron-down"
    dps:
      - id: 121
        type: integer
        name: value
        range:
          min: 200
          max: 500
        mapping:
          - scale: 10
            step: 5
            constraint: unit
            conditions:
              - dps_val: true
                step: 10
                range:
                  min: 680
                  max: 1220
      - id: 107
        name: unit
        type: boolean
        mapping:
          - dps_val: false
            value: C
          - dps_val: true
            value: F
