name: Energy meter
products:
  - id: tadm13agjigbdtxd
    name: Gaqqee KWS-302-WF
primary_entity:
  entity: sensor
  class: energy
  dps:
    - id: 105
      type: integer
      name: sensor
      unit: kWh
      class: total_increasing
      mapping:
        - scale: 1000
    - id: 116
      type: string
      name: state_flag
    - id: 117
      type: string
      name: flag_save
      optional: true
    - id: 123
      type: integer
      name: add_ele
      optional: true
secondary_entities:
  - entity: switch
    category: config
    dps:
      - id: 16
        type: boolean
        name: switch
  - entity: sensor
    class: voltage
    category: diagnostic
    dps:
      - id: 101
        type: integer
        name: sensor
        unit: V
        class: measurement
        mapping:
          - scale: 10
  - entity: sensor
    class: current
    category: diagnostic
    dps:
      - id: 102
        type: integer
        name: sensor
        unit: A
        class: measurement
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    category: diagnostic
    dps:
      - id: 103
        type: integer
        name: sensor
        unit: W
        class: measurement
        mapping:
          - scale: 10
  - entity: sensor
    class: duration
    category: diagnostic
    dps:
      - id: 104
        type: integer
        name: sensor
        unit: min
        class: measurement
  - entity: sensor
    class: power_factor
    category: diagnostic
    dps:
      - id: 106
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    class: frequency
    category: diagnostic
    dps:
      - id: 107
        type: integer
        name: sensor
        unit: Hz
        class: measurement
  - entity: sensor
    class: temperature
    category: diagnostic
    dps:
      - id: 108
        type: integer
        name: sensor
        unit: C
        class: measurement
  - entity: number
    name: Low voltage
    category: config
    class: voltage
    dps:
      - id: 109
        type: integer
        name: value
        unit: V
        range:
          min: 100
          max: 220
  - entity: number
    name: Overvoltage
    class: voltage
    category: config
    dps:
      - id: 110
        type: integer
        name: value
        unit: V
        range:
          min: 130
          max: 290
  - entity: number
    name: Overcurrent
    category: config
    class: current
    dps:
      - id: 111
        type: integer
        name: value
        unit: A
        range:
          min: 0
          max: 100000
        mapping:
          - scale: 1000
  - entity: number
    name: Power off time
    category: config
    translation_key: timer
    dps:
      - id: 112
        type: integer
        name: value
        optional: true
        unit: min
        range:
          min: 0
          max: 60000
        mapping:
          - step: 30
  - entity: number
    name: Over energy
    category: config
    class: energy
    dps:
      - id: 113
        type: integer
        name: value
        unit: kWh
        range:
          min: 0
          max: 99999999
        mapping:
          - scale: 1000
  - entity: number
    name: Over power
    category: config
    class: power
    dps:
      - id: 114
        type: integer
        name: value
        unit: kW
        range:
          min: 0
          max: 22000
        mapping:
          - scale: 1000
  - entity: number
    name: Over temperature
    category: config
    class: temperature
    dps:
      - id: 115
        type: integer
        name: value
        unit: C
        range:
          min: -20
          max: 150
  - entity: button
    name: Clear flag
    category: config
    dps:
      - id: 118
        type: boolean
        name: button
        optional: true
  - entity: number
    translation_key: timer
    name: Screen timeout
    category: config
    icon: "mdi:television-ambient-light"
    dps:
      - id: 119
        type: integer
        name: value
        unit: min
        range:
          min: 0
          max: 59
  - entity: button
    name: Factory reset
    class: restart
    category: config
    dps:
      - id: 120
        type: boolean
        name: button
        optional: true
  - entity: number
    translation_key: timer
    category: config
    dps:
      - id: 121
        type: integer
        name: value
        optional: true
        unit: min
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
  - entity: switch
    name: Schedule
    category: config
    dps:
      - id: 122
        type: boolean
        name: switch
        optional: true
