name: Energy monitoring smartplug
legacy_type: kogan_switch2
primary_entity:
  entity: switch
  class: outlet
  dps:
    - id: 1
      type: boolean
      name: switch
    - id: 21
      type: bitfield
      name: factory_test
      optional: true
    - id: 26
      type: integer
      name: fault_code
      optional: true
secondary_entities:
  - entity: sensor
    category: diagnostic
    class: voltage
    dps:
      - id: 20
        name: sensor
        type: integer
        class: measurement
        unit: V
        mapping:
          - scale: 10
      - id: 22
        type: integer
        name: calibration
        optional: true
  - entity: sensor
    category: diagnostic
    class: current
    dps:
      - id: 18
        name: sensor
        type: integer
        class: measurement
        unit: mA
      - id: 23
        type: integer
        name: calibration
        optional: true
  - entity: sensor
    category: diagnostic
    class: power
    dps:
      - id: 19
        name: sensor
        type: integer
        class: measurement
        unit: W
        mapping:
          - scale: 10
      - id: 24
        type: integer
        name: calibration
        optional: true
  - entity: number
    category: config
    translation_key: timer
    dps:
      - id: 9
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
