name: Energy monitoring smartplug
legacy_type: kogan_switch
products:
  - id: 370053454855194e5607
    name: Gosund EP2
  - id: 37mnhia3pojleqfh
    name: SP111-A
primary_entity:
  entity: switch
  class: outlet
  dps:
    - id: 1
      type: boolean
      name: switch
secondary_entities:
  - entity: sensor
    category: diagnostic
    class: voltage
    dps:
      - id: 6
        name: sensor
        type: integer
        class: measurement
        unit: V
        mapping:
          - scale: 10
  - entity: sensor
    category: diagnostic
    class: current
    dps:
      - id: 4
        name: sensor
        type: integer
        class: measurement
        unit: mA
  - entity: sensor
    category: diagnostic
    class: power
    dps:
      - id: 5
        name: sensor
        type: integer
        class: measurement
        unit: W
        mapping:
          - scale: 10
  - entity: binary_sensor
    name: Overcurrent alarm
    class: problem
    category: diagnostic
    dps:
      - id: 7
        type: boolean
        name: sensor
        optional: true
        mapping:
          - dps_val: null
            value: false
  - entity: number
    category: config
    translation_key: timer
    dps:
      - id: 2
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
