name: Energy monitoring smartplug
products:
  - id: 2iepauebcvo74ujc
    manufacturer: Aubess
    model: 20A
  - id: wrz6vzch8htux2zp
    manufacturer: Elivco
    model: CB2S-16DL
  - id: 3lbgj7cu27nsmh0w
    model: AT-Q-SY2-JWT
  - id: cipuwutzfuqk3iru
    model: UNSH SMKG-KNL
  - id: azpywu5zfg5wyzpn
    manufacturer: EARU
    model: 1P Breaker
  - id: mkdejkrgvhsfwfrd
    manufacturer: Antela
    model: F1s302-UK
  - id: 74xo1nolwa6xkjeu
    manufacturer: Arlec
    model: PC191HA Series 4
entities:
  - entity: switch
    class: outlet
    dps:
      - id: 1
        type: boolean
        name: switch
      - id: 21
        type: integer
        optional: true
        name: test_bit
      - id: 44
        type: base64
        name: inching
        optional: true
  - entity: time
    category: config
    translation_key: timer
    dps:
      - id: 9
        type: integer
        name: second
        range:
          min: 0
          max: 86400
      - id: 42
        type: base64
        name: cycle_timer
        optional: true
      - id: 43
        type: base64
        name: random_timer
        optional: true
  - entity: sensor
    category: diagnostic
    hidden: true
    name: Energy
    dps:
      - id: 17
        name: sensor
        type: integer
        unit: Wh
        optional: true
        class: measurement
      - id: 25
        type: integer
        name: calibration
        # seems to be present even when 17 is missing, but for consistency
        optional: true
  - entity: sensor
    category: diagnostic
    class: current
    dps:
      - id: 18
        name: sensor
        type: integer
        class: measurement
        optional: true
        force: true
        unit: mA
      - id: 23
        type: integer
        optional: true
        name: calibration
  - entity: sensor
    category: diagnostic
    class: power
    dps:
      - id: 19
        name: sensor
        type: integer
        class: measurement
        optional: true
        force: true
        unit: W
        mapping:
          - scale: 10
            constraint: switch
            conditions:
              - dps_val: false
                value: 0
      - id: 1
        type: boolean
        name: switch
      - id: 24
        type: integer
        optional: true
        name: calibration
  - entity: sensor
    category: diagnostic
    class: voltage
    dps:
      - id: 20
        name: sensor
        type: integer
        class: measurement
        optional: true
        force: true
        unit: V
        mapping:
          - scale: 10
      - id: 22
        type: integer
        optional: true
        name: calibration
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 26
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 26
        type: bitfield
        name: fault_code
  - entity: select
    category: config
    translation_key: initial_state
    dps:
      - id: 38
        type: string
        optional: true
        name: option
        mapping:
          - dps_val: "on"
            value: "on"
          - dps_val: "off"
            value: "off"
          - dps_val: memory
            value: memory
  - entity: lock
    translation_key: child_lock
    category: config
    hidden: unavailable
    dps:
      - id: 41
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
      - id: 41
        type: boolean
        name: lock
        optional: true
  - entity: select
    translation_key: light_mode
    category: config
    hidden: unavailable
    dps:
      - id: 40
        type: string
        optional: true
        name: option
        mapping:
          - dps_val: relay
            value: state
          - dps_val: pos
            value: locator
          - dps_val: none
            value: "off"
          - dps_val: "on"
            value: "on"
      - id: 40
        type: string
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: switch
    name: Overcharge protection
    category: config
    hidden: unavailable
    dps:
      - id: 39
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
      - id: 39
        type: boolean
        name: switch
        optional: true
  - entity: sensor
    class: temperature
    hidden: unavailable
    category: diagnostic
    dps:
      - id: 47
        type: integer
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
      - id: 47
        type: integer
        optional: true
        name: sensor
        unit: C
        class: measurement
