From 5ff723dab0bda555c1122aa10a30485e51084938 Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Wed, 3 Sep 2025 08:24:26 +0200 Subject: [PATCH] B+GE-TECH WS/DS100: fix templates (#23384) --- .../definition/meter/bge_tech_ws100.yaml | 73 ------------------- ...bge_tech_ds100.yaml => bgetech-ds100.yaml} | 19 ++--- templates/definition/meter/bgetech-ws100.yaml | 36 +++++++++ 3 files changed, 46 insertions(+), 82 deletions(-) delete mode 100644 templates/definition/meter/bge_tech_ws100.yaml rename templates/definition/meter/{bge_tech_ds100.yaml => bgetech-ds100.yaml} (85%) create mode 100644 templates/definition/meter/bgetech-ws100.yaml diff --git a/templates/definition/meter/bge_tech_ws100.yaml b/templates/definition/meter/bge_tech_ws100.yaml deleted file mode 100644 index 82c592bde..000000000 --- a/templates/definition/meter/bge_tech_ws100.yaml +++ /dev/null @@ -1,73 +0,0 @@ -template: bge_tech_ws100 -products: - - brand: BGEtech - description: - generic: WS100 -params: - - name: usage - choice: ["grid", "pv", "charge", "aux"] - - name: modbus - choice: ["rs485", "tcpip"] - baudrate: 1200 -render: | - type: custom - power: - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 0x0104 # Total active power - type: holding - decode: int32 - {{- if eq .usage "pv" }} - scale: -1 - {{- end }} - energy: - source: modbus - {{- include "modbus" . | indent 2 }} - register: - {{- if eq .usage "pv" }} - address: 0x0118 # Reversing active energy consumption - {{- else }} - address: 0x010E # Forward active energy consumption - {{- end }} - type: holding - decode: int32 - scale: 0.01 - currents: - - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 0x0102 # Electricity of A phase - type: holding - decode: int32 - scale: 0.001 - - source: const - value: 0 # since the device only a single phase, this value is set to 0 - - source: const - value: 0 # since the device only a single phase, this value is set to 0 - voltages: - - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 0x0100 # Voltage of A phase - type: holding - decode: int32 - scale: 0.001 - - source: const - value: 0 # since the device only a single phase, this value is set to 0 - - source: const - value: 0 # since the device only a single phase, this value is set to 0 - powers: - - source: modbus - {{- include "modbus" . | indent 2 }} - register: - address: 0x0104 # Active power of A phase - type: holding - decode: int32 - {{- if eq .usage "pv" }} - scale: -1 - {{- end }} - - source: const - value: 0 # since the device only a single phase, this value is set to 0 - - source: const - value: 0 # since the device only a single phase, this value is set to 0 diff --git a/templates/definition/meter/bge_tech_ds100.yaml b/templates/definition/meter/bgetech-ds100.yaml similarity index 85% rename from templates/definition/meter/bge_tech_ds100.yaml rename to templates/definition/meter/bgetech-ds100.yaml index 7e02bdb5f..db3da6610 100644 --- a/templates/definition/meter/bge_tech_ds100.yaml +++ b/templates/definition/meter/bgetech-ds100.yaml @@ -1,13 +1,14 @@ -template: bge_tech_ds100 +template: bgetech-ds100 +covers: ["bge_tech_ds100"] products: - - brand: BGEtech + - brand: B+GE-TECH description: generic: DS100 params: - name: usage - choice: ["grid", "pv", "charge", "aux"] + choice: ["grid", "pv", "charge"] - name: modbus - choice: ["rs485", "tcpip"] + choice: ["rs485"] baudrate: 1200 render: | type: custom @@ -26,9 +27,9 @@ render: | {{- include "modbus" . | indent 2 }} register: {{- if eq .usage "pv" }} - address: 0x0118 # Reversing active energy consumption + address: 0x0118 # Active energy (feed-in) {{- else }} - address: 0x010E # Forward active energy consumption + address: 0x010E # Active energy (consumption) {{- end }} type: holding decode: int32 @@ -37,21 +38,21 @@ render: | - source: modbus {{- include "modbus" . | indent 2 }} register: - address: 0x0410 # Electricity of A phase + address: 0x0410 # Current of A phase type: holding decode: int32 scale: 0.001 - source: modbus {{- include "modbus" . | indent 2 }} register: - address: 0x0412 # Electricity of B phase + address: 0x0412 # Current of B phase type: holding decode: int32 scale: 0.001 - source: modbus {{- include "modbus" . | indent 2 }} register: - address: 0x0414 # Electricity of C phase + address: 0x0414 # Current of C phase type: holding decode: int32 scale: 0.001 diff --git a/templates/definition/meter/bgetech-ws100.yaml b/templates/definition/meter/bgetech-ws100.yaml new file mode 100644 index 000000000..025c58307 --- /dev/null +++ b/templates/definition/meter/bgetech-ws100.yaml @@ -0,0 +1,36 @@ +template: bgetech-ws100 +covers: ["bge_tech_ws100"] +products: + - brand: B+GE-TECH + description: + generic: WS100 +params: + - name: usage + choice: ["grid", "pv", "charge"] + - name: modbus + choice: ["rs485"] + baudrate: 1200 +render: | + type: custom + power: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + address: 0x0104 # Total active power + type: holding + decode: int32 + {{- if eq .usage "pv" }} + scale: -1 + {{- end }} + energy: + source: modbus + {{- include "modbus" . | indent 2 }} + register: + {{- if eq .usage "pv" }} + address: 0x0118 # Active energy (feed-in) + {{- else }} + address: 0x010E # Active energy (consumption) + {{- end }} + type: holding + decode: int32 + scale: 0.01