Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## [Unreleased]

### deye-svk 0.2.3

A poll where the SoC read fails left `bat_soc` nil, and the energy headroom
calculation then raised a Lua error when a battery capacity was set. The
headroom is now skipped for that poll, with the same guard the 50-125k-svk
drivers already use. Seen in the field in EnergyWizard, which runs this driver
(murre87/energywizard#215); not reproduced on hardware here.

### easee_cloud 1.4.1

The driver says its session energy is coarse, with `session_wh_coarse`. Easee
Expand Down
6 changes: 4 additions & 2 deletions drivers/lua/deye-svk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ DRIVER = {
id = "deye-svk",
name = "Deye SUN hybrid — lean SvK fast-poll variant",
manufacturer = "Deye",
version = "0.2.2",
version = "0.2.3",
protocols = { "modbus" },
capabilities = { "battery" },
read_only = false,
Expand Down Expand Up @@ -359,7 +359,9 @@ function driver_poll()

-- Energy headroom (Wh) — operator SoC band + capacity, dispatchable.
local chg_eh_wh, dis_eh_wh = 0, 0
if battery_capacity_wh > 0 then
-- bat_soc is nil when the SoC read failed this poll; skip the headroom
-- instead of raising a Lua error (same guard as the 50-125k-svk drivers).
if battery_capacity_wh > 0 and bat_soc then
local soc_pct_int = math.floor(bat_soc * 100 + 0.5)
local span = soc_max_pct - soc_min_pct
if span > 0 then
Expand Down
2 changes: 1 addition & 1 deletion manifests/deye-svk.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "deye-svk"
version: "0.2.2"
version: "0.2.3"
tier: community
author: "Sourceful Labs AB"
protocol: modbus
Expand Down