name: Salcar T9W thermostat
primary_entity:
  entity: climate
  dps:
    - id: 1
      name: hvac_mode
      type: boolean
      mapping:
        - dps_val: false
          value: "off"
        - dps_val: true
          constraint: mode
          conditions:
            - dps_val: auto
              value: auto
            - dps_val: manual
              value: heat
    - id: 2
      name: mode
      type: string
      hidden: true
    - id: 16
      name: temperature
      type: integer
      range:
        min: 50
        max: 10000
      mapping:
        - scale: 10
          step: 5
    - id: 19
      name: max_temperature
      type: integer
      mapping:
        - scale: 10
    - id: 23
      name: temperature_unit
      type: string
      mapping:
        - dps_val: c
          value: C
        - dps_val: f
          value: F
    - id: 24
      name: current_temperature
      type: integer
      mapping:
        - scale: 10
    - id: 26
      name: min_temperature
      type: integer
      mapping:
        - scale: 10
    - id: 36
      name: hvac_action
      type: string
      mapping:
        - dps_val: open
          constraint: hvac_mode
          conditions:
            - dps_val: false
              value: "off"
            - dps_val: true
              value: heating
        - dps_val: close
          constraint: hvac_mode
          conditions:
            - dps_val: false
              value: "off"
            - dps_val: idle
    - id: 45
      name: fault_code
      type: bitfield
      mapping:
        - dps_val: 0
          value: OK
        - dps_val: 1
          value: E1
        - dps_val: 2
          value: E2
        - dps_val: 4
          value: E3
secondary_entities:
  - entity: switch
    translation_key: anti_frost
    category: config
    dps:
      - id: 10
        type: boolean
        name: switch
  - entity: number
    name: Maximum temperature
    category: config
    class: temperature
    icon: "mdi:thermometer-chevron-up"
    dps:
      - id: 19
        type: integer
        name: value
        range:
          min: 50
          max: 10000
        mapping:
          - scale: 10
            step: 5
      - id: 23
        name: unit
        type: string
        mapping:
          - dps_val: c
            value: C
          - dps_val: f
            value: F
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 23
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: number
    name: Minimum temperature
    category: config
    class: temperature
    icon: "mdi:thermometer-chevron-down"
    dps:
      - id: 26
        type: integer
        name: value
        range:
          min: 50
          max: 10000
      - id: 23
        name: unit
        type: string
        mapping:
          - dps_val: c
            value: C
          - dps_val: f
            value: F
  - entity: select
    name: Schedule
    icon: "mdi:calendar-clock"
    category: config
    dps:
      - id: 31
        type: string
        name: option
        mapping:
          - dps_val: "5_2"
            value: 5 day work week
          - dps_val: "6_1"
            value: 6 day work week
          - dps_val: "7"
            value: Daily
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 40
        type: boolean
        name: lock
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 45
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
