name: Thermostat
products:
  - id: fy012zc3l51doakx
    manufacturer: ELKO
    model: EKO07262
entities:
  - entity: climate
    translation_key: thermostat
    dps:
      - id: 116
        name: hvac_mode
        type: boolean
        mapping:
          - dps_val: true
            value: "off"
          - dps_val: false
            value: heat
            available: not_connected
            constraint: mode_control
            conditions:
              - dps_val: ActiveHeat
                value: heat
                available: connected
              - dps_val: ActiveCool
                value: cool
                available: connected
      - id: 121
        type: string
        name: mode
        hidden: true
      - id: 139
        type: string
        name: mode_control
      - id: 139
        type: string
        name: not_connected
        mapping:
          - dps_val: NotConnected
            value: true
          - value: false
      - id: 139
        type: string
        name: connected
        mapping:
          - dps_val: NotConnected
            value: false
          - value: true
      - id: 152
        name: hvac_action
        type: boolean
        mapping:
          - dps_val: true
            value: heating
            constraint: mode
            conditions:
              - dps_val: Cool
                value: cooling
          - dps_val: false
            value: idle
      - id: 107
        name: temperature
        type: integer
        unit: C
        range:
          min: 0
          max: 4000
        mapping:
          - scale: 100
            step: 10
      - id: 104
        name: current_temperature
        type: integer
        unit: C
        mapping:
          - scale: 100
            constraint: device_preset
            conditions:
              - dps_val: [7, 8]
                value_redirect: floor_temperature
      - id: 118
        name: device_preset
        type: integer
      - id: 105
        type: integer
        name: floor_temperature
        unit: C
        mapping:
          - scale: 100
      - id: 140
        name: preset_mode
        type: string
        mapping:
          - dps_val: Manual
            value: manual
          - dps_val: Schedule
            value: program
          - dps_val: Override
            value: temp_override
          - dps_val: "Off"
            value: none
      - id: 101
        type: string
        name: firmware_version
      - id: 102
        type: string
        name: hardware_version
      - id: 145
        type: string
        name: product_info
  - entity: number
    name: Power rating
    category: config
    class: power
    dps:
      - id: 103
        name: value
        type: integer
        unit: W
        range:
          min: 0
          max: 3600
        mapping:
          - step: 100
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 131
        name: lock
        type: boolean
  - entity: number
    name: Active screen brightness
    icon: "mdi:brightness-6"
    category: config
    dps:
      - id: 132
        name: value
        type: integer
        unit: "%"
        range:
          min: 10
          max: 100
  - entity: number
    name: Standby screen brightness
    icon: "mdi:brightness-4"
    category: config
    dps:
      - id: 133
        name: value
        type: integer
        unit: "%"
        range:
          min: 0
          max: 100
  - entity: sensor
    name: External sensor type
    icon: "mdi:thermometer-probe"
    category: diagnostic
    class: enum
    dps:
      - id: 129
        type: string
        name: sensor
        mapping:
          - dps_val: "Not_Fitted"
            value: "Not Fitted"
          - dps_val: "2K"
            value: "2K Ohm"
          - dps_val: "10K"
            value: "10K Ohm"
          - dps_val: "12K"
            value: "12K Ohm"
          - dps_val: "15K"
            value: "15K Ohm"
          - dps_val: "33K"
            value: "33K Ohm"
          - dps_val: "47K"
            value: "47K Ohm"
  - entity: sensor
    name: Device type
    icon: "mdi:cog"
    category: diagnostic
    class: enum
    dps:
      - id: 118
        type: integer
        name: sensor
        mapping:
          - dps_val: 1
            value: "Heat Pump/Oil Boiler"
          - dps_val: 2
            value: "Hydronic Radiator/Gas Boiler"
          - dps_val: 3
            value: "Hydronic Underfloor"
          - dps_val: 4
            value: "Electrical Radiator"
          - dps_val: 5
            value: "Electrical Underfloor (Without floor limits)"
          - dps_val: 6
            value: "Electrical Underfloor (With floor limits)"
          - dps_val: 7
            value: "Hydronic Underfloor"
          - dps_val: 8
            value: "Electrical Underfloor"
          - dps_val: 9
            value: "Regulator Mode (output displayed is based on percentage)"
  - entity: sensor
    name: Floor temperature
    hidden: unavailable
    dps:
      - id: 105
        name: sensor
        type: integer
        unit: C
        class: measurement
        mapping:
          - scale: 100
      - id: 129
        name: available
        type: string
        mapping:
          - dps_val: "Not_Fitted"
            value: false
          - value: true
  - entity: sensor
    translation_key: ambient_temperature
    dps:
      - id: 104
        name: sensor
        type: integer
        unit: C
        class: measurement
        mapping:
          - scale: 100
  - entity: sensor
    class: power
    dps:
      - id: 150
        name: sensor
        type: integer
        unit: W
        class: measurement
  - entity: sensor
    class: energy
    dps:
      - id: 151
        name: sensor
        type: integer
        unit: Wh
        class: total_increasing
  - entity: datetime
    name: Override end
    category: config
    dps:
      - id: 108
        type: integer
        name: second
        range:
          min: 0
          max: 2147483647
        mapping:
          # device uses 1/1/2000 epoch, so shift it
          - target_range:
              min: 946684800
              max: 3094168447
  - entity: number
    name: Heating temperature
    class: temperature
    category: config
    dps:
      - id: 109
        type: integer
        name: value
        unit: C
        range:
          min: 0
          max: 4000
        mapping:
          - scale: 100
            step: 10
  - entity: number
    name: Cooling temperature
    class: temperature
    category: config
    dps:
      - id: 110
        type: integer
        name: value
        unit: C
        range:
          min: 0
          max: 4000
        mapping:
          - scale: 100
            step: 10
  - entity: number
    name: Away heating reduction
    class: temperature_delta
    category: config
    icon: "mdi:thermometer-minus"
    dps:
      - id: 111
        type: integer
        name: value
        unit: C
        range:
          min: 0
          max: 1000
        mapping:
          - scale: 100
            step: 50
  - entity: number
    name: Away cooling reduction
    category: config
    class: temperature_delta
    icon: "mdi:thermometer-plus"
    dps:
      - id: 112
        type: integer
        name: value
        unit: C
        range:
          min: 0
          max: 1000
        mapping:
          - scale: 100
            step: 50
  - entity: number
    name: Away minimum temperature
    category: config
    icon: "mdi:thermometer-chevron-up"
    dps:
      - id: 113
        type: integer
        name: value
        unit: C
        range:
          min: 0
          max: 4000
        mapping:
          - scale: 100
            step: 10
  - entity: number
    name: Away maximum temperature
    category: config
    icon: "mdi:thermometer-chevron-down"
    dps:
      - id: 114
        type: integer
        name: value
        unit: C
        range:
          min: 0
          max: 4000
        mapping:
          - scale: 100
            step: 10
  - entity: switch
    name: Away
    icon: "mdi:home-export-outline"
    category: config
    dps:
      - id: 115
        type: boolean
        name: switch
  - entity: switch
    name: Schedule
    icon: "mdi:calendar-clock"
    category: config
    dps:
      - id: 117
        type: boolean
        name: switch
  - entity: binary_sensor
    class: occupancy
    dps:
      - id: 122
        type: string
        name: sensor
        mapping:
          - dps_val: Occupied
            value: true
          - value: false
  - entity: binary_sensor
    class: window
    dps:
      - id: 123
        type: string
        name: sensor
        mapping:
          - dps_val: Open
            value: true
          - value: false
  - entity: number
    name: Room temperature calibration
    class: temperature_delta
    category: config
    icon: "mdi:thermometer-check"
    dps:
      - id: 128
        type: integer
        name: value
        unit: C
        range:
          min: -900
          max: 900
        mapping:
          - scale: 100
            step: 10
  - entity: number
    name: External temperature calibration
    category: config
    class: temperature_delta
    icon: "mdi:thermometer-check"
    dps:
      - id: 130
        type: integer
        name: value
        unit: C
        range:
          min: -900
          max: 900
        mapping:
          - scale: 100
            step: 10
  - entity: number
    name: Screen timeout
    category: config
    class: duration
    icon: "mdi:television-ambient-light"
    dps:
      - id: 134
        type: integer
        name: value
        unit: s
        range:
          min: 5
          max: 3600
      - id: 134
        type: integer
        name: available
        mapping:
          - dps_val: 65535
            value: false
          - value: true
  - entity: switch
    name: Screen timeout
    category: config
    icon: "mdi:television-ambient-light"
    dps:
      - id: 134
        type: integer
        name: switch
        mapping:
          - dps_val: 65535
            value: false
          - dps_val: 3600
            value: true
          - value: true
            hidden: true
  - entity: switch
    name: Regulator mode
    category: config
    dps:
      - id: 146
        type: boolean
        name: switch
