name: Thermostat switch
products:
  - id: key7rucurh5teh9w
    model: TYTE-D1
entities:
  - entity: switch
    name: Manual override
    dps:
      - id: 2
        type: boolean
        name: switch
  - entity: climate
    dps:
      - id: 2
        type: boolean
        name: hvac_action
        mapping:
          - dps_val: false
            value: idle
          - dps_val: true
            constraint: work_mode
            conditions:
              - dps_val: hot
                value: heating
              - dps_val: colding
                value: cooling
      - id: 9
        type: boolean
        name: hvac_mode
        mapping:
          - dps_val: false
            value: "off"
          - dps_val: true
            constraint: work_mode
            conditions:
              - dps_val: hot
                value: heat
              - dps_val: colding
                value: cool
      - id: 7
        type: string
        name: cycle_time
      - id: 8
        type: string
        name: work_mode
        hidden: true
      - id: 19
        type: integer
        name: test_bit
      - id: 20
        type: string
        name: temperature_unit
        mapping:
          - dps_val: f
            value: F
          - value: C
      - id: 21
        type: integer
        name: temp_set_f
        hidden: true
        range:
          min: -40
          max: 2210
        mapping:
          - scale: 10
            step: 5
      - id: 22
        type: integer
        name: temperature
        range:
          min: -200
          max: 1050
        mapping:
          - scale: 10
            step: 5
            constraint: temperature_unit
            conditions:
              - dps_val: f
                value_redirect: temp_set_f
                range:
                  min: -40
                  max: 2210
      - id: 27
        type: integer
        name: current_temperature
        mapping:
          - scale: 10
            constraint: temperature_unit
            conditions:
              - dps_val: f
                value_redirect: current_temp_f
      - id: 28
        type: integer
        name: current_temp_f
        hidden: true
        mapping:
          - scale: 10
  - entity: time
    translation_key: timer
    category: config
    dps:
      - id: 4
        type: integer
        name: second
        range:
          min: 0
          max: 86399
  - entity: number
    translation_key: timer
    deprecated: time.timer  # 2026-01-20
    class: duration
    category: config
    dps:
      - id: 4
        type: integer
        name: value
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
  - entity: sensor
    name: Electricity consumption
    category: diagnostic
    dps:
      - id: 10
        type: integer
        name: sensor
        unit: Wh
        optional: true
      - id: 17
        type: integer
        name: coefficient
        optional: true
  - entity: sensor
    class: current
    category: diagnostic
    dps:
      - id: 11
        type: integer
        name: sensor
        unit: mA
        class: measurement
      - id: 15
        type: integer
        name: coefficient
  - entity: sensor
    class: power
    category: diagnostic
    dps:
      - id: 12
        type: integer
        name: sensor
        unit: W
        class: measurement
        mapping:
          - scale: 10
      - id: 16
        type: integer
        name: coefficient
      - id: 18
        type: integer
        name: limit
  - entity: sensor
    class: voltage
    category: diagnostic
    dps:
      - id: 13
        type: integer
        name: sensor
        unit: V
        class: measurement
        mapping:
          - scale: 10
      - id: 14
        type: integer
        name: coefficient
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 20
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: number
    name: Temperature hysteresis
    category: config
    icon: "mdi:thermometer-plus"
    dps:
      - id: 29
        type: integer
        name: value
        range:
          min: 10
          max: 90
        mapping:
          - scale: 10
            step: 5
  - entity: number
    translation_key: temperature_calibration
    class: temperature_delta
    category: config
    dps:
      - id: 30
        type: integer
        name: value
        range:
          min: -9
          max: 9
      - id: 20
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 50
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 50
        type: bitfield
        name: fault_code
      - id: 50
        type: bitfield
        name: description
        mapping:
          - dps_val: 0
            value: OK
          - dps_val: 1
            value: Overcurrent
          - dps_val: 2
            value: Overvoltage
          - dps_val: 4
            value: Overpower
          - dps_val: 8
            value: LS Current
          - dps_val: 16
            value: LS Voltage
          - dps_val: 32
            value: LS Power
  - entity: number
    name: Turn on delay
    category: config
    class: duration
    icon: "mdi:camera-timer"
    dps:
      - id: 55
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 10
  - entity: switch
    name: Turn on delay
    category: config
    icon: "mdi:camera-timer"
    dps:
      - id: 56
        type: boolean
        name: switch
