name: Energy monitoring smartplug
products:
  - id: jdj6ccklup7btq3a
    manufacturer: Tongou
    model: TO-Q-SY1-JWT
  - id: w906qkrrhd3otiwd
    manufacturer: Moes
    model: ME322
  - id: ncwuazeo5y1pujun
    model: STY-63TM
  - id: uvbhl96dsubgimll
    manufacturer: Almo
  - id: dsbptnyuqso0uber
    manufacturer: Aziot
    model: 10A smart plug
entities:
  - entity: switch
    class: outlet
    dps:
      - id: 1
        type: boolean
        name: switch
      - id: 21
        type: integer
        name: test_bit
        optional: true
      - id: 44
        type: string
        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: string
        name: cycle_timer
        optional: true
      - id: 43
        type: string
        name: random_timer
        optional: true
  - entity: number
    category: config
    class: duration
    translation_key: timer
    # 2025-07-20
    deprecated: time.timer
    dps:
      - id: 9
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
  - entity: sensor
    category: diagnostic
    hidden: true
    name: Energy
    dps:
      - id: 17
        name: sensor
        type: integer
        optional: true
        unit: Wh
        class: measurement
      - id: 25
        type: integer
        name: calibration
        optional: true
  - entity: sensor
    category: diagnostic
    class: current
    dps:
      - id: 18
        name: sensor
        type: integer
        class: measurement
        force: true
        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
        force: true
        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
        force: true
        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
        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
        name: option
        mapping:
          - dps_val: "on"
            value: "on"
          - dps_val: "off"
            value: "off"
          - dps_val: memory
            value: memory
  - 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: lock
    translation_key: child_lock
    category: config
    dps:
      - id: 41
        type: boolean
        name: lock
  - entity: select
    translation_key: light_mode
    category: config
    hidden: unavailable
    dps:
      - id: 40
        type: string
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
      - id: 40
        type: string
        name: option
        optional: true
        mapping:
          - dps_val: relay
            value: state
          - dps_val: pos
            value: locator
          - dps_val: "on"
            value: "on"
  - entity: binary_sensor
    name: Online
    class: connectivity
    hidden: unavailable
    category: diagnostic
    dps:
      - id: 66
        type: string
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
      - id: 66
        type: string
        optional: true
        name: sensor
        mapping:
          - dps_val: offline
            value: false
          - dps_val: online
            value: true
          # if missing, assume online as we can reach it
          - dps_val: null
            value: true
