name: Advanced energy monitoring smartplug
products:
  - id: auojpnb4hpc13ftb
    name: Arlec PC191HA
  - id: 2fxr6sttw70cgbau
    name: Antela ZY-OYD-Y
  - id: qiv5hllylfebpl4g
    name: Eightree ET20
  - id: 7k5zwdhwlnrtsuhu
    name: SWE SAGEWE F2s501-GB
  - id: uqehhcrmk5depvtl
    name: Smatrul 16A/20A
primary_entity:
  entity: switch
  class: outlet
  dps:
    - id: 1
      type: boolean
      name: switch
    - id: 21
      type: integer
      name: test_bit
      optional: true
    - id: 26
      type: bitfield
      name: fault_code
      optional: true
    - id: 41
      type: string
      name: cycle_timer
      optional: true
    - id: 42
      type: string
      name: random_timer
      optional: true
secondary_entities:
  - 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
  - entity: sensor
    category: diagnostic
    name: Energy
    dps:
      - id: 17
        name: sensor
        type: integer
        unit: Wh
        optional: true
      - id: 25
        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: 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: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 26
        type: bitfield
        name: sensor
        optional: true
        persist: false
        mapping:
          - dps_val: 0
            value: false
          - dps_val: null
            value: false
          - value: true
  - entity: select
    category: config
    translation_key: initial_state
    dps:
      - id: 38
        type: string
        name: option
        optional: true
        mapping:
          - dps_val: "on"
            value: "on"
          - dps_val: "off"
            value: "off"
          - dps_val: memory
            value: memory
  - entity: switch
    name: Overcharge cutoff
    category: config
    icon: "mdi:battery-charging"
    dps:
      - id: 46
        type: boolean
        name: switch
        optional: true
        mapping:
          - dps_val: null
            invalid: true
  - entity: select
    name: Light
    icon: "mdi:circle-double"
    category: config
    dps:
      - id: 39
        type: string
        name: option
        optional: true
        mapping:
          - dps_val: relay
            value: State
          - dps_val: pos
            value: Position
          - dps_val: none
            value: "Off"
          - dps_val: "on"
            value: "On"
  - entity: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 40
        type: boolean
        name: lock
        optional: true
