diff --git a/go.mod b/go.mod index acff674bb..c3eadb09e 100644 --- a/go.mod +++ b/go.mod @@ -87,7 +87,7 @@ require ( github.com/spf13/viper v1.15.0 github.com/stretchr/testify v1.8.1 github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c - github.com/volkszaehler/mbmd v0.0.0-20230122165729-773311cba1f9 + github.com/volkszaehler/mbmd v0.0.0-20230202102845-c58e07a6f048 github.com/writeas/go-strip-markdown v2.0.1+incompatible gitlab.com/bboehmke/sunny v0.15.1-0.20211022160056-2fba1c86ade6 golang.org/x/exp v0.0.0-20230118134722-a68e582fa157 diff --git a/go.sum b/go.sum index f485db651..d0cfb61a1 100644 --- a/go.sum +++ b/go.sum @@ -826,8 +826,8 @@ github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9 github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/volkszaehler/mbmd v0.0.0-20230122165729-773311cba1f9 h1:6Eb9ck8YjG6CQgtiVxkkBVgXeP3mIis8X4W2LMqjR4s= -github.com/volkszaehler/mbmd v0.0.0-20230122165729-773311cba1f9/go.mod h1:9t5d4Wv2j8/yxSAiksgBAxzFUs4ZSFMDlgAbJRnQpAQ= +github.com/volkszaehler/mbmd v0.0.0-20230202102845-c58e07a6f048 h1:5H3b7o4SVvfJcMLS4qZDk/LNanxOYwoPZF9811F/4FQ= +github.com/volkszaehler/mbmd v0.0.0-20230202102845-c58e07a6f048/go.mod h1:y/fJlrURfcBYml7YX+EyLMB7TWFG9IrFGojOSUFPZio= github.com/writeas/go-strip-markdown v2.0.1+incompatible h1:IIqxTM5Jr7RzhigcL6FkrCNfXkvbR+Nbu1ls48pXYcw= github.com/writeas/go-strip-markdown v2.0.1+incompatible/go.mod h1:Rsyu10ZhbEK9pXdk8V6MVnZmTzRG0alMNLMwa0J01fE= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= diff --git a/templates/definition/meter/cg-em24.yaml b/templates/definition/meter/cg-em24.yaml index 7549ff442..2500a87d2 100644 --- a/templates/definition/meter/cg-em24.yaml +++ b/templates/definition/meter/cg-em24.yaml @@ -2,7 +2,7 @@ template: cg-em24 products: - brand: Carlo Gavazzi description: - generic: EM24/ET340 + generic: EM24 params: - name: usage choice: ["grid", "pv", "battery", "charge"] diff --git a/templates/definition/meter/cg-emt3xx.yaml b/templates/definition/meter/cg-emt3xx.yaml new file mode 100644 index 000000000..02d3be21f --- /dev/null +++ b/templates/definition/meter/cg-emt3xx.yaml @@ -0,0 +1,23 @@ +template: cg-emt3xx +products: + - brand: Carlo Gavazzi + description: + generic: EM/ET 330/340 +params: + - name: usage + choice: ["grid", "pv", "battery", "charge"] + - name: modbus + choice: ["rs485", "tcpip"] +render: | + type: modbus + model: cgex3x0 + {{- include "modbus" . }} + {{- if eq .usage "charge" }} + energy: Import # only required for charge meter usage + {{- end }} + {{- if or (eq .usage "charge") (eq .usage "grid") }} + currents: + - CurrentL1 + - CurrentL2 + - CurrentL3 + {{- end }} diff --git a/templates/docs/meter/cg-em24_0.yaml b/templates/docs/meter/cg-em24_0.yaml index 02c311721..7de854952 100644 --- a/templates/docs/meter/cg-em24_0.yaml +++ b/templates/docs/meter/cg-em24_0.yaml @@ -1,6 +1,6 @@ product: brand: Carlo Gavazzi - description: EM24/ET340 + description: EM24 render: - usage: grid default: | diff --git a/templates/docs/meter/cg-emt3xx_0.yaml b/templates/docs/meter/cg-emt3xx_0.yaml new file mode 100644 index 000000000..2041295a8 --- /dev/null +++ b/templates/docs/meter/cg-emt3xx_0.yaml @@ -0,0 +1,100 @@ +product: + brand: Carlo Gavazzi + description: EM/ET 330/340 +render: + - usage: grid + default: | + type: template + template: cg-emt3xx + usage: grid + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + - usage: pv + default: | + type: template + template: cg-emt3xx + usage: pv + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + - usage: battery + default: | + type: template + template: cg-emt3xx + usage: battery + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + - usage: charge + default: | + type: template + template: cg-emt3xx + usage: charge + + # RS485 via adapter (Modbus RTU) + modbus: rs485serial + id: 1 + device: /dev/ttyUSB0 # USB-RS485 Adapter Adresse + baudrate: 9600 # Prüfe die Geräteeinstellungen, typische Werte sind 9600, 19200, 38400, 57600, 115200 + comset: "8N1" # Kommunikationsparameter für den Adapter + + # RS485 via TCP/IP (Modbus RTU) + modbus: rs485tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port + + # Modbus TCP + modbus: tcpip + id: 1 + host: 192.0.2.2 # Hostname + port: 502 # Port