Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/bundle-sungrow-1hz.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ftw": patch
---

Bundle sungrow 1.6.0, which reads grid, PV and battery power, SoC and per-phase values once a second, so live figures on the phone move every second instead of every five. Counters, temperature, frequency and fault bits keep the five-second rate.
2 changes: 1 addition & 1 deletion drivers/BUNDLED_SOURCE.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"from the signed channel. Run scripts/sync-bundled-drivers.sh to update."
],
"repository": "srcfl/device-drivers",
"commit": "c9de25106b07071fde55c9f8f5e95b69c58e6fc9",
"commit": "afc9739dd19920246cadaa5135baa85485840528",
"source_dir": "drivers/lua",
"drivers": [
"ambibox_v2x", "ctek", "ctek_hybrid", "ctek_v2", "deye", "easee_cloud",
Expand Down
10 changes: 10 additions & 0 deletions go/internal/drivers/sungrow_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"strings"
"testing"
"time"

"github.com/srcfl/ftw/go/internal/telemetry"
)
Expand Down Expand Up @@ -267,6 +268,13 @@ func TestSungrowFeedInCurtailPreservesConfiguredInstallerLimit(t *testing.T) {
}
}

// sungrow.lua reads power every second and its running state, counters and
// fault bits on a full read every five seconds, timed by host.millis. Move
// the driver's clock past one so the next poll is a full read.
func untilNextFullRead(env *HostEnv) {
env.Start = env.Start.Add(-5 * time.Second)
}

func TestSungrowPollSurfacesAndClearsThermalDeviceFault(t *testing.T) {
tel := telemetry.NewStore()
modbus := newRecordingModbus()
Expand Down Expand Up @@ -298,6 +306,7 @@ func TestSungrowPollSurfacesAndClearsThermalDeviceFault(t *testing.T) {

modbus.regs[12999] = 0x0040 // Running on-grid
modbus.regs[13055] = 0
untilNextFullRead(env)
if _, err := d.Poll(context.Background()); err != nil {
t.Fatalf("recovery poll: %v", err)
}
Expand Down Expand Up @@ -332,6 +341,7 @@ func TestSungrowProbesTheHybridBlockWhenTheDeviceTypeNeverAnswers(t *testing.T)
// settles within a couple of polls rather than retrying for the session.
var faulted bool
for poll := 0; poll < 4; poll++ {
untilNextFullRead(env)
if _, err := d.Poll(context.Background()); err != nil {
t.Fatalf("poll %d: %v", poll, err)
}
Expand Down
Loading