diff --git a/charger/alphatec.go b/charger/alphatec.go index fcb3a1d24..5c1fd67ba 100644 --- a/charger/alphatec.go +++ b/charger/alphatec.go @@ -47,32 +47,25 @@ func init() { // NewAlphatecFromConfig creates a Alphatec charger from generic config func NewAlphatecFromConfig(other map[string]interface{}) (api.Charger, error) { - cc := struct { - modbus.Settings `mapstructure:",squash"` - Timeout time.Duration - }{ - Settings: modbus.Settings{ - ID: 1, - }, + cc := modbus.Settings{ + ID: 1, } if err := util.DecodeOther(other, &cc); err != nil { return nil, err } - return NewAlphatec(cc.URI, cc.Device, cc.Comset, cc.Baudrate, modbus.ProtocolFromRTU(cc.RTU), cc.ID, cc.Timeout) + return NewAlphatec(cc.URI, cc.Device, cc.Comset, cc.Baudrate, modbus.ProtocolFromRTU(cc.RTU), cc.ID) } // NewAlphatec creates Alphatec charger -func NewAlphatec(uri, device, comset string, baudrate int, proto modbus.Protocol, slaveID uint8, timeout time.Duration) (api.Charger, error) { +func NewAlphatec(uri, device, comset string, baudrate int, proto modbus.Protocol, slaveID uint8) (api.Charger, error) { conn, err := modbus.NewConnection(uri, device, comset, baudrate, proto, slaveID) if err != nil { return nil, err } - if timeout > 0 { - conn.Timeout(timeout) - } + conn.Delay(20 * time.Millisecond) if !sponsor.IsAuthorized() { return nil, api.ErrSponsorRequired diff --git a/templates/definition/charger/alphatec.yaml b/templates/definition/charger/alphatec.yaml index a4e190cdb..07e243594 100644 --- a/templates/definition/charger/alphatec.yaml +++ b/templates/definition/charger/alphatec.yaml @@ -2,16 +2,20 @@ template: alphatec products: - brand: Alphatec description: - generic: Wallbox Mini/ AW1eM + generic: Wallbox Mini/Power + - brand: Alphatec + description: + generic: Ladesäule Twin requirements: + description: + de: Die Hauptplatine benötigt eine aktuelle Firmware. Eine aktuelle Softwareversion kann man daran erkennen, dass die Seriennummer auf dem braunen Relais mit 2022 beginnt oder auf den kleinen weißen Relais eine 15 steht. Andernfalls bitte direkt an den Hersteller wenden. + en: The motherboard requires current firmware. You can recognize a current software version by the fact that the serial number on the brown relay starts with 2022 or there is a 15 on the small white relays. Otherwise, please contact the manufacturer directly. evcc: ["sponsorship"] params: - name: modbus choice: ["rs485"] baudrate: 9600 comset: 8N1 - - name: timeout render: | type: alphatec {{- include "modbus" . }} - timeout: {{ .timeout }}