name: Thermostat
products:
  - id: ma3oamwzywooctul
    manufacturer: Herschel
    model: T-MT Mains powered Wifi thermostat
entities:
  - entity: climate
    translation_only_key: thermostat
    dps:
      - id: 1
        name: hvac_mode
        type: boolean
        mapping:
          - dps_val: true
            value: heat
          - dps_val: false
            value: "off"
      - id: 2
        name: temperature
        type: integer
        range:
          min: 160
          max: 1040
        mapping:
          - scale: 10
            step: 5
            constraint: temperature_unit
            conditions:
              - dps_val: c
                range:
                  min: 160
                  max: 300
              - dps_val: f
                step: 10
                range:
                  min: 410
                  max: 1040
      - id: 3
        name: current_temperature
        type: integer
        mapping:
          - scale: 10
      - id: 104
        name: temperature_unit
        type: string
        optional: true
        mapping:
          - dps_val: f
            value: F
          - value: C
      - id: 111
        name: hvac_action
        type: boolean
        mapping:
          - dps_val: true
            value: heating
          - dps_val: false
            value: "off"
      - id: 4
        name: preset_mode
        type: string
        mapping:
          - dps_val: manual
            value: manual
          - dps_val: holiday
            value: away
          - dps_val: auto
            value: program

  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 6
        name: lock
        type: boolean

  - entity: number
    name: Holiday length
    category: config
    class: duration
    dps:
      - id: 101
        name: value
        type: integer
        unit: d
        range:
          min: 0
          max: 99

  - entity: switch
    name: Open window detection
    category: config
    icon: "mdi:window-open"
    dps:
      - id: 103
        name: switch
        type: boolean

  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 104
        type: string
        optional: true
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit

  - entity: number
    translation_key: temperature_calibration
    class: temperature_delta
    category: config
    dps:
      - id: 106
        name: value
        type: integer
        range:
          min: -90
          max: 90
        mapping:
          - scale: 10
      - id: 104
        type: string
        optional: true
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C

  - entity: switch
    name: Adaptive start
    category: config
    dps:
      - id: 107
        name: switch
        type: boolean
