[APP][Pro] Tuya Local

There you go :
Chargeur Voiture

Column 1 Column 2 Column 3 Column 4 E
DP 1 forward_energy_total value 0 0–99999999 step 1 kW·h
DP 3 work_state enum charger_end charger_free, charger_insert, charger_free_fault, charger_wait, charger_charging, charger_pause, charger_end, charger_fault
DP 4 charge_cur_set Integer 13 1–255 step 1 A
DP 6 phase_a raw AAAAAAAAAAA=
DP 10 fault bitmap 0
DP 13 connection_state enum controlpi_9v_pwm controlpi_12v, controlpi_12v_pwm, controlpi_9v, controlpi_9v_pwm, controlpi_6v, controlpi_6v_pwm, controlpi_error
DP 14 work_mode Enum charge_now charge_now, charge_pct, charge_energy, charge_schedule
DP 18 switch Boolean false {}
DP 19 local_timer raw AAA=
DP 23 system_version string SS_V1.0.2
DP 24 temp_current value 35 -40–200 step 1 ℃
DP 25 charge_energy_once value 1 1–999999 step 1 kW·h
DP 27 online_state enum online
DP 28 timer_on value 0
DP 33 mode_set raw AQAAAAEAAAA=

And in the debug tab :

And raw data :
{
“devId”: null,
“uid”: null,
“t”: null,
“t_local”: null,
“cid”: null,
“updatedAt”: “05/08/2026 23:17:30”,
“dps”: {
“1”: 0,
“3”: “charger_end”,
“4”: 13,
“10”: 0,
“13”: “controlpi_9v_pwm”,
“14”: “charge_now”,
“18”: false,
“23”: “SS_V1.0.2”,
“24”: 35,
“25”: 1,
“27”: “online”
}
}

Hi Elliot - perfect. Could you please test the new driver in the TEST version? Tuya Local | Homey

Wallbox is ready for a test:

Please check as well if the charger is visible under Energy (Homey App on mobile/tablet)

Thanks for the quick update.

Seems to work fine, the DP6 is not working (nothing for Power, Current and Voltage), but I guess it’s as expected as the DP itself is not sending any info. Other live datas are correct, but they dont stay for insights.

For energy dashboard, it’s not working, it stays at 0 event after 30min charge.

Other than that everything’s fine.

Could you please send the DP table while charging (need to check the real values)?

Sure, there it is:
{
“devId”: null,
“uid”: null,
“t”: 1785967640,
“t_local”: “06/08/2026 00:07:20”,
“cid”: null,
“updatedAt”: “06/08/2026 00:07:33”,
“dps”: {
“1”: 5,
“3”: “charger_end”,
“4”: 13,
“10”: 0,
“13”: “controlpi_9v_pwm”,
“14”: “charge_now”,
“18”: true,
“23”: “SS_V1.0.2”,
“24”: 52,
“25”: 174,
“27”: “online”
}
}

Wait, let me restart the app it seems the synchronization is not on point

{
“devId”: null,
“uid”: null,
“t”: null,
“t_local”: null,
“cid”: null,
“updatedAt”: “06/08/2026 00:11:00”,
“dps”: {
“1”: 24,
“3”: “charger_charging”,
“4”: 13,
“10”: 0,
“13”: “controlpi_6v”,
“14”: “charge_now”,
“18”: true,
“23”: “SS_V1.0.2”,
“24”: 53,
“25”: 174,
“27”: “online”
}
}

For DP6, with the help of Claude (i can see the value in your app settings when I look on cloud lookup) :

Decoding the phase_a raw DP (DP 6) on Tuya EV chargers

For anyone else digging into the local Tuya DPs on an EV charger, DP 6 (phase_a, type raw) isn’t garbage — it’s just Base64-encoded binary data containing the electrical measurements for phase A.

Example value from my charger:

CXAANA8ADJU=

Decoding this Base64 string gives 8 raw bytes:

09 70 00 34 0f 00 0c 95

These 8 bytes break down into three fields (this matches the standard format Tuya uses across several energy-metering/EV-charger devices):

Field Bytes Raw value Scaling Result
Voltage 09 70 (2 bytes, big-endian uint16) 2416 ÷ 10 241.6 V
Current 00 34 0f (3 bytes, big-endian uint24) 13327 ÷ 1000 (mA → A) 13.327 A
Power 00 0c 95 (3 bytes, big-endian uint24) 3221 no scaling (already in W) 3221 W

Sanity check: V × I = 241.6 × 13.327 ≈ 3220 W, which matches the decoded power value almost exactly — confirming the byte layout and scaling factors are correct.

So in this example, the charger was pulling ~3.2 kW at 241.6 V / 13.3 A on phase A, which also lined up with charge_cur_set (DP 4) being set to 13 A and work_state (DP 3) showing charger_charging.

If your charger is three-phase, you’d likely find equivalent phase_b / phase_c raw DPs using the same 8-byte layout.

Perfect - new TEST version is published

Please send some screenshots of the device and Energy Dashboard as well.

Thank you (and good night)

Tested on the latest version ( 1.0.150)

For the device :






And device is now showing in energy dashboard with the Instant Power data, but refresh does not seem to respect the 10 or 20sec, like 5min after the app is started, it stops refreshing and shows “2mins ago” for Power, VOltage and Current. I’ll post again tomorrow to see if refresh is still bugged and same for energy dashboard

One more thing I noticed is that icon is not showing on device on mobile app (android).

Hi Elliot

Could you please try version 1.0.153

Andi

Hi Andy,

EDIT:
Maybe it is not an issue, while blinds, curtains and sunshade are valid classes as well. It depends on the possibilities of the device:
https://apps.developer.homey.app/the-basics/devices/best-practices/window-coverings

Original post:
Is it possible to set the curtain motor class by default to windowcoverings instead of blinds?
Usually we can select a virtual class at “what’s plugged in” when the device class is windowcoverings.
(I’m aware of a possible breaking change)

Common curtains setting:

Developer page device info:

Tuya Local curtains (no “plugged in” section):

Developer page device info:

Background:
While I wanted to replace a Tuya cloud based curtain device with the Tuya Local version of that device in related flows, using the Flow Converter app, it responded with “class mismatch”.
This can be overridden and it succeeded, but it will leave regular users puzzled I guessume.

Hello @Andi. I just installed v1.0.156 and it seems that my bseed wifi 2 button wall switch is working. Very happy with that. Thanks.

Hi Andi! Icon is now showing perfectly on mobile as well!

I dont have energy dashboard because i’m on homey pro 2019. But you’ll find below the screenshots of insights view:



It doesnt seem to show the cumulative energy used or my configuration needs update?

Andi, other notes relative to my screenshots :

Current handling as target_power and the local energy accumulation are working well overall. Two things I ran into today, most likely useful for other qccdz units too.

1. Crash on phase_a decode (buffer length mismatch)

Log from the app:

[ERR] The value of "offset" is out of range. It must be >= 0 and <= 6. Received 8
[WRN] Disconnected: The value of "offset" is out of range. It must be >= 0 and <= 6. Received 8

This killed the connection and forced a reconnect. Looks like it’s the phase_a parser trying to read at a fixed offset assuming an 8-byte buffer, but got a shorter one back (you already handle the 7-byte variant elsewhere in _parsePhase, e.g. the Nine/Amperepoint/Noeifevo comment, so probably just this one read call not going through that same length check). Happened once overnight, early morning, charger idle, so it’s not tied to any particular DP value, just an occasional shorter payload from the device.

2. Firmware-side session energy glitch (not a driver bug, but might be worth a sanity guard)

Had a weird one today: charged the car at home only, went from 50% to 63% battery (~9-10 kWh by my estimate, matches the ~2kW plateau I saw on the power tile over about 4 hours total). But charge_session_energy (dp25 on my unit) suddenly reported 48.30 kWh for that session, about 2 hours after charging had actually stopped. Pulled the raw DP debug at the time and confirmed it’s not a Homey-side computation. The device itself sent "25": 4830 (raw), so this is a firmware-side glitch, not your driver misreading anything.

Looking at my car’s charge history, there were two very short restart blips right in the middle of that session (charging stopped/started again twice within 7-10 seconds each, around the same time). My guess is that confused the charger’s own internal session tally.

Not asking you to work around Tuya firmware bugs, but since this flows straight into meter_power.charged via the delta accumulation, one bad session reading like this permanently corrupts the lifetime total until someone notices and manually resets it. Might be worth a basic implausibility check before accumulating a delta, e.g. skip/flag deltas that would imply an unrealistic average power for the elapsed time since the last session end (something like delta_kWh / hours_since_last_session_end vs. current_limit × voltage as a rough ceiling). Not a big deal, just flagging it since I only caught it because I happened to be watching the dashboard that day.

Your wallbox was added before version 1.0.147, and Homey doesn’t apply updated default values to existing devices. That’s why the session‑energy DP on your setup still points to DP 25 — the counter from the previous session, which doesn’t change while charging. The counter that actually increases during charging is DP 1, but right now it’s being discarded as “Unknown DP”.

Fix: Go to the device settings and change the session‑energy DP from 25 to 1.

Hi Peter - If I change the device class, only newly added drivers will use the new class. So it would not break existing devices. Changing existing drivers with a migration ( getClass() andsetClass()) would break all configured flows :frowning:

Andi

Hi Elliot,

Thanks — both of these were spot on, and both are fixed in 1.0.158. One correction on where the first one actually came from.

1. The disconnect — it wasn’t the phase parser

Reasonable inference, but the numbers point elsewhere. _parsePhase has a length guard (if (buf.length < 7) return null) and only does one bounds-checked read, at fixed offset 0. Everything after that is plain index access, which yields undefined rather than throwing.

I reproduced the exact message instead:

readUInt32BE(8) on a 10-byte buffer
  → "The value of 'offset' is out of range. It must be >= 0 and <= 6. Received 8"

Byte-for-byte identical to your log. That call is in tuyapi’s message-parser.js:148, reading the command byte out of the packet header — so what arrived was a truncated 10-byte TCP frame, not a short phase payload. Which fits your observation that it happened while the charger was idle and wasn’t tied to any DP value.

The real bug was on my side though: the app’s error handler didn’t recognise parse errors, so it treated them as fatal and tore down the connection. A single malformed frame shouldn’t do that — the socket was fine. Parse errors now join the exemptions I already had for error 904, error 900 and status timeouts: logged, connection kept. That applies to all drivers, not just chargers.

2. Session energy glitch — guard implemented as you suggested

Implemented essentially your formula:

ceiling = current_max × voltage × phases × elapsed_time × 1.25 + 0.5 kWh

The 1.25 absorbs mains above nominal, the 0.5 kWh keeps short poll intervals from producing an absurdly tight bound.

Against your case: a 38.8 kWh jump roughly 30 seconds after the previous reading, versus a ceiling of about 0.54 kWh → rejected, logged, lifetime total untouched.

I checked it doesn’t eat legitimate readings:

Case Result
1.8 kWh over 30 min at 3.7 kW accepted
29 kWh after Homey was offline 8 h mid-charge accepted
10 kWh over 30 min, 22 kW three-phase accepted
first reading after a restart accepted (no baseline to judge against)
your 38.8 kWh in 30 s rejected

The ceiling scales off the configured current limit and phase count, so it adapts per device.

One thing it can’t do is repair the damage already done — your total is still carrying that bad session. The Reset energy meter flow action zeroes it, and it rebuilds cleanly from there.

While I’m at it — unrelated, but worth checking on your unit

If your cumulative total looks stuck generally: chargers paired before 1.0.147 still have Session Energy DP set to 25. On this hardware DP 25 holds the previous session and doesn’t move during a charge; the counter that actually climbs is DP 1. Homey doesn’t apply changed defaults to existing devices, so it needs changing by hand once. As of 1.0.157 the log now points this out when it spots an unmapped DP counting up.

Thanks again — the raw DP dump and the detail about the two restart blips is exactly what made both of these diagnosable.

Andi

Perfect I tried with new version after doing a reset and changing DP and here are the graphs :

As you can see, the maths seem a bit off because with first charge, Charged Energy only went from 0 to 0,002kWh, and with the second charge it went from 0,002kWh to 2,02kWh. I was expecting (from the power graph) 0,78 kWh for the first charge (30min at 1556W) and 1,556 kWh for the second charge (1h at 1556W). End result 2,02kWh seems almost correct, but it incremented a bit too late?

Other than that all others points are covered from my point of view!

Hi Elliot - Which values do you see in the normal Tuya App?

I don’t see any record in Tuya App because charge is done by another user than myself (user is your app so it doesnt show on my Tuya account)