From 279c77ba9d2bb129a7c4962863006372b2484f47 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 19 Jul 2026 19:15:50 +0200 Subject: [PATCH] Daheimladen: fix misleading sponsorship error on station id read (#31956) --- charger/daheimladen.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/charger/daheimladen.go b/charger/daheimladen.go index e65b4975c..7a4e214cc 100644 --- a/charger/daheimladen.go +++ b/charger/daheimladen.go @@ -20,6 +20,7 @@ package charger import ( "context" "encoding/binary" + "errors" "fmt" "time" @@ -93,8 +94,11 @@ func NewDaheimLaden(ctx context.Context, uri string, id uint8, phases bool) (api } c, err := conn.ReadHoldingRegisters(dlRegStationId, 16) - if s, _ := utf16BEBytesAsString(c); err != nil || s == "" { - return nil, api.ErrSponsorRequired + if err != nil { + return nil, fmt.Errorf("station id: %w", err) + } + if s, _ := utf16BEBytesAsString(c); s == "" { + return nil, errors.New("station id not found, device may not be a DaheimLaden") } log := util.NewLogger("daheimladen")