evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Tuya dé (tuya-depow): current rounded down to DP 107 steps, intermediate values (e.g. 15 A) not used

Open manuelmrmorgado opened this issue 1 week ago • 4 comments

With the tuya-depow charger (dé portable charger, Tuya local), the charging current is rounded down to the values listed in DP 107 (x_adjust_current), which on my charger is [6, 8, 10, 13, 16].

  • Setting max current to 15 A keeps the charger at 13 A. Setting 16 A works.
  • In PV mode, a computed 11, 12, 14 or 15 A is also rounded down, so part of the available surplus is not used.

Cause (from reading the driver)

MaxCurrent() calls tuyaDepowStep(), which returns the highest value from DP 107 not exceeding the request (15 → 13, 12 → 10, ...). DP 107 seems to be the list of presets shown in the vendor app, not a limit of the firmware: on my charger I can set intermediate currents (11, 12, 14, 15 A) directly in the Tuya app and tuya-local in homeassistant / by writing DP 150 (x_charge_current), and the charger follows them.

Describe the solution you'd like evcc should send the requested current (clamped to the min/max range from DP 107 / DP 152) instead of rounding down to a listed step, so that any integer current between 6 and 32 A can be used, in both fixed and PV modes.

Describe alternatives you've considered Using the charger as homeassistant works well.

manuelmrmorgado avatar Nov 22 '26 01:11 manuelmrmorgado

Confirmed from the code: MaxCurrent() in charger/tuya-depow.go passes the request through tuyaDepowStep(). That function rounds down to the highest value in DP 107, so 15 A becomes 13 A and 12 A becomes 10 A. tuyaDepowLimits() applies the same rounding to the upper limit taken from DP 152.

The step list was a deliberate choice in the original driver (#34036). Sending any integer between the lowest and highest step would be a small change, but it only works if the firmware accepts intermediate values on all models. The report confirms that for one charger. A fix needs to be tested on real hardware first.

cc @premultiply, do you know whether other tuya-depow models reject currents that are not in DP 107?

🤖 Generated with Claude Code

github-actions[bot] avatar Nov 22 '26 01:11 github-actions[bot]

Right, then we should give it a go without the set levels. It’s always struck me as a bit odd, but I do have to rely on what others tell me.

premultiply avatar Nov 22 '26 07:11 premultiply

/fix

premultiply avatar Nov 22 '26 07:11 premultiply

Implemented: MaxCurrent() in charger/tuya-depow.go now sends the requested current clamped to the min (lowest DP 107 value) and max (highest DP 107 value, limited by DP 152), instead of rounding down to a listed step. Tests were adjusted accordingly. I could not run the tests or test against real hardware in this session, so please verify with a nightly build once the PR is merged.

🤖 Generated with Claude Code

github-actions[bot] avatar Nov 22 '26 07:11 github-actions[bot]