name: Energy monitor switch
products:
  # - id: UNKNOWN
  #   manufacturer: Aubess
  - id: m4jtkjc43ltrilru
    model: T34 Smart Plug+
entities:
  - entity: switch
    dps:
      - id: 1
        name: switch
        type: boolean
      - id: 24
        name: test_bit
        type: integer
      - id: 42
        name: random_time
        type: string
      - id: 43
        name: cycle_time
        type: string
      - id: 44
        name: switch_inching
        type: string
  - entity: number
    translation_key: timer
    class: duration
    category: config
    dps:
      - id: 9
        name: value
        type: integer
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
  - entity: select
    translation_key: initial_state
    category: config
    dps:
      - id: 38
        type: string
        name: option
        mapping:
          - dps_val: "0"
            value: "off"
            available: numeric_values
          - dps_val: "1"
            value: "on"
            available: numeric_values
          - dps_val: "2"
            value: memory
            available: numeric_values
          - dps_val: "off"
            value: "off"
            available: word_values
          - dps_val: "on"
            value: "on"
            available: word_values
          - dps_val: "memory"
            value: memory
            available: word_values
      - id: 38
        type: string
        name: numeric_values
        mapping:
          - dps_val: "0"
            value: true
          - dps_val: "1"
            value: true
          - dps_val: "2"
            value: true
          - value: false
      - id: 38
        type: string
        name: word_values
        mapping:
          - dps_val: "0"
            value: false
          - dps_val: "1"
            value: false
          - dps_val: "2"
            value: false
          - value: true
  - entity: sensor
    name: Energy
    category: diagnostic
    hidden: true
    dps:
      - id: 20
        name: sensor
        type: integer
        optional: true
        class: measurement
        unit: Wh
  - entity: sensor
    class: current
    category: diagnostic
    dps:
      - id: 21
        name: sensor
        type: integer
        class: measurement
        force: true
        unit: mA
  - entity: sensor
    class: power
    category: diagnostic
    dps:
      - id: 22
        name: sensor
        type: integer
        class: measurement
        force: true
        unit: W
        mapping:
          - scale: 10
  - entity: sensor
    class: voltage
    category: diagnostic
    dps:
      - id: 23
        name: sensor
        type: integer
        force: true
        class: measurement
        unit: V
        mapping:
          - scale: 10
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 29
        type: bitfield
        optional: true
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 29
        type: bitfield
        optional: true
        name: fault_code
