diff --git a/charger/phoenix-em-eth.go b/charger/phoenix-em-eth.go index 82ae1d647..e312446e5 100644 --- a/charger/phoenix-em-eth.go +++ b/charger/phoenix-em-eth.go @@ -37,14 +37,15 @@ func init() { // NewPhoenixEMEthFromConfig creates a Phoenix charger from generic config func NewPhoenixEMEthFromConfig(other map[string]interface{}) (api.Charger, error) { cc := struct { - URI string - ID uint8 - Meter struct { + modbus.TcpSettings `mapstructure:",squash"` + Meter struct { Power, Energy, Currents bool } }{ - URI: "192.168.0.8:502", // default - ID: 180, // default + TcpSettings: modbus.TcpSettings{ + URI: "192.168.0.8:502", // default + ID: 180, // default + }, } if err := util.DecodeOther(other, &cc); err != nil { diff --git a/util/templates/modbus.tpl b/util/templates/modbus.tpl index fc4cd3597..aea822557 100644 --- a/util/templates/modbus.tpl +++ b/util/templates/modbus.tpl @@ -12,6 +12,7 @@ rtu: true {{- else if or (eq .modbus "tcpip") .tcpip }} # Modbus TCP uri: {{ .host }}:{{ .port }} +rtu: false {{- else }} # configuration error - should not happen modbusConnectionTypeNotDefined: {{ .modbus }}