Connect Your Portable EV Charger to Home Assistant

A complete install and integration guide using the Tuya Local custom integration. No cloud subscription, no monthly fees, full local control.

What is Home assistant? 

Home assistant is a free opensource community that interfaces to most smart devices. It allows you to control the devices from your phone or P.C. 
https://www.home-assistant.io/

Home assistant runs on a PC, however it’s recommended to use a dedicated platform such as the home assistant green that starts at around $350
https://www.home-assistant.io/green/


What you’ll end up with

After following this guide, your EV charger will appear in Home Assistant as a fully local device with the following entities:

  • Switch — turn charging on and off
  • Charge current slider — set the limit from 6 A to 10A for the 10a versiona nd 6 to 16 A in 1 A steps for the 16a version. The charger will not let you go above the hardware limit of the charger.  
  • Note: This can’t adjust the current while charging so it can’t be used for home solar adjustment with out stopping and starting the charger again. 
  • Live voltage, current and power — instantaneous readings in V, A and W
  • Total energy — kWh delivered, suitable for the Energy dashboard
  • Status — Idle, Connected, Starting, Charging, Paused, Finished, Fault
  • Connection state — IEC 61851 pilot state (vehicle detection)
  • Temperature — internal charger temperature
  • Fault — binary problem indicator with a raw fault-code attribute

Everything polls locally over your LAN, so it keeps working if your internet drops, and there’s no rate-limiting from the Tuya cloud.


This guide is for the following chargers. 

$430.00 inc. GST

Plug in EV chargers

10a Plugin EV Charger Type 2

$399.00 inc. GST
$399.00 inc. GST
$415.00 inc. GST

Before you start

You’ll need:

  • The EV charger plugged into mains and powered up
  • A 2.4 GHz Wi-Fi network the charger can join 
  • Home Assistant with the Tuya Local custom integration already installed via HACS
  • The File editor add-on (or Studio Code Server, or SSH access) so you can drop a small YAML file on the HA host
  • A Tuya Smart Life account on your phone — the same one you’ll use to pair the charger

Step 1 — Pair the charger with Smart Life

The charger has to go through the Tuya/Smart Life app once, so the cloud can issue it a local encryption key. After this, your phone is optional.

  1. Install the Smart Life app (by Tuya) on your phone and create an account.
  2. Make sure your phone is on the same 2.4 GHz Wi-Fi network the charger will use.
  3. Put the charger into pairing mode (Long press on the timer and current button)).
  4. In Smart Life, tap Add Device, follow the prompts, and enter your Wi-Fi credentials when asked.
  5. Once the app shows the charger as connected, give it a sensible name (e.g. “EV charger”) and confirm it can be turned on and off from the app.

Step 2 — Fix the charger’s IP address

Tuya Local talks to the device directly over your LAN, so the charger’s IP address needs to stay stable. The cleanest way is to set a DHCP reservation in your router based on the charger’s MAC address. Refer to your router’s documentation for the exact steps — most routers have a “DHCP reservation” or “Static lease” section under LAN settings.

Make a note of the reserved IP. You’ll need it briefly in Step 4.


Step 3 — Drop in the device template

This is the YAML file that tells Tuya Local how to translate the charger’s raw data points into Home Assistant entities — switch, slider, voltage, current, power, and so on. You need to put it in place before adding the charger so Tuya Local recognises the device on the first try.

  1. Open the File editor add-on in Home Assistant (or Studio Code Server, or SSH).
  2. Navigate to /homeassistant/custom_components/tuya_local/devices/.
  3. Create a new file in that folder called portable_evcharger.yaml.
  4. Paste the YAML below into that file and save it.
name: EV charger

# Single template covering both Smart EV Charger models:

#   - 6-10A portable (hardware enforces 6/8/10A steps internally)

#   - 16A portable  (hardware enforces 6/8/10/12/14/16A steps internally)

products:

  - id: gz7brfamdlvyagvt

    manufacturer: Smart EV Charger

    model: Portable EV Charger

  - id: e1mr37qs

    manufacturer: Smart EV Charger

    model: Portable EV Charger (legacy ID)

entities:

  - entity: switch

    name: Charger

    icon: "mdi:ev-station"

    dps:

      - id: 18

        type: boolean

        name: switch

  - entity: sensor

    name: Status

    class: enum

    icon: "mdi:ev-plug-type2"

    category: diagnostic

    dps:

      - id: 3

        type: string

        name: sensor

        mapping:

          - dps_val: charger_free

            value: Idle

          - dps_val: charger_insert

            value: Connected

          - dps_val: charger_wait

            value: Waiting

          - dps_val: charger_charging

            value: Charging

          - dps_val: charger_pause

            value: Paused

          - dps_val: charger_end

            value: Finished

          - dps_val: charger_fault

            value: Fault

          - dps_val: charger_free_fault

            value: Idle (fault)

  - entity: number

    name: Charge current

    category: config

    class: current

    # Protocol accepts 6-16. Hardware limits:

    #   6-10A model -> only 6/8/10 are accepted by the unit

    #   16A model   -> only 6/8/10/12/14/16 are accepted by the unit

    dps:

      - id: 4

        type: integer

        name: value

        unit: A

        range:

          min: 6

          max: 16

  - entity: select

    name: Charging mode

    category: config

    dps:

      - id: 14

        type: string

        name: option

        mapping:

          - dps_val: charge_now

            value: immediate

          - dps_val: charge_pct

            value: charge_to_percent

          - dps_val: charge_energy

            value: fixed_charge

          - dps_val: charge_schedule

            value: scheduled_charge

  - entity: sensor

    name: Connection state

    class: enum

    icon: "mdi:ev-plug-type2"

    category: diagnostic

    dps:

      - id: 13

        type: string

        optional: true

        name: sensor

        mapping:

          - dps_val: controlpi_12v

            value: Standby

          - dps_val: controlpi_12v_pwm

            value: Communication initialising

          - dps_val: controlpi_9v

            value: Vehicle detected

          - dps_val: controlpi_9v_pwm

            value: Vehicle connected

          - dps_val: controlpi_6v

            value: Charging

          - dps_val: controlpi_6v_pwm

            value: Charging (ventilation)

          - dps_val: controlpi_error

            value: Pilot error

  - entity: sensor

    name: Energy

    class: energy

    dps:

      - id: 1

        type: integer

        optional: true

        name: sensor

        unit: kWh

        class: total_increasing

        mapping:

          - scale: 100

  - entity: sensor

    name: Session energy

    class: energy

    dps:

      - id: 25

        type: integer

        optional: true

        name: sensor

        unit: kWh

        class: total_increasing

        mapping:

          - scale: 100

  - entity: sensor

    name: Temperature

    class: temperature

    category: diagnostic

    dps:

      - id: 24

        type: integer

        optional: true

        name: sensor

        unit: "C"

  - entity: sensor

    name: Charge record

    category: diagnostic

    icon: "mdi:identifier"

    dps:

      - id: 22

        type: string

        optional: true

        name: sensor

  - entity: sensor

    name: Voltage

    class: voltage

    dps:

      - id: 6

        type: base64

        optional: true

        name: sensor

        unit: V

        mask: "FFFF000000000000"

        class: measurement

        mapping:

          - scale: 10

  - entity: sensor

    name: Current

    class: current

    dps:

      - id: 6

        type: base64

        optional: true

        name: sensor

        unit: A

        mask: "0000FFFFFF000000"

        class: measurement

        mapping:

          - scale: 1000

  - entity: sensor

    name: Power

    class: power

    dps:

      - id: 6

        type: base64

        optional: true

        name: sensor

        unit: W

        mask: "0000000000FFFFFF"

        class: measurement

  - entity: binary_sensor

    name: Fault

    class: problem

    category: diagnostic

    dps:

      - id: 28

        type: bitfield

        optional: true

        name: sensor

        mapping:

          - dps_val: 0

            value: false

          - value: true

      - id: 28

        type: bitfield

        optional: true

        name: fault_code


Step 4 — Add the charger using the Smart Life cloud-assisted setup

Tuya Local will sign in to your Smart Life account just long enough to fetch the charger’s device ID and local key, then scan your LAN to find it. If it’s your first time using Tuya Local, then it will ask for your User code. 

The user code is found it the Tuya App,
Click Me
Gear icon top right
Account and security
Near the bottom is the user code. 

  1. In Home Assistant, go to Settings → Devices & services.
  2. Find Tuya Local in the list and click Add device
    (or Smartlife cloud assisted device setup with fresh login if this is your first Tuya Local device).

     

    tuya app setup

  3. The user code is found it the Tuya App,
    Click Me
    Gear icon top right
    Account and security
    Near the bottom is the user code. Enter it in to the box. 

  4. Scan the QR code. 
    From the tuya app home screen, click the scan QR button top right beside the gear icon. 
  5. Click confirm login with your phone, then Submit in Home assistant. 
  6. Choose the device to Add, EV charger. Gateway = None

    add device

  7. It will then scan your local network for that device. Confirm the IP it discovers matches the reservation you set in Step 2.
    add device to tuya
  8. This will find your charger, I.P, local key. 
  9. Use protocol version 3.5 for stability.
  10. Click submit
    Add the Smart EV charger (controlpi_evcharger)
  11. Choose a name
  12. Submit. The charger will appear in Home Assistant with all the entities listed at the top of this guide.

That’s it. Your Smart Life credentials are only used during this one-time fetch. After the device is added, Tuya Local talks to it purely over your LAN — your phone, the Smart Life app, and the Tuya cloud are no longer in the loop.


Step 5 — Verify the entities

Go to Settings → Devices & services → Tuya Local → EV charger. You should see a device card containing:

  • A Charger switch under Controls
  • A Charge current slider under Configuration
  • Current, Energy, Power and Voltage sensors
  • Status, Connection state, Temperature, Fault and a couple of diagnostic entries

Even with no vehicle plugged in, the Voltage sensor should immediately show a realistic mains reading (somewhere in the 220–245 V range depending on your country). That’s your fastest confirmation that the local link and Phase A decoding are both working.

Plug a vehicle in and you should see Connection state move through “Vehicle detected” and then “Charging” once the handshake completes, with Current and Power rising to match the slider setting.


Fallback — manual setup using the Tuya developer portal

If the cloud-assisted flow doesn’t work for you — for example because Smart Life sign-in keeps failing, your account is in a region that the Tuya Local list doesn’t expose, or the device doesn’t appear in the account list — you can fall back to the manual route below. You only need this if Step 4 didn’t work.

  1. Go to iot.tuya.com and create a free developer account.
  2. Create a “Cloud Project” (any name, choose the data centre that matches your region).
  3. Under Devices → Link Tuya App Account, scan the QR code with your Smart Life app to link the account from Step 1.
  4. Open Devices → All Devices. Your charger should appear in the list.
  5. Click the small “pencil/edit” icon on the charger row to reveal the Device ID and Local Key. Copy both somewhere safe.
  6. In Home Assistant, go to Settings → Devices & services → Tuya Local → Add device, but this time choose Local setup (or “Manual configuration”) instead of Cloud setup.
  7. Enter:
    • Name — anything, e.g. “EV charger”
    • Host — the reserved IP from Step 2
    • Device ID — from this fallback section
    • Local key — from this fallback section
    • Protocol version — try 3.5 first; if it fails, fall back to 3.4, then 3.3, then Auto
  8. Submit. The charger should now appear with all its entities and you can continue at Step 5.

Treat the local key like a password. Anyone with the key and the charger’s IP could control it on your network.


Troubleshooting

The cloud-assisted flow can’t log in. Triple-check the data centre region you picked — Smart Life accounts are pinned to one region and you must select the same one. If you’re in New Zealand, Australia or much of South-East Asia your account is typically on the Western America centre; in the UK and EU, Western Europe; in mainland China, China; in India, India; in eastern North America, Eastern America. If you’re sure on region and password but it still fails, try the manual fallback above.

The device list is empty after cloud sign-in. The Smart Life account you signed into doesn’t have any devices linked to it. Make sure you logged in with the same account you used to pair the charger in Step 1, not a fresh one.

Tuya Local can’t reach the charger locally. Confirm the IP, try a lower protocol version (3.4 / 3.3 / Auto), and make sure no other app is holding the device’s single local connection slot — only one client at a time can talk to a Tuya device locally. That includes the Smart Life app actively talking to it on your phone, an old localtuya install, or another HA instance.

Device appears but only has 1–2 entities. The YAML wasn’t read. Confirm the file is in /homeassistant/custom_components/tuya_local/devices/, named with a .yaml extension, and that there are no parse errors (a tab character instead of spaces is a common culprit). Check Settings → System → Logs filtered on tuya_local. If you added the device before the YAML was in place, delete and re-add the device after fixing the file.

Voltage reads but Current and Power stay at 0. That’s the expected state when nothing is drawing — verify with a vehicle (or a known resistive load through the charger) before assuming anything is wrong. If they still stay at 0 with a load present, recheck the three mask hex strings in the YAML against the values above; a wrong nibble shifts the byte windows.

The slider won’t go above 10 A even though the YAML allows 16. Some hardware revisions are firmware-capped to a lower maximum even though the protocol can carry up to 16 A. The cap is set inside the charger itself, not by Home Assistant. If you have a 16 A unit and it’s clamping low, that’s a question for the supplier.

Energy stays at 0.00 kWh. Some firmware revisions only update the energy total at the end of a charging session, not continuously. Run a full charge and check again afterwards.


Next steps — automations worth building

Now that the charger is in Home Assistant, the obvious wins are:

  • Solar surplus charging. Use your solar production sensor and a generic threshold automation to start and stop charging when there is excess power. 
  • Off-peak only. A simple time-of-day automation that toggles the switch on at the start of your off-peak window and off at the end.
  • Charge to a kWh budget. Capture Energy at the start of a session, and turn the switch off when it has incremented by your target value.

 

Build a dashbaord example below with built in charge timer. 

home assistant dashboard