diff --git a/go.mod b/go.mod index d7a3110ae..a9f074941 100644 --- a/go.mod +++ b/go.mod @@ -73,7 +73,7 @@ require ( github.com/spf13/viper v1.11.0 github.com/stretchr/testify v1.7.1 github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c - github.com/volkszaehler/mbmd v0.0.0-20220513145931-a8df46294407 + github.com/volkszaehler/mbmd v0.0.0-20220528181824-7251dd80a3fb 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-20220518171630-0b5c67f07fdf diff --git a/go.sum b/go.sum index 35a623c11..5617c46c5 100644 --- a/go.sum +++ b/go.sum @@ -910,8 +910,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-20220513145931-a8df46294407 h1:GyDTzbudD4tlden9A9UvTiKQvr0GuNdpFm6mtThm5Qg= -github.com/volkszaehler/mbmd v0.0.0-20220513145931-a8df46294407/go.mod h1:JP4R5rxFO4QlDo/DoNp8YrPD2YV0+imTfRTL5xBCUjs= +github.com/volkszaehler/mbmd v0.0.0-20220528181824-7251dd80a3fb h1:ESIHQLaabzC22atuOQ4B3CwyA0sxkTZOD+P/5MbneRY= +github.com/volkszaehler/mbmd v0.0.0-20220528181824-7251dd80a3fb/go.mod h1:JP4R5rxFO4QlDo/DoNp8YrPD2YV0+imTfRTL5xBCUjs= 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/janitza-b23.yaml b/templates/definition/meter/janitza-b23.yaml new file mode 100644 index 000000000..a80a9355e --- /dev/null +++ b/templates/definition/meter/janitza-b23.yaml @@ -0,0 +1,23 @@ +template: janitza-b23 +products: + - brand: Janitza + description: + generic: B23 +params: + - name: usage + choice: ["grid", "pv", "battery", "charge"] + - name: modbus + choice: ["rs485", "tcpip"] +render: | + type: modbus + model: janitza + {{- 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/janitza-b23_0.yaml b/templates/docs/meter/janitza-b23_0.yaml new file mode 100644 index 000000000..7e5a712ea --- /dev/null +++ b/templates/docs/meter/janitza-b23_0.yaml @@ -0,0 +1,100 @@ +product: + brand: Janitza + description: B23 +render: + - usage: grid + default: | + type: template + template: janitza-b23 + 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: janitza-b23 + 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: janitza-b23 + 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: janitza-b23 + 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 diff --git a/templates/evcc.io/brands.json b/templates/evcc.io/brands.json index eeef6681d..b59d1f573 100644 --- a/templates/evcc.io/brands.json +++ b/templates/evcc.io/brands.json @@ -54,6 +54,7 @@ "FENECON", "Fronius", "Huawei", + "Janitza", "Kostal", "LG", "OpenEMS", @@ -81,6 +82,7 @@ "FENECON", "Fronius", "Huawei", + "Janitza", "Kostal", "LG", "OpenEMS",