name: PJ-1103 clamp power meter
products:
  - id: djfep9s6s3b2qk89
primary_entity:
  entity: sensor
  class: power
  dps:
    - id: 19
      name: sensor
      type: integer
      unit: W
      class: measurement
      force: true
      mapping:
        - scale: 10
    - id: 24
      name: calibration
      type: integer
      optional: true
    - id: 21
      type: bitfield
      name: test
      optional: true
    - id: 26
      type: bitfield
      name: fault_code
      optional: true
secondary_entities:
  - entity: sensor
    class: current
    category: diagnostic
    dps:
      - id: 18
        type: integer
        name: sensor
        unit: A
        force: true
        class: measurement
        mapping:
          - scale: 1000
      - id: 23
        type: integer
        name: calibration
        optional: true
  - entity: sensor
    class: voltage
    category: diagnostic
    dps:
      - id: 20
        type: integer
        name: sensor
        unit: V
        force: true
        class: measurement
        mapping:
          - scale: 10
      - id: 22
        type: integer
        name: calibration
        optional: true
  - entity: number
    name: Maximum reactive power
    category: config
    class: power_factor
    dps:
      - id: 51
        type: integer
        name: value
        optional: true
        unit: "%"
        range:
          min: 10
          max: 100
        mapping:
          - dps_val: null
            invalid: true
  - entity: number
    name: Maximum effective power
    category: config
    class: power
    dps:
      - id: 52
        type: integer
        name: value
        optional: true
        unit: W
        range:
          min: 0
          max: 150000
        mapping:
          - dps_val: null
            invalid: true
          - scale: 10
            step: 100
  - entity: sensor
    name: Energy
    category: diagnostic
    dps:
      - id: 17
        type: integer
        name: sensor
        optional: true
        unit: kWh
        mapping:
          - dps_val: null
          - scale: 1000
      - id: 25
        type: integer
        name: calibration
        optional: true
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 26
        type: bitfield
        name: sensor
        optional: true
        persist: false
        mapping:
          - dps_val: null
            value: false
          - dps_val: 0
            value: false
          - value: true
