Versicharge: add mA regulation (#28173)

This commit is contained in:
denis-gaebler 2026-03-13 16:19:17 +01:00 • committed by GitHub
parent dba93a9212
commit 29cab7546a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View file

@ -127,13 +127,22 @@ func (wb *Versicharge) Enable(enable bool) error {
// MaxCurrent implements the api.Charger interface
func (wb *Versicharge) MaxCurrent(current int64) error {
return wb.MaxCurrentMillis(float64(current))
}
var _ api.ChargerEx = (*Versicharge)(nil)
// MaxCurrentMillis implements the api.ChargerEx interface
func (wb *Versicharge) MaxCurrentMillis(current float64) error {
if current < 6 {
return fmt.Errorf("invalid current %d", current)
return fmt.Errorf("invalid current %.1f", current)
}
_, err := wb.conn.WriteSingleRegister(versiRegMaxCurrent, uint16(current))
curr := uint16(current * 100)
_, err := wb.conn.WriteSingleRegister(versiRegMaxCurrent, curr)
if err == nil {
wb.current = uint16(current)
wb.current = curr
}
return err

View file

@ -3,6 +3,7 @@ products:
- brand: Siemens
description:
generic: Versicharge GEN3
capabilities: ["mA"]
requirements:
evcc: ["sponsorship"]
description: