name: Heat pump
products:
  - id: 74jzzoqr2ghxyu1p
    name: Powerworld PW58410
primary_entity:
  entity: climate
  dps:
    - id: 1
      type: boolean
      name: hvac_mode
      mapping:
        - dps_val: false
          value: "off"
        - dps_val: true
          constraint: work_mode
          conditions:
            - dps_val: heat
              value: heat
            - dps_val: cool
              value: cool
            - dps_val: wth
              value: "off"
              hidden: true
            - dps_val: wth_heat
              value: heat
              hidden: true
            - dps_val: wth_cool
              value: cool
              hidden: true
    - id: 2
      type: string
      name: preset_mode
      mapping:
        - dps_val: smart
          value: comfort
        - dps_val: strong
          value: boost
        - dps_val: mute
          value: sleep
    - id: 5
      type: string
      name: work_mode
    - id: 6
      type: string
      name: temperature_unit
      mapping:
        - dps_val: f
          value: F
        - value: C
    - id: 111
      type: integer
      optional: true
      name: temperature
      range:
        min: 0
        max: 99
      mapping:
        - constraint: work_mode
          conditions:
            - dps_val: [cool, wth_cool]
              value_redirect: cool_temp
    - id: 112
      type: integer
      name: cool_temp
      optional: true
      hidden: true
      range:
        min: 0
        max: 99
secondary_entities:
  - entity: water_heater
    dps:
      - id: 1
        type: boolean
        name: operation_mode
        mapping:
          - dps_val: false
            value: "off"
          - dps_val: true
            constraint: work_mode
            conditions:
              - dps_val: wth
                value: Hot water
              - dps_val: heat
                value: Heating
              - dps_val: cool
                value: Cooling
              - dps_val: wth_heat
                value: Hot water + heating
              - dps_val: wth_cool
                value: Hot water + cooling
      - id: 5
        type: string
        name: work_mode
        hidden: true
      - id: 6
        type: string
        name: temperature_unit
        mapping:
          - dps_val: f
            value: F
          - value: C
      - id: 110
        type: integer
        name: temperature
        range:
          min: 0
          max: 99
      - id: 101
        type: base64
        optional: true
        name: current_temperature
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   00000000FFFFFFFF00000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 118
        type: string
        optional: true
        name: parameter_group_1
      - id: 119
        type: string
        optional: true
        name: parameter_group_2
      - id: 120
        type: string
        optional: true
        name: parameter_group_3
      - id: 121
        type: string
        optional: true
        name: parameter_group_4
      - id: 122
        type: string
        optional: true
        name: parameter_group_5
      - id: 123
        type: string
        optional: true
        name: parameter_group_6
      - id: 124
        type: string
        optional: true
        name: parameter_group_7
      - id: 126
        type: string
        optional: true
        name: parameter_group_8
      - id: 140
        type: string
        optional: true
        name: power_statistics
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 6
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 15
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 15
        type: bitfield
        name: fault_code
      - id: 199
        type: integer
        optional: true
        name: custom_fault_bit
  - entity: button
    translation_key: factory_reset
    category: config
    dps:
      - id: 125
        type: boolean
        optional: true
        name: button
  - entity: sensor
    name: Inlet temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "FFFFFFFF0000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: Outlet temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "00000000FFFFFFFF00000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: Ambient temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "0000000000000000FFFFFFFF000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: Exhaust temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "000000000000000000000000FFFFFFFF0000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: Air return temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "00000000000000000000000000000000FFFFFFFF00000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: Evaporator coil temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "0000000000000000000000000000000000000000FFFFFFFF\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: Cooling coil temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   FFFFFFFF0000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: Main EEV opening
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   0000000000000000FFFFFFFF000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    name: Secondary EEV opening
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   000000000000000000000000FFFFFFFF0000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    name: Compressor current
    class: current
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        unit: A
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   00000000000000000000000000000000FFFFFFFF00000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    name: Heat sink temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   0000000000000000000000000000000000000000FFFFFFFF\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: DC bus voltage
    class: voltage
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        unit: V
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   FFFFFFFF0000000000000000000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    name: Compressor frequency
    class: frequency
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        unit: Hz
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   00000000FFFFFFFF00000000000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    name: Fan 1 speed
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        unit: rpm
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000FFFFFFFF000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    name: Fan 2 speed
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        unit: rpm
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000FFFFFFFF0000000000000000\
                   0000000000000000"
  - entity: sensor
    class: pressure
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        unit: bar
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   00000000000000000000000000000000FFFFFFFF00000000\
                   0000000000000000"
  - entity: sensor
    name: Low pressure gas temperature
    class: temperature
    category: diagnostic
    dps:
      - id: 101
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000000000000000000000000000FFFFFFFF\
                   0000000000000000"
      - id: 6
        type: string
        name: unit
        mapping:
          - dps_val: f
            value: F
          - value: C
  - entity: sensor
    name: Heating capacity
    class: power
    category: diagnostic
    dps:
      - id: 140
        type: base64
        optional: true
        name: sensor
        unit: kW
        mapping:
          - mask: "FFFFFFFF0000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
            scale: 10
  - entity: sensor
    class: volume_flow_rate
    category: diagnostic
    dps:
      - id: 140
        type: base64
        optional: true
        name: sensor
        unit: m³/h
        mapping:
          - mask: "00000000FFFFFFFF00000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
            scale: 10
  - entity: sensor
    class: current
    category: diagnostic
    dps:
      - id: 140
        type: base64
        optional: true
        name: sensor
        unit: A
        mapping:
          - mask: "0000000000000000FFFFFFFF000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    class: voltage
    category: diagnostic
    dps:
      - id: 140
        type: base64
        optional: true
        name: sensor
        unit: V
        mapping:
          - mask: "000000000000000000000000FFFFFFFF0000000000000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    class: power
    category: diagnostic
    dps:
      - id: 140
        type: base64
        optional: true
        name: sensor
        unit: W
        mapping:
          - mask: "00000000000000000000000000000000FFFFFFFF00000000\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
  - entity: sensor
    name: Coefficient of performance
    category: diagnostic
    dps:
      - id: 140
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "0000000000000000000000000000000000000000FFFFFFFF\
                   000000000000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
            scale: 10
  - entity: number
    name: Pump speed
    category: config
    dps:
      - id: 140
        type: base64
        optional: true
        name: value
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   FFFFFFFF0000000000000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
        range:
          min: 0
          max: 100
  - entity: sensor
    name: Pump speed
    category: diagnostic
    dps:
      - id: 140
        type: base64
        optional: true
        name: sensor
        mapping:
          - mask: "000000000000000000000000000000000000000000000000\
                   00000000FFFFFFFF00000000000000000000000000000000\
                   000000000000000000000000000000000000000000000000\
                   0000000000000000"
