name: Pool heatpump
products:
  - id: qrlLaHWwIsZsV31f
    name: Phalén Calidi XP
    # - id: UNKNOWN
    #   name: Fairland InverterPlus
primary_entity:
  entity: climate
  dps:
    - id: 1
      name: hvac_mode
      type: boolean
      mapping:
        - dps_val: false
          value: "off"
          icon: "mdi:hvac-off"
          icon_priority: 1
        - dps_val: true
          constraint: mode
          conditions:
            - dps_val: warm
              value: heat
            - dps_val: cool
              value: cool
            - dps_val: smart
              value: heat_cool
    - id: 102
      name: current_temperature
      type: integer
    - id: 103
      name: temperature_unit
      type: boolean
      mapping:
        - dps_val: false
          value: F
        - dps_val: true
          value: C
    - id: 105
      name: mode
      type: string
      icon_priority: 4
      mapping:
        - dps_val: warm
          icon: "mdi:hot-tub"
        - dps_val: cool
          icon: "mdi:snowflake"
        - dps_val: smart
          icon: "mdi:refresh-auto"
    - id: 106
      name: temperature
      type: integer
      mapping:
        - constraint: temperature_unit
          conditions:
            - dps_val: false
              range:
                min: 55
                max: 115
      range:
        min: 12
        max: 45
    - id: 107
      type: integer
      name: min_temperature
    - id: 108
      type: integer
      name: max_temperature
    - id: 115
      type: bitfield
      name: error
      mapping:
        - dps_val: 0
          value: OK
        - dps_val: 4
          value: Water Flow Protection
          icon: "mdi:water-pump-off"
          icon_priority: 2
    - id: 116
      type: bitfield
      name: error_2
    - id: 117
      name: preset_mode
      type: boolean
      mapping:
        - dps_val: false
          value: sleep
        - dps_val: true
          value: boost
secondary_entities:
  - entity: sensor
    category: diagnostic
    name: Power level
    icon: "mdi:signal"
    class: power_factor
    dps:
      - id: 104
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: binary_sensor
    name: Water flow
    class: problem
    category: diagnostic
    dps:
      - id: 115
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 4
            value: true
          - value: false
