name: Temperature controller with display
products:
  - id: rj84vmyhm0dh0jwy
    manufacturer: Atorch
    model: S1TW
entities:
  - entity: climate
    translation_key: thermostat
    dps:
      - id: 101
        type: string
        name: hvac_mode
        mapping:
          - dps_val: socket
            value: "off"
          - dps_val: hot
            value: heat
          - dps_val: colding
            value: cool
      - id: 103
        type: boolean
        name: hvac_action
        mapping:
          - dps_val: false
            value: idle
          - dps_val: true
            constraint: hvac_mode
            conditions:
              - dps_val: hot
                value: heating
              - dps_val: colding
                value: cooling
              - dps_val: socket
                value: "off"
      - id: 118
        type: string
        name: temperature_unit
        mapping:
          - dps_val: c
            value: C
          - dps_val: f
            value: F
      - id: 102
        type: integer
        name: current_temperature
        mapping:
          - scale: 10
            constraint: temperature_unit
            conditions:
              - dps_val: f
                value_redirect: current_temperature_f
      - id: 124
        type: integer
        name: current_temperature_f
        hidden: true
        mapping:
          - scale: 10
      - id: 104
        type: integer
        name: target_temp_low
        mapping:
          - scale: 10
            constraint: temperature_unit
            conditions:
              - dps_val: c
                value_redirect: target_temp_low_c
                range:
                  min: -200
                  max: 1200
              - dps_val: f
                value_redirect: target_temp_low_f
                range:
                  min: -40
                  max: 2480
      - id: 104
        type: integer
        name: target_temp_low_c
        hidden: true
        mapping:
          - scale: 10
            constraint: hvac_mode
            conditions:
              - dps_val: colding
                value_redirect: cooling_temp_low_c
      - id: 105
        type: integer
        name: cooling_temp_low_c
        hidden: true
        mapping:
          - scale: 10
      - id: 120
        type: integer
        name: target_temp_low_f
        hidden: true
        mapping:
          - scale: 10
            constraint: hvac_mode
            conditions:
              - dps_val: colding
                value_redirect: cooling_temp_low_f
      - id: 121
        type: integer
        name: cooling_temp_low_f
        hidden: true
        mapping:
          - scale: 10
      - id: 106
        type: integer
        name: target_temp_high
        mapping:
          - scale: 10
            constraint: temperature_unit
            conditions:
              - dps_val: c
                value_redirect: target_temp_high_c
                range:
                  min: -200
                  max: 1200
              - dps_val: f
                value_redirect: target_temp_high_f
                range:
                  min: -40
                  max: 2480
      - id: 106
        type: integer
        name: target_temp_high_c
        hidden: true
        mapping:
          - scale: 10
            constraint: hvac_mode
            conditions:
              - dps_val: colding
                value_redirect: cooling_temp_high_c
      - id: 107
        type: integer
        name: cooling_temp_high_c
        hidden: true
        mapping:
          - scale: 10
      - id: 122
        type: integer
        name: target_temp_high_f
        hidden: true
        mapping:
          - scale: 10
            constraint: hvac_mode
            conditions:
              - dps_val: colding
                value_redirect: cooling_temp_high_f
      - id: 123
        type: integer
        name: cooling_temp_high_f
        hidden: true
        mapping:
          - scale: 10
  - entity: switch
    class: outlet
    dps:
      - id: 103
        type: boolean
        name: switch
  - entity: sensor
    class: temperature
    dps:
      - id: 102
        type: integer
        name: sensor
        class: measurement
        mapping:
          - scale: 10
            constraint: unit
            conditions:
              - dps_val: f
                value_redirect: temperature_f
      - id: 124
        type: integer
        name: temperature_f
        hidden: true
        mapping:
          - scale: 10
      - id: 118
        type: string
        name: unit
        mapping:
          - dps_val: c
            value: C
          - dps_val: f
            value: F
      - id: 126
        type: boolean
        name: available
        mapping:
          - dps_val: true
            value: false
          - value: true
  - entity: sensor
    class: current
    category: diagnostic
    dps:
      - id: 108
        type: integer
        name: sensor
        unit: A
        class: measurement
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    category: diagnostic
    dps:
      - id: 109
        type: integer
        name: sensor
        unit: W
        class: measurement
        mapping:
          - scale: 100
  - entity: sensor
    class: voltage
    category: diagnostic
    dps:
      - id: 110
        type: integer
        name: sensor
        unit: V
        class: measurement
        mapping:
          - scale: 100
  - entity: sensor
    class: energy
    translation_key: energy_consumed
    dps:
      - id: 111
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 1000
      - id: 127
        type: integer
        name: add_ele
        optional: true
  - entity: number
    name: Price
    class: monetary
    category: config
    dps:
      - id: 112
        type: integer
        name: value
        range:
          min: 0
          max: 99999
        mapping:
          - scale: 100
  - entity: number
    name: Overvoltage threshold
    class: voltage
    category: config
    dps:
      - id: 113
        type: integer
        name: value
        unit: V
        range:
          min: 0
          max: 2750
        mapping:
          - scale: 10
  - entity: number
    name: Overcurrent threshold
    class: current
    category: config
    dps:
      - id: 114
        type: integer
        name: value
        unit: A
        range:
          min: 0
          max: 1600
        mapping:
          - scale: 100
  - entity: number
    name: Overpower threshold
    class: power
    category: config
    dps:
      - id: 115
        type: integer
        name: value
        unit: W
        range:
          min: 0
          max: 3680
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 116
        type: boolean
        name: lock
  - entity: number
    name: Temperature calibration
    icon: "mdi:thermometer-lines"
    category: config
    dps:
      - id: 117
        type: integer
        name: value
        unit: °
        range:
          min: -50
          max: 50
        mapping:
          - scale: 10
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 118
        type: string
        name: option
        mapping:
          - dps_val: c
            value: Celsius
          - dps_val: f
            value: Fahrenheit
  - entity: sensor
    name: Cost
    icon: mdi:cash-multiple
    dps:
      - id: 125
        type: integer
        name: sensor
        class: total_increasing
        mapping:
          - scale: 1000
  - entity: number
    name: Reporting interval
    class: duration
    category: config
    dps:
      - id: 128
        type: integer
        name: value
        unit: s
        range:
          min: 1
          max: 90
