name: Circuit breaker energy meter
products:
  - id: rrmpzckqm5pfd642
    model: TOMPD-63LW
  - id: psjg8ldomxnelfp5
    model: TOMZN-63A
  - id: u0cxoxtfelys3ufx
    model: TOMPD-63LW
entities:
  - entity: switch
    icon: "mdi:fuse"
    dps:
      - id: 16
        name: switch
        type: boolean
      - id: 17
        name: alarm_set_1
        optional: true
        type: string
      - id: 18
        name: alarm_set_2
        optional: true
        type: string
      - id: 6
        name: phase_a
        type: base64
        optional: true
        force: true
      - id: 19
        name: breaker_number
        type: string
  - entity: switch
    name: Prepayment
    icon: "mdi:cash-multiple"
    category: config
    dps:
      - id: 11
        type: boolean
        name: switch
  - entity: button
    name: Energy reset
    class: restart
    category: config
    dps:
      - id: 12
        type: boolean
        name: button
        optional: true
  - entity: button
    name: Refresh sensors
    class: restart
    category: config
    dps:
      - id: 106
        type: boolean
        name: button
        optional: true
  - entity: sensor
    name: Balance energy
    category: diagnostic
    class: energy_storage
    dps:
      - id: 13
        type: integer
        name: sensor
        unit: kWh
        mapping:
          - scale: 10
  - entity: number
    name: Charge energy
    category: config
    class: energy_storage
    icon: "mdi:cash"
    dps:
      - id: 14
        type: integer
        name: value
        optional: true
        unit: kWh
        range:
          min: 0
          max: 99999
        mapping:
          - scale: 10
  - entity: sensor
    translation_key: leakage_current
    class: current
    category: diagnostic
    dps:
      - id: 15
        type: integer
        name: sensor
        unit: mA
        class: measurement
        optional: true
  - entity: button
    name: Earth leak test
    icon: "mdi:current-ac"
    category: config
    dps:
      - id: 21
        type: boolean
        name: button
        optional: true
  - entity: sensor
    class: energy
    dps:
      - id: 1
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    class: voltage
    category: diagnostic
    dps:
      - id: 116
        type: integer
        optional: true
        name: sensor
        unit: V
        mapping:
          - dps_val: null
            value_redirect: phase_a
          - scale: 10
      - id: 6
        type: base64
        name: phase_a
        optional: true
        mask: "FFFF000000000000"
        mapping:
          - scale: 10
  - entity: sensor
    class: current
    category: diagnostic
    dps:
      - id: 117
        type: integer
        optional: true
        name: sensor
        unit: A
        mapping:
          - dps_val: null
            value_redirect: phase_a
          - scale: 1000
      - id: 6
        type: base64
        name: phase_a
        optional: true
        mask: "0000FFFFFF000000"
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    category: diagnostic
    dps:
      - id: 118
        type: integer
        optional: true
        name: sensor
        unit: kW
        mapping:
          - dps_val: null
            value_redirect: phase_a
          - scale: 1000
      - id: 6
        type: base64
        name: phase_a
        optional: true
        unit: kW
        mask: "0000000000FFFFFF"
        mapping:
          - scale: 1000
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 9
        type: bitfield
        name: sensor
        optional: true
        mapping:
          - dps_val: 0
            value: false
          - dps_val: null
            value: false
          - value: true
      - id: 9
        type: bitfield
        name: fault_code
        optional: true
  - entity: button
    translation_key: factory_reset
    category: config
    hidden: true
    dps:
      - id: 34
        type: boolean
        name: button
        optional: true
  - entity: button
    name: Clear energy
    class: restart
    category: config
    dps:
      - id: 101
        type: boolean
        name: button
        optional: true
  - entity: sensor
    class: power_factor
    category: diagnostic
    dps:
      - id: 104
        type: integer
        optional: true
        name: sensor
        unit: "%"
        class: measurement
        mapping:
          - scale: 10
  - entity: sensor
    class: frequency
    category: diagnostic
    dps:
      - id: 105
        type: integer
        optional: true
        name: sensor
        unit: Hz
        class: measurement
        mapping:
          - scale: 10
