name: EV charger
products:
  - id: "bktb3jskdic1ar2t"
    manufacturer: Noeifevo
    model: Q21W
entities:
  - entity: sensor
    translation_key: status
    icon: "mdi:ev-station"
    class: enum
    dps:
      - id: 3
        type: string
        name: sensor
        mapping:
          - dps_val: charger_charging
            value: charging
          - dps_val: charger_free
            value: available
          - dps_val: charger_insert
            value: plugged_in
          - dps_val: charger_free_fault
            value: fault_unplugged
          - dps_val: charger_wait
            value: waiting
          - dps_val: charger_pause
            value: paused
          - dps_val: charger_end
            value: charged
          - dps_val: charger_fault
            value: fault
      - id: 23
        type: string
        name: system_version
  - entity: number
    name: Charging current
    category: config
    class: current
    icon: "mdi:ev-plug-type2"
    dps:
      - id: 4
        type: integer
        name: value
        unit: A
        range:
          min: 6
          max: 16
  - entity: sensor
    class: power
    category: diagnostic
    dps:
      - id: 9
        type: integer
        name: sensor
        unit: kW
        class: measurement
        mapping:
          - scale: 1000
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 10
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - value: true
      - id: 10
        type: bitfield
        name: fault_code
  - entity: select
    translation_key: charging_mode
    category: config
    dps:
      - id: 14
        type: string
        optional: true
        name: option
        mapping:
          - dps_val: charge_now
            value: immediate
          - dps_val: charge_schedule
            value: scheduled_charge
  - entity: sensor
    translation_key: voltage_x
    translation_placeholders:
      x: A
    class: voltage
    dps:
      - id: 6
        type: base64
        name: sensor
        optional: true
        unit: V
        mask: "FFFF0000000000"
        mapping:
          - scale: 10
  - entity: sensor
    translation_key: current_x
    translation_placeholders:
      x: A
    class: current
    dps:
      - id: 6
        type: base64
        name: sensor
        optional: true
        unit: A
        mask: "000000FFFF0000"
        mapping:
          - scale: 1000
  - entity: sensor
    translation_key: power_x
    translation_placeholders:
      x: A
    class: power
    dps:
      - id: 6
        type: base64
        name: sensor
        optional: true
        unit: kW
        mask: "0000000000FFFF"
        mapping:
          - scale: 1000
  - entity: sensor
    translation_key: voltage_x
    translation_placeholders:
      x: B
    class: voltage
    dps:
      - id: 7
        type: base64
        name: sensor
        optional: true
        unit: V
        mask: "FFFF0000000000"
        mapping:
          - scale: 10
  - entity: sensor
    translation_key: current_x
    translation_placeholders:
      x: B
    class: current
    dps:
      - id: 7
        type: base64
        name: sensor
        optional: true
        unit: A
        mask: "000000FFFF0000"
        mapping:
          - scale: 1000
  - entity: sensor
    translation_key: power_x
    translation_placeholders:
      x: B
    class: power
    dps:
      - id: 7
        type: base64
        name: sensor
        optional: true
        unit: kW
        mask: "0000000000FFFF"
        mapping:
          - scale: 1000
  - entity: sensor
    translation_key: voltage_x
    translation_placeholders:
      x: C
    class: voltage
    dps:
      - id: 8
        type: base64
        name: sensor
        optional: true
        unit: V
        mask: "FFFF0000000000"
        mapping:
          - scale: 10
  - entity: sensor
    translation_key: current_x
    translation_placeholders:
      x: C
    class: current
    dps:
      - id: 8
        type: base64
        name: sensor
        optional: true
        unit: A
        mask: "000000FFFF0000"
        mapping:
          - scale: 1000
  - entity: sensor
    translation_key: power_x
    translation_placeholders:
      x: C
    class: power
    dps:
      - id: 8
        type: base64
        name: sensor
        optional: true
        unit: kW
        mask: "0000000000FFFF"
        mapping:
          - scale: 1000
  - entity: sensor
    name: Schedule start
    icon: "mdi:battery-clock"
    dps:
      - id: 19
        type: base64
        name: sensor
        optional: true
        mask: "FF00"
  - entity: sensor
    name: Schedule stop
    icon: "mdi:battery-clock-outline"
    dps:
      - id: 19
        type: base64
        name: sensor
        optional: true
        mask: "00FF"
  - entity: switch
    icon: "mdi:ev-station"
    dps:
      - id: 18
        type: boolean
        name: switch
