name: Thermostat
legacy_type: thermoval_tvt40_thermostat
products:
  - id: jIRwsT5yLPJO41Po
    manufacturer: Thermoval / Saswell
    model: TVT 40 / C16
entities:
  - entity: climate
    translation_only_key: thermostat
    dps:
      - id: 2
        name: temperature
        type: integer
        unit: C
        range:
          min: 50
          max: 400
        mapping:
          - scale: 10
            step: 5
      - id: 3
        name: preset_mode
        type: string
        mapping:
          - dps_val: Smart
            value: program
          - dps_val: Anti_frozen
            value: away
          - dps_val: Manual
            value: manual
      - id: 5
        name: current_temperature
        type: integer
        mapping:
          - scale: 10
            constraint: sensor_select
            conditions:
              - dps_val: "0"
                value_redirect: floor_temperature
      - id: 6
        name: floor_temp_limit
        type: integer
        mapping:
          - scale: 10
      - id: 7
        name: installation
        type: boolean
        mapping:
          - dps_val: true
            value: Office
          - dps_val: false
            value: Home
      - id: 8
        name: floor_temperature
        type: integer
        mapping:
          - scale: 10
        hidden: true
      - id: 9
        name: hvac_mode
        type: boolean
        readonly: true
        mapping:
          - dps_val: false
            value: "heat"
          - dps_val: true
            value: "cool"
      - id: 10
        name: adaptive
        type: boolean
      - id: 12
        name: schedule
        type: string
      - id: 24
        name: hvac_action
        type: string
        mapping:
          - dps_val: Standby
            value: idle
          - dps_val: Heating
            value: heating
          - dps_val: Cooling
            value: cooling
      - id: 26
        name: antifreeze_settings
        optional: true
        type: integer
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 4
        name: sensor
        type: bitfield
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 4
        name: fault_code
        type: bitfield
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 11
        name: lock
        type: boolean
  - entity: number
    name: Floor temperature limit
    category: config
    class: temperature
    icon: "mdi:thermometer-alert"
    dps:
      - id: 6
        name: value
        type: integer
        unit: C
        range:
          min: 200
          max: 500
        mapping:
          - scale: 10
            step: 5
  - entity: select
    name: Installation
    category: config
    dps:
      - id: 7
        name: option
        type: boolean
        mapping:
          - dps_val: true
            value: Office
            icon: "mdi:office-building-marker"
          - dps_val: false
            value: Home
            icon: "mdi:home-map-marker"
  - entity: sensor
    name: Floor temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 8
        name: sensor
        type: integer
        class: measurement
        unit: C
        mapping:
          - scale: 10
  - entity: switch
    name: Adaptive
    icon: "mdi:school"
    category: config
    dps:
      - id: 10
        name: switch
        type: boolean
  - entity: select
    name: Schedule
    icon: "mdi:calendar-clock"
    category: config
    dps:
      - id: 12
        name: option
        type: string
        mapping:
          - dps_val: "5_1_1"
            value: "Weekdays+Sat+Sun"
          - dps_val: "7"
            value: "Daily"
  - entity: select
    name: Sensor select
    icon: "mdi:home-thermometer"
    category: config
    dps:
      - id: 14
        name: option
        type: string
        mapping:
          - dps_val: "0"
            value: "Floor sensor"
          - dps_val: "1"
            value: "Room sensor"
          - dps_val: "2"
            value: "Room sensor with floor sensor limit"
          - dps_val: "3"
            value: "External room sensor"
          - dps_val: "4"
            value: "External room sensor with floor sensor limit"
  - entity: number
    name: Room temperature calibration
    icon: "mdi:thermometer-check"
    category: config
    dps:
      - id: 15
        name: value
        type: integer
        unit: C
        range:
          min: -50
          max: 50
        mapping:
          - scale: 10
            step: 5
  - entity: number
    name: Floor temperature calibration
    icon: "mdi:thermometer-check"
    category: config
    dps:
      - id: 17
        name: value
        type: integer
        unit: C
        range:
          min: -50
          max: 50
        mapping:
          - scale: 10
            step: 5
  - entity: number
    name: Power rating
    category: config
    class: power
    icon: "mdi:signal"
    dps:
      - id: 22
        name: value
        type: integer
        unit: W
        range:
          min: 0
          max: 3500
  - entity: sensor
    name: Power Consumption Duration
    category: diagnostic
    icon: "mdi:clock"
    dps:
      - id: 23
        name: sensor
        type: integer
        class: measurement
        unit: h
  - entity: button
    translation_key: factory_reset
    category: config
    dps:
      - id: 21
        type: boolean
        optional: true
        name: button
