-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[kermi] Added all channels of XCenter
Signed-off-by: Kai Neuhaus <[email protected]>
- Loading branch information
Showing
28 changed files
with
1,114 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ | |
public class KermiConfiguration { | ||
|
||
public int refresh = 5000; | ||
public boolean pvEnabled = false; | ||
} |
34 changes: 34 additions & 0 deletions
34
...ng.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/AlarmDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.modbus.kermi.internal.dto; | ||
|
||
import static org.openhab.binding.modbus.kermi.internal.modbus.KermiModbusConstans.ALARM_REG_SIZE; | ||
|
||
import org.openhab.binding.modbus.kermi.internal.modbus.Data; | ||
import org.openhab.core.io.transport.modbus.ModbusBitUtilities; | ||
import org.openhab.core.library.types.OnOffType; | ||
|
||
/** | ||
* The {@link AlarmDTO} Data object for Kermi Xcenter | ||
* | ||
* @author Kai Neuhaus - Initial contribution | ||
*/ | ||
public class AlarmDTO implements Data { | ||
|
||
public OnOffType alarmIsActive; | ||
|
||
public AlarmDTO(byte[] bArray) { | ||
int status = ModbusBitUtilities.extractBit(bArray, ALARM_REG_SIZE); | ||
alarmIsActive = status == 0 ? OnOffType.OFF : OnOffType.ON; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/ChargingCircuitDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.modbus.kermi.internal.dto; | ||
|
||
import static org.openhab.core.library.unit.Units.LITRE_PER_MINUTE; | ||
|
||
import javax.measure.quantity.Temperature; | ||
|
||
import org.openhab.binding.modbus.kermi.internal.modbus.Data; | ||
import org.openhab.core.io.transport.modbus.ValueBuffer; | ||
import org.openhab.core.library.dimension.VolumetricFlowRate; | ||
import org.openhab.core.library.types.QuantityType; | ||
import org.openhab.core.library.unit.SIUnits; | ||
|
||
/** | ||
* The {@link ChargingCircuitDTO} Data object for Kermi Xcenter | ||
* | ||
* @author Kai Neuhaus - Initial contribution | ||
*/ | ||
public class ChargingCircuitDTO implements Data { | ||
|
||
public QuantityType<Temperature> flowTemperature; | ||
public QuantityType<Temperature> returnFlowTemperature; | ||
public QuantityType<VolumetricFlowRate> flowSpeed; | ||
|
||
public ChargingCircuitDTO(byte[] bArray) { | ||
ValueBuffer wrap = ValueBuffer.wrap(bArray); | ||
flowTemperature = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), SIUnits.CELSIUS); | ||
returnFlowTemperature = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), SIUnits.CELSIUS); | ||
flowSpeed = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), LITRE_PER_MINUTE); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...us.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/EnergySourceDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.modbus.kermi.internal.dto; | ||
|
||
import javax.measure.quantity.Temperature; | ||
|
||
import org.openhab.binding.modbus.kermi.internal.modbus.Data; | ||
import org.openhab.core.io.transport.modbus.ValueBuffer; | ||
import org.openhab.core.library.types.QuantityType; | ||
import org.openhab.core.library.unit.SIUnits; | ||
|
||
/** | ||
* The {@link EnergySourceDTO} Data object for Kermi Xcenter | ||
* | ||
* @author Kai Neuhaus - Initial contribution | ||
*/ | ||
public class EnergySourceDTO implements Data { | ||
|
||
public QuantityType<Temperature> exitTemperature; | ||
public QuantityType<Temperature> incomingTemperature; | ||
public QuantityType<Temperature> outsideTemperature; | ||
|
||
public EnergySourceDTO(byte[] bArray) { | ||
ValueBuffer wrap = ValueBuffer.wrap(bArray); | ||
exitTemperature = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), SIUnits.CELSIUS); | ||
incomingTemperature = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), SIUnits.CELSIUS); | ||
outsideTemperature = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), SIUnits.CELSIUS); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
...ng.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/PowerDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.modbus.kermi.internal.dto; | ||
|
||
import javax.measure.quantity.Power; | ||
|
||
import org.openhab.binding.modbus.kermi.internal.modbus.Data; | ||
import org.openhab.core.io.transport.modbus.ValueBuffer; | ||
import org.openhab.core.library.types.DecimalType; | ||
import org.openhab.core.library.types.QuantityType; | ||
import org.openhab.core.library.unit.Units; | ||
|
||
/** | ||
* The {@link PowerDTO} Data object for Kermi Xcenter State Block | ||
* | ||
* @author Kai Neuhaus - Initial contribution | ||
*/ | ||
public class PowerDTO implements Data { | ||
|
||
public DecimalType cop; | ||
public DecimalType copHeating; | ||
public DecimalType copDrinkingwater; | ||
public DecimalType copCooling; | ||
|
||
public QuantityType<Power> power; | ||
public QuantityType<Power> powerHeating; | ||
public QuantityType<Power> powerDrinkingwater; | ||
public QuantityType<Power> powerCooling; | ||
|
||
public QuantityType<Power> electricPower; | ||
public QuantityType<Power> electricPowerHeating; | ||
public QuantityType<Power> electricPowerDrinkingwater; | ||
public QuantityType<Power> electricPowerCooling; | ||
|
||
public PowerDTO(byte[] bArray) { | ||
|
||
ValueBuffer wrap = ValueBuffer.wrap(bArray); | ||
|
||
cop = new DecimalType(DataConverter.getUDoubleValue(wrap, 0.1)); | ||
copHeating = new DecimalType(DataConverter.getUDoubleValue(wrap, 0.1)); | ||
copDrinkingwater = new DecimalType(DataConverter.getUDoubleValue(wrap, 0.1)); | ||
copCooling = new DecimalType(DataConverter.getUDoubleValue(wrap, 0.1)); | ||
|
||
power = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 100), Units.WATT); | ||
powerHeating = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 100), Units.WATT); | ||
powerDrinkingwater = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 100), Units.WATT); | ||
powerCooling = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 100), Units.WATT); | ||
|
||
electricPower = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 100), Units.WATT); | ||
electricPowerHeating = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 100), Units.WATT); | ||
electricPowerDrinkingwater = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 100), Units.WATT); | ||
electricPowerCooling = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 100), Units.WATT); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...nding.modbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/PvDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.modbus.kermi.internal.dto; | ||
|
||
import javax.measure.quantity.Power; | ||
import javax.measure.quantity.Temperature; | ||
|
||
import org.openhab.binding.modbus.kermi.internal.modbus.Data; | ||
import org.openhab.core.io.transport.modbus.ModbusBitUtilities; | ||
import org.openhab.core.io.transport.modbus.ValueBuffer; | ||
import org.openhab.core.library.types.OnOffType; | ||
import org.openhab.core.library.types.QuantityType; | ||
import org.openhab.core.library.unit.SIUnits; | ||
import org.openhab.core.library.unit.Units; | ||
|
||
/** | ||
* The {@link PvDTO} Data object for Kermi Xcenter | ||
* | ||
* @author Kai Neuhaus - Initial contribution | ||
*/ | ||
public class PvDTO implements Data { | ||
|
||
public OnOffType pvModulationActive; | ||
public QuantityType<Power> pvModulationPower; | ||
public QuantityType<Temperature> pvTargetTemperatureHeating; | ||
public QuantityType<Temperature> pvTargetTemperatureDrinkingwater; | ||
|
||
public PvDTO(byte[] bArray) { | ||
|
||
int modActive = ModbusBitUtilities.extractBit(bArray, 0); | ||
pvModulationActive = modActive == 0 ? OnOffType.OFF : OnOffType.ON; | ||
|
||
ValueBuffer wrap = ValueBuffer.wrap(bArray); | ||
// skip first bit -> modActive-Value | ||
wrap.position(2); | ||
|
||
pvModulationPower = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), Units.WATT); | ||
pvTargetTemperatureHeating = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), SIUnits.CELSIUS); | ||
pvTargetTemperatureDrinkingwater = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), | ||
SIUnits.CELSIUS); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...odbus.kermi/src/main/java/org/openhab/binding/modbus/kermi/internal/dto/WorkHoursDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.modbus.kermi.internal.dto; | ||
|
||
import javax.measure.quantity.Time; | ||
|
||
import org.openhab.binding.modbus.kermi.internal.modbus.Data; | ||
import org.openhab.core.io.transport.modbus.ValueBuffer; | ||
import org.openhab.core.library.types.QuantityType; | ||
import org.openhab.core.library.unit.Units; | ||
|
||
/** | ||
* The {@link WorkHoursDTO} Data object for Kermi Xcenter State Block | ||
* | ||
* @author Kai Neuhaus - Initial contribution | ||
*/ | ||
public class WorkHoursDTO implements Data { | ||
|
||
public QuantityType<Time> workHoursFan; | ||
public QuantityType<Time> workHoursStorageLoadingPump; | ||
public QuantityType<Time> workHoursCompressor; | ||
|
||
public WorkHoursDTO(byte[] bArray) { | ||
|
||
ValueBuffer wrap = ValueBuffer.wrap(bArray); | ||
|
||
workHoursFan = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), Units.HOUR); | ||
workHoursStorageLoadingPump = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), Units.HOUR); | ||
workHoursCompressor = QuantityType.valueOf(DataConverter.getUDoubleValue(wrap, 0.1), Units.HOUR); | ||
} | ||
} |
Oops, something went wrong.