name: Dual channel energy meter
products:
  - id: zcmq0kvd01bn6s1n
    manufacturer: WMDL
    model: WMDL-2C
entities:
  - entity: sensor
    translation_key: power_x
    translation_placeholders:
      x: A
    class: power
    dps:
      - id: 19
        type: integer
        name: sensor
        unit: W
        class: measurement
        force: true
        mapping:
          - scale: 10
  - entity: sensor
    translation_key: voltage_x
    translation_placeholders:
      x: A
    class: voltage
    category: diagnostic
    dps:
      - id: 20
        type: integer
        name: sensor
        unit: V
        class: measurement
        force: true
        mapping:
          - scale: 10
  - entity: sensor
    translation_key: current_x
    translation_placeholders:
      x: A
    class: current
    category: diagnostic
    dps:
      - id: 18
        type: integer
        name: sensor
        unit: A
        class: measurement
        force: true
        mapping:
          - scale: 1000
  - entity: sensor
    translation_key: power_x
    translation_placeholders:
      x: B
    class: power
    dps:
      - id: 113
        type: integer
        name: sensor
        unit: W
        class: measurement
        force: true
        mapping:
          - scale: 10
  - entity: sensor
    translation_key: voltage_x
    translation_placeholders:
      x: B
    class: voltage
    category: diagnostic
    hidden: true
    dps:
      - id: 114
        type: integer
        name: sensor
        unit: V
        class: measurement
        force: true
        mapping:
          - scale: 10
  - entity: sensor
    translation_key: current_x
    translation_placeholders:
      x: B
    class: current
    category: diagnostic
    dps:
      - id: 112
        type: integer
        name: sensor
        unit: A
        class: measurement
        force: true
        mapping:
          - scale: 1000
  - entity: sensor
    translation_key: energy_consumed
    class: energy
    icon: mdi:transmission-tower-import
    dps:
      - id: 119
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    translation_key: energy_produced
    class: energy
    icon: mdi:transmission-tower-export
    dps:
      - id: 121
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: number
    name: Power limit A
    category: config
    class: power
    dps:
      - id: 107
        type: integer
        name: value
        unit: W
        range:
          min: 0
          max: 150000
        mapping:
          - step: 100
  - entity: number
    name: Power limit B
    category: config
    class: power
    dps:
      - id: 110
        type: integer
        name: value
        unit: W
        range:
          min: 0
          max: 150000
        mapping:
          - step: 100
  - entity: sensor
    translation_key: energy_consumed_x
    translation_placeholders:
      x: A
    class: energy
    icon: mdi:transmission-tower-import
    dps:
      - id: 17
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    translation_key: energy_produced_x
    translation_placeholders:
      x: A
    class: energy
    icon: mdi:transmission-tower-export
    dps:
      - id: 115
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    translation_key: energy_consumed_x
    translation_placeholders:
      x: B
    class: energy
    icon: mdi:transmission-tower-import
    dps:
      - id: 111
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    translation_key: energy_produced_x
    translation_placeholders:
      x: B
    class: energy
    icon: mdi:transmission-tower-export
    dps:
      - id: 117
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Activity A
    class: enum
    icon: mdi:swap-horizontal
    dps:
      - id: 105
        type: string
        name: sensor
        mapping:
          - dps_val: work_p
            value: importing
          - dps_val: work_n
            value: exporting
          - dps_val: close
            value: idle
          - dps_val: produce
            value: producing
          - value: unknown
  - entity: sensor
    name: Activity B
    class: enum
    icon: mdi:swap-horizontal
    dps:
      - id: 108
        type: string
        name: sensor
        mapping:
          - dps_val: work_p
            value: importing
          - dps_val: work_n
            value: exporting
          - dps_val: close
            value: idle
          - dps_val: produce
            value: producing
          - value: unknown
