From 37c6d6b3eb961f6dc129251293282325a5d725ef Mon Sep 17 00:00:00 2001 From: KaiNative Date: Sat, 23 Nov 2024 16:07:38 +0100 Subject: [PATCH] [kermi] Initial contribution (#16329) * [kermi] Initial working state Signed-off-by: Kai Neuhaus --- bom/openhab-addons/pom.xml | 5 + .../README.md | 235 +++++++ .../org.openhab.binding.modbus.kermi/pom.xml | 25 + .../kermi/internal/KermiBindingConstants.java | 86 +++ .../kermi/internal/KermiConfiguration.java | 27 + .../kermi/internal/KermiHandlerFactory.java | 47 ++ .../modbus/kermi/internal/dto/AlarmDTO.java | 34 + .../internal/dto/ChargingCircuitDTO.java | 42 ++ .../kermi/internal/dto/DataConverter.java | 83 +++ .../kermi/internal/dto/EnergySourceDTO.java | 39 ++ .../modbus/kermi/internal/dto/PowerDTO.java | 64 ++ .../modbus/kermi/internal/dto/PvDTO.java | 52 ++ .../modbus/kermi/internal/dto/StateDTO.java | 32 + .../kermi/internal/dto/WorkHoursDTO.java | 41 ++ .../handler/KermiXcenterThingHandler.java | 613 ++++++++++++++++++ .../modbus/kermi/internal/modbus/Data.java | 34 + .../internal/modbus/KermiModbusConstans.java | 66 ++ .../modbus/kermi/internal/modbus/Parser.java | 144 ++++ .../resources/OH-INF/i18n/kermi.properties | 99 +++ .../OH-INF/thing/bridge-kermi-xcenter.xml | 35 + .../thing/xcenter-alarm-channel-groups.xml | 13 + .../thing/xcenter-alarm-channel-types.xml | 11 + ...center-charging-circuit-channel-groups.xml | 15 + ...xcenter-charging-circuit-channel-types.xml | 24 + .../xcenter-energy-source-channel-groups.xml | 15 + .../xcenter-energy-source-channel-types.xml | 24 + .../thing/xcenter-power-channel-groups.xml | 24 + .../thing/xcenter-power-channel-types.xml | 68 ++ .../xcenter-pv-modulation-channel-groups.xml | 18 + .../xcenter-pv-modulation-channel-types.xml | 26 + .../thing/xcenter-state-channel-groups.xml | 13 + .../thing/xcenter-state-channel-types.xml | 29 + .../xcenter-workhours-channel-groups.xml | 15 + .../thing/xcenter-workhours-channel-types.xml | 24 + .../kermi/internal/dto/StateDTOTest.java | 34 + bundles/pom.xml | 1 + 36 files changed, 2157 insertions(+) create mode 100644 bundles/org.openhab.binding.modbus.kermi/README.md create mode 100644 bundles/org.openhab.binding.modbus.kermi/pom.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/KermiBindingConstants.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/KermiConfiguration.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/KermiHandlerFactory.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/AlarmDTO.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/ChargingCircuitDTO.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/DataConverter.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/EnergySourceDTO.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/PowerDTO.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/PvDTO.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/StateDTO.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/WorkHoursDTO.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/handler/KermiXcenterThingHandler.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/modbus/Data.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/modbus/KermiModbusConstans.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/modbus/Parser.java create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/i18n/kermi.properties create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/bridge-kermi-xcenter.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-alarm-channel-groups.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-alarm-channel-types.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-charging-circuit-channel-groups.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-charging-circuit-channel-types.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-energy-source-channel-groups.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-energy-source-channel-types.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-power-channel-groups.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-power-channel-types.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-pv-modulation-channel-groups.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-pv-modulation-channel-types.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-state-channel-groups.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-state-channel-types.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-workhours-channel-groups.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/main/resources/OH-INF/thing/xcenter-workhours-channel-types.xml create mode 100644 bundles/org.openhab.binding.modbus.kermi/src/test/java/org/openhab/binding/modbus/kermi/internal/dto/StateDTOTest.java diff --git a/bom/openhab-addons/pom.xml b/bom/openhab-addons/pom.xml index d19f228c8b905..358238e10e565 100644 --- a/bom/openhab-addons/pom.xml +++ b/bom/openhab-addons/pom.xml @@ -1151,6 +1151,11 @@ org.openhab.binding.modbus.helioseasycontrols ${project.version} + + org.openhab.addons.bundles + org.openhab.binding.modbus.kermi + ${project.version} + org.openhab.addons.bundles org.openhab.binding.modbus.sbc diff --git a/bundles/org.openhab.binding.modbus.kermi/README.md b/bundles/org.openhab.binding.modbus.kermi/README.md new file mode 100644 index 0000000000000..c5d99df140101 --- /dev/null +++ b/bundles/org.openhab.binding.modbus.kermi/README.md @@ -0,0 +1,235 @@ +# Kermi Heat pump + +Integrates the X-Center Device (X-Center Pro) of Kermi Heat pump. +Kermi X-Center & other attached devices (in progress) are integrated into the Modbus Binding. + +This binding was tested and developed with Kermi x-change dynamic pro heat pump (build 2023). + +Hint: This binding _may_ also work with devices from "Bösch" in Austria, which is a sub-brand of Kermi, they are nearly identically. + +## Prerequisite + +Requirement is contacting Kermi Support to activate Modbus-TCP which can be connected directly by network. +Older devices (non-Pro ?) were connected by Modbus-RCP - maybe you can try to connect them here using a Modbus-TCP modulator (e.x. from waveshare or similar). + +## Supported Things + +First you need a "Modbus TCP-Bridge" which establishes the basic connection towards your X-Center device. + +| Name | Thing Type ID | Description | +|--------------------------|---------------|-----------------------------------------------------------------------------------------------------------------------------| +| Kermi Heat Pump X-Center | kermi-xcenter | Provides (electric) Power values, Flow-information, PV-States, Temperatures and general Information of your Kermi Heat Pump | + +## Discovery + +This binding does not support autodiscovery. + +## Device IDs + +| Device | Device ID | Comment | +|---------------------|-----------|-------------------------------------------------| +| X-Center | 40 | on cascade-circuits: slave1: 41, slave2: 42, ...| + +## Thing Configuration + +The needed Bridge can be found in the **Modbus Binding** and have to be added manually without Discovery. + +1. Create _Modbus TCP Slave (Bridge)_ with matching Settings of your Kermi Device: + +- **IP Address** - IP Address or hostname of your heatpump +- **Port** - Port of modbus on your heatpump (normally 502) +- **Device ID** - ID on modbus, 40 is default for Kermi (see [Device IDs](#device-ids)) + +1. Create _Kermi Heat Pump X-Center_ and attach it to the previous installed _Modbus TCP Slave (Bridge)_. +Configuration requires an appropriate Data Refresh Interval with more than 2000 Milliseconds, default is 5000. +If it's too fast, you may experience errors in openHAB or your X-Center! +Reboot if X-Center stops responding on network access. +You can enable "PV Modulation" if you want to read the values (default: disabled) + +Details on Configurations explained below. + +### Modbus TCP Slave + +| Parameter | Type | Description | +|-----------|---------|---------------------------------------------------------------| +| host | text | IP Address or reachable hostname of your device | +| port | integer | TCP Port of your Kermi device Modbus Settings. Default is 502 | +| deviceId | integer | Modbus ID of your Kermi device Modbus Settings. Default is 40 | + +### Kermi Heat Pump X-Center + +Select as Bridge your previously created Modbus TCP Slave. + +| Parameter | Type | Description | +|-----------|---------|----------------------------------------------------------------| +| refresh | integer | Refresh Rate of X-Center values in Milliseconds (default:5000) | +| pvEnabled | boolean | Read PV-Modulation (default:false) | + + +### Kermi StorageSystemModule (support planned in future releases) + +Select as Bridge a separate (second) Modbus TCP Slave. + +| Parameter | Type | Description | +|-----------|---------|--------------------------------------------------------------------| +| host | text | IP Address or reachable hostname of your device (same as X-Center) | +| port | integer | TCP Port of your Kermi device Modbus Settings. Default is 502 | +| deviceId | integer | Modbus ID of your Kermi device Modbus Settings. Default is 50 | + +### Channel-Groups + +The X-Center / StorageSystemModule device offers quite an amount of channels. +They are grouped into 7 channel-groups: + +- State +- EnergySource +- Charging Circuit +- Power & Efficiency +- Workhours +- Alarm +- PV Modulation + +### Channels + +#### Status + +| Channel Id | Channel | Type | Description | +|-----------------|-----------------|--------|----------------------------------------------------------------------| +| global-state-id | Global State ID | Number | State of heat pump as Number, displayed as readable State-Text in UI | + +Possible states: + +- Standby +- Alarm +- DrinkingWater +- Heating +- Defrost +- Preparing +- Blocked +- EVU Blocktime +- Unavailable + +#### Energy-Source + +| Channel Id | Channel Label | Channnel Id | Type | Description | +|----------------------------|----------------------|-------------|---------------------|-------------------------------------------------| +| exit-temperature | Exit temperature | | Number | in °C - Air temperature exiting heat pump | +| incoming-temperature | Incoming temperature | | Number | in °C - Air temperature incoming into heat pump | +| temperature-sensor-outside | Temperature Outside | | Number | in °C - Outside Air Temperature (if connected) | + +#### Charging Circuit + +| Channel Id | Channel Label | Type | Description | +|--------------------|--------------------|----------------------------|-----------------------------------------------------------------------------------| +| flow-temperature | Flow temperature | Number | in °C - Water temperature **from** heat pump to drinking water or heating circuit | +| return-temperature | Return temperature | Number | in °C - Water temperature returning back **to** heat pump | +| flow-speed | Flow speed | Number | in l/min - Flow speed of the water | + +#### Power and efficiency + +| Channel Id | Channel Label | Type | Description | +|--------------------------------|---------------------------------------|---------------|--------------------------------------------------| +| cop | Current COP | Number | current cop overall (Coefficient Of Performance) | +| cop-heating | Current COP heating | Number | cop for heating | +| cop-drinkingwater | Current COP drinking water | Number | cop for drinking water | +| cop-cooling | Current COP cooling | Number | cop for cooling | +| | | | | +| power | Current power | Number | in W (Watt) - Power overall | +| power-heating | Current power heating | Number | in W (Watt) - Power for heating | +| power-drinkingwater | Current power drinking water | Number | in W (Watt) - Power for drinking water | +| power-cooling | Current power cooling | Number | in W (Watt) - Power for cooling | +| | | | | +| electrical-power | Current electric power | Number | in W (Watt) - electric Power overall | +| electrical-power-heating | Current electric power heating | Number | in W (Watt) - electric Power for heating | +| electrical-power-drinkingwater | Current electric power drinking water | Number | in W (Watt) - electric Power for drinking water | +| electrical-power-cooling | Current electric power cooling | Number | in W (Watt) - electric Power for cooling | + +#### Workhours + +| Channel Id | Channel Label | Type | Description | +|--------------------------------|--------------------------------|--------------|--------------------------------------------------------| +| workhours-fan | Fan workhours | Number