name: RYRA TYTE-D1 thermostat
primary_entity:
  entity: climate
  dps:
    - id: 2
      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
            - dps_val: dehumidify
              value: dry
            - dps_val: wet
              value: dry
    - id: 7
      type: string
      name: cycle_time
    - id: 8
      type: string
      name: work_mode
      hidden: true
    - id: 9
      type: boolean
      name: customize_mode_switch
    - id: 19
      type: integer
      name: test_bit
    - id: 20
      type: string
      name: temperature_unit
      mapping:
        - dps_val: c
          value: C
        - dps_val: f
          value: F
    - 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
    - id: 50
      type: bitfield
      name: fault_code
      mapping:
        - 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
secondary_entities:
  - entity: number
    translation_key: timer
    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: Vibration
    category: config
    icon: "mdi:volume-vibrate"
    dps:
      - id: 29
        type: integer
        name: value
        range:
          min: 10
          max: 90
        mapping:
          - scale: 10
            step: 5
  - entity: number
    name: Temperature correction
    category: config
    icon: "mdi:format-vertical-align-center"
    dps:
      - id: 30
        type: integer
        name: value
        range:
          min: -9
          max: 9
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 50
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
  - entity: number
    name: Cold delay
    category: config
    icon: "mdi:camera-timer"
    dps:
      - id: 55
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 10
  - entity: switch
    name: Cold delay switch
    category: config
    icon: "mdi:camera-timer"
    dps:
      - id: 56
        type: boolean
        name: switch
