diff --git a/bundles/org.openhab.binding.plugwiseha/README.md b/bundles/org.openhab.binding.plugwiseha/README.md index 195a1108906..6748bdda4be 100644 --- a/bundles/org.openhab.binding.plugwiseha/README.md +++ b/bundles/org.openhab.binding.plugwiseha/README.md @@ -77,35 +77,40 @@ You must define a Plugwise Home Automation gateway (Bridge) before defining zone ## Channels -| channel | type | Read-only? | description | -|----------------------|--------------------|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| temperature | Number:Temperature | Yes | The temperature of an appliance that supports the thermostat functionality | -| setpointTemperature | Number:Temperature | No | The setpoint temperature (read/write) of an appliance that supports the thermostat functionality | -| power | Switch | No | Toggle an appliance ON/OFF that supports the relay functionality | -| lock | Switch | No | Toggle an appliance lock ON/OFF that supports the relay functionality.(_When the lock is ON the gateway will not automatically control the corresponding relay switch depending on thermostat mode_) | -| powerUsage | Number:Power | Yes | The current power usage in Watts of an appliance that supports this | -| batteryLevel | Number | Yes | The current battery level of an appliance that is battery operated | -| batteryLevelLow | Switch | Yes | Switches ON when the battery level of an appliance that is battery operated drops below a certain threshold | -| chState | Switch | Yes | The current central heating state of the boiler | -| dhwState | Switch | Yes | The current domestic hot water state of the boiler | -| waterPressure | Number:Pressure | Yes | The current water pressure of the boiler | -| presetScene | String | No | The current active scene for the zone | -| regulationControl | String | No | Toggle current regulation control (Active, Passive, Off) for the zone | -| coolingAllowed | Switch | No | Toggle the cooling allowed of a zone ON/OFF | -| valvePosition | Number | Yes | The current position of the valve | -| preHeat | Switch | No | Toggle the pre heating of a zone ON/OFF | -| coolingState | Switch | Yes | The current cooling state of the boiler | -| intendedBoilerTemp | Number:Temperature | Yes | The intended boiler temperature | -| flameState | Switch | Yes | The flame state of the boiler | -| intendedHeatingState | Switch | Yes | The intended heating state of the boiler | -| modulationLevel | Number | Yes | The current modulation level of the boiler | -| otAppFaultCode | Number | Yes | The Opentherm application fault code of the boiler | -| dhwTemperature | Number:Temperature | Yes | The current central heating state of the boiler | -| otOEMFaultCode | Number | Yes | The Opentherm OEM fault code of the boiler | -| boilerTemperature | Number:Temperature | Yes | The current temperature of the boiler | -| dhwSetpoint | Number:Temperature | Yes | The domestic hot water setpoint | -| maxBoilerTemperature | Number:Temperature | Yes | The maximum temperature of the boiler | -| dhwComfortMode | Switch | Yes | The domestic hot water confortmode | +| channel | type | Read-only? | description | +|-----------------------|----------------------|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| temperature | Number:Temperature | Yes | The temperature of an appliance that supports the thermostat functionality | +| setpointTemperature | Number:Temperature | No | The setpoint temperature (read/write) of an appliance that supports the thermostat functionality | +| power | Switch | No | Toggle an appliance ON/OFF that supports the relay functionality | +| lock | Switch | No | Toggle an appliance lock ON/OFF that supports the relay functionality.(_When the lock is ON the gateway will not automatically control the corresponding relay switch depending on thermostat mode_) | +| powerUsage | Number:Power | Yes | The current power usage in Watts of an appliance that supports this | +| batteryLevel | Number | Yes | The current battery level of an appliance that is battery operated | +| batteryLevelLow | Switch | Yes | Switches ON when the battery level of an appliance that is battery operated drops below a certain threshold | +| chState | Switch | Yes | The current central heating state of the boiler | +| dhwState | Switch | Yes | The current domestic hot water state of the boiler | +| waterPressure | Number:Pressure | Yes | The current water pressure of the boiler | +| presetScene | String | No | The current active scene for the zone | +| regulationControl | String | No | Toggle current regulation control (Active, Passive, Off) for the zone | +| coolingAllowed | Switch | No | Toggle the cooling allowed of a zone ON/OFF | +| valvePosition | Number:Dimensionless | Yes | The current position of the valve | +| preHeat | Switch | No | Toggle the pre heating of a zone ON/OFF | +| coolingState | Switch | Yes | The current cooling state of the boiler | +| intendedBoilerTemp | Number:Temperature | Yes | The intended boiler temperature | +| flameState | Switch | Yes | The flame state of the boiler | +| intendedHeatingState | Switch | Yes | The intended heating state of the boiler | +| modulationLevel | Number:Dimensionless | Yes | The current modulation level of the boiler | +| otAppFaultCode | Number | Yes | The Opentherm application fault code of the boiler | +| dhwTemperature | Number:Temperature | Yes | The current central heating state of the boiler | +| otOEMFaultCode | Number | Yes | The Opentherm OEM fault code of the boiler | +| boilerTemperature | Number:Temperature | Yes | The current temperature of the boiler | +| dhwSetpoint | Number:Temperature | Yes | The domestic hot water setpoint | +| maxBoilerTemperature | Number:Temperature | Yes | The maximum temperature of the boiler | +| dhwComfortMode | Switch | Yes | The domestic hot water confortmode | +| burnerStartsFailed | Number | Yes | Total count of failed burner starts | +| burnerStarts | Number | Yes | Total count of burner starts | +| burnerIgnitionsFailed | Number | Yes | Total count of failed burner ignitions | +| burnerOpTime | Number:Time | Yes | Total operation time | +| burnerDHWOpTime | Number:Time | Yes | Total operation time for domestic hot water | ## Full Example diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/PlugwiseHABindingConstants.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/PlugwiseHABindingConstants.java index f9dea6b14a0..cefaf004411 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/PlugwiseHABindingConstants.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/PlugwiseHABindingConstants.java @@ -107,6 +107,13 @@ public class PlugwiseHABindingConstants { public static final String APPLIANCE_COOLINGSTATE_CHANNEL = "coolingState"; public static final String APPLIANCE_INTENDEDBOILERTEMP_CHANNEL = "intendedBoilerTemp"; public static final String APPLIANCE_FLAMESTATE_CHANNEL = "flameState"; + + public static final String APPLIANCE_BURNER_STARTS_FAILED_CHANNEL = "burnerStartsFailed"; + public static final String APPLIANCE_BURNER_STARTS_CHANNEL = "burnerStarts"; + public static final String APPLIANCE_BURNER_OP_TIME_CHANNEL = "burnerOpTime"; + public static final String APPLIANCE_BURNER_DHW_OP_TIME_CHANNEL = "burnerDHWOpTime"; + public static final String APPLIANCE_BURNER_IGNITIONS_FAILEDCHANNEL = "burnerIgnitionsFailed"; + public static final String APPLIANCE_INTENDEDHEATINGSTATE_CHANNEL = "intendedHeatingState"; public static final String APPLIANCE_MODULATIONLEVEL_CHANNEL = "modulationLevel"; public static final String APPLIANCE_OTAPPLICATIONFAULTCODE_CHANNEL = "otAppFaultCode"; diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Appliance.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Appliance.java index b576b60cdcd..a95f17d35c2 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Appliance.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Appliance.java @@ -43,7 +43,10 @@ public class Appliance extends PlugwiseBaseModel implements PlugwiseComparableDa private ZigBeeNode zigbeeNode; @XStreamImplicit(itemFieldName = "point_log", keyFieldName = "type") - private Logs pointLogs; + private PointLogs pointLogs; + + @XStreamImplicit(itemFieldName = "cumulative_log", keyFieldName = "type") + private CumulativeLogs cumulativeLogs; @XStreamImplicit(itemFieldName = "actuator_functionality", keyFieldName = "type") private ActuatorFunctionalities actuatorFunctionalities; @@ -78,13 +81,20 @@ public class Appliance extends PlugwiseBaseModel implements PlugwiseComparableDa return module; } - public Logs getPointLogs() { + public PointLogs getPointLogs() { if (pointLogs == null) { - pointLogs = new Logs(); + pointLogs = new PointLogs(); } return pointLogs; } + public CumulativeLogs getCumulativeLogs() { + if (cumulativeLogs == null) { + cumulativeLogs = new CumulativeLogs(); + } + return cumulativeLogs; + } + public ActuatorFunctionalities getActuatorFunctionalities() { if (actuatorFunctionalities == null) { actuatorFunctionalities = new ActuatorFunctionalities(); @@ -168,6 +178,26 @@ public class Appliance extends PlugwiseBaseModel implements PlugwiseComparableDa return this.pointLogs.getFlameState(); } + public Optional getBurnerFailedStarts() { + return this.cumulativeLogs.getBurnerFailedStarts(); + } + + public Optional getBurnerStarts() { + return this.cumulativeLogs.getBurnerStarts(); + } + + public Optional getBurnerOpTime() { + return this.cumulativeLogs.getBurnerOpTime(); + } + + public Optional getBurnerDHWOPTime() { + return this.cumulativeLogs.getBurnerDHWOPTime(); + } + + public Optional getBurnerFailedIgnitions() { + return this.cumulativeLogs.getBurnerFailedIgnitions(); + } + public Optional getIntendedHeatingState() { return this.pointLogs.getIntendedHeatingState(); } diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Appliances.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Appliances.java index 78325827a80..37679721177 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Appliances.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Appliances.java @@ -36,11 +36,16 @@ public class Appliances extends PlugwiseHACollection { } if (originalAppliance != null && originalApplianceIsOlder) { - Logs updatedPointLogs = applianceToMerge.getPointLogs(); + PointLogs updatedPointLogs = applianceToMerge.getPointLogs(); if (updatedPointLogs != null) { updatedPointLogs.merge(originalAppliance.getPointLogs()); } + CumulativeLogs updatedCumulativeLogs = applianceToMerge.getCumulativeLogs(); + if (updatedCumulativeLogs != null) { + updatedCumulativeLogs.merge(originalAppliance.getCumulativeLogs()); + } + ActuatorFunctionalities updatedActuatorFunctionalities = applianceToMerge .getActuatorFunctionalities(); if (updatedActuatorFunctionalities != null) { diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/CumulativeLog.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/CumulativeLog.java new file mode 100644 index 00000000000..be158bf75eb --- /dev/null +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/CumulativeLog.java @@ -0,0 +1,108 @@ +/** + * 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.plugwiseha.internal.api.model.dto; + +import java.time.ZonedDateTime; +import java.util.Optional; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * @author Leo Siepel - Initial contribution + */ +@XStreamAlias("cumulative_log") +public class CumulativeLog extends PlugwiseBaseModel implements PlugwiseComparableDate { + + private String type; + + private String unit; + + private String measurement; + + @XStreamAlias("updated_date") + private ZonedDateTime updatedDate; + + public String getType() { + return type; + } + + public String getUnit() { + return unit; + } + + public Optional getMeasurement() { + return Optional.ofNullable(measurement); + } + + public Optional getMeasurementAsBoolean() { + if (measurement != null) { + switch (measurement.toLowerCase()) { + case "on": + return Optional.of(true); + case "off": + return Optional.of(false); + default: + return Optional.empty(); + } + } else { + return Optional.empty(); + } + } + + public Optional getMeasurementAsDouble() { + try { + if (measurement != null) { + return Optional.of(Double.parseDouble(measurement)); + } else { + return Optional.empty(); + } + } catch (NumberFormatException e) { + return Optional.empty(); + } + } + + public Optional getMeasurementUnit() { + return Optional.ofNullable(unit); + } + + @Override + public ZonedDateTime getUpdatedDate() { + return updatedDate; + } + + @Override + public int compareDateWith(CumulativeLog compareTo) { + if (compareTo == null) { + return -1; + } + ZonedDateTime compareToDate = compareTo.getUpdatedDate(); + ZonedDateTime compareFromDate = this.getUpdatedDate(); + if (compareFromDate == null) { + return -1; + } else if (compareToDate == null) { + return 1; + } else { + return compareFromDate.compareTo(compareToDate); + } + } + + @Override + public boolean isNewerThan(CumulativeLog hasModifiedDate) { + return compareDateWith(hasModifiedDate) > 0; + } + + @Override + public boolean isOlderThan(CumulativeLog hasModifiedDate) { + return compareDateWith(hasModifiedDate) < 0; + } +} diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/CumulativeLogs.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/CumulativeLogs.java new file mode 100644 index 00000000000..3347af67caf --- /dev/null +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/CumulativeLogs.java @@ -0,0 +1,79 @@ +/** + * 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.plugwiseha.internal.api.model.dto; + +import java.util.Map; +import java.util.Optional; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * The {@link CumulativeLogs} class is an object model class that + * mirrors the XML structure provided by the Plugwise Home Automation + * controller for the collection of logs. + * It extends the {@link PlugwiseHACollection} class. + * + * @author L. Siepel - Initial contribution + */ +@XStreamAlias("logs") +public class CumulativeLogs extends PlugwiseHACollection { + + private static final String FAILED_BURNER_STARTS = "failed_burner_starts"; + private static final String BURNER_STARTS = "burner_starts"; + private static final String BURNER_OP_TIME = "burner_operation_time"; + private static final String DHW_BURNER_OP_TIME = "domestic_hot_water_burner_operation_time"; + private static final String FAILED_BURNER_IGNITIONS = "failed_burner_flame_ignitions"; + + public Optional getBurnerFailedStarts() { + return this.getLog(FAILED_BURNER_STARTS).map(logEntry -> logEntry.getMeasurementAsDouble()) + .orElse(Optional.empty()); + } + + public Optional getBurnerStarts() { + return this.getLog(BURNER_STARTS).map(logEntry -> logEntry.getMeasurementAsDouble()).orElse(Optional.empty()); + } + + public Optional getBurnerOpTime() { + return this.getLog(BURNER_OP_TIME).map(logEntry -> logEntry.getMeasurementAsDouble()).orElse(Optional.empty()); + } + + public Optional getBurnerDHWOPTime() { + return this.getLog(DHW_BURNER_OP_TIME).map(logEntry -> logEntry.getMeasurementAsDouble()) + .orElse(Optional.empty()); + } + + public Optional getBurnerFailedIgnitions() { + return this.getLog(FAILED_BURNER_IGNITIONS).map(logEntry -> logEntry.getMeasurementAsDouble()) + .orElse(Optional.empty()); + } + + public Optional getLog(String logItem) { + return Optional.ofNullable(this.get(logItem)); + } + + @Override + public void merge(Map logsToMerge) { + if (logsToMerge != null) { + for (CumulativeLog logToMerge : logsToMerge.values()) { + String type = logToMerge.getType(); + CumulativeLog originalLog = this.get(type); + + if (originalLog == null || originalLog.isOlderThan(logToMerge)) { + this.put(type, logToMerge); + } else { + this.put(type, originalLog); + } + } + } + } +} diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java index ed86c4d973e..4adefb4e886 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java @@ -42,7 +42,7 @@ public class Location extends PlugwiseBaseModel implements PlugwiseComparableDat private List locationAppliances = new ArrayList<>(); @XStreamImplicit(itemFieldName = "point_log", keyFieldName = "type") - private Logs pointLogs; + private PointLogs pointLogs; @XStreamImplicit(itemFieldName = "actuator_functionality", keyFieldName = "type") private ActuatorFunctionalities actuatorFunctionalities; @@ -67,9 +67,9 @@ public class Location extends PlugwiseBaseModel implements PlugwiseComparableDat return locationAppliances; } - public Logs getPointLogs() { + public PointLogs getPointLogs() { if (pointLogs == null) { - pointLogs = new Logs(); + pointLogs = new PointLogs(); } return pointLogs; } diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Locations.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Locations.java index 4297b814562..46749b9c452 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Locations.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Locations.java @@ -37,7 +37,7 @@ public class Locations extends PlugwiseHACollection { } if (originalLocation != null && originalLocationIsOlder) { - Logs updatedPointLogs = location.getPointLogs(); + PointLogs updatedPointLogs = location.getPointLogs(); if (updatedPointLogs != null) { updatedPointLogs.merge(originalLocation.getPointLogs()); } diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Log.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/PointLog.java similarity index 91% rename from bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Log.java rename to bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/PointLog.java index 2cef71064c3..a871ac3078a 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Log.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/PointLog.java @@ -22,7 +22,7 @@ import com.thoughtworks.xstream.annotations.XStreamAlias; * @author Leo Siepel - finish initial contribution */ @XStreamAlias("point_log") -public class Log extends PlugwiseBaseModel implements PlugwiseComparableDate { +public class PointLog extends PlugwiseBaseModel implements PlugwiseComparableDate { private String type; @@ -89,7 +89,7 @@ public class Log extends PlugwiseBaseModel implements PlugwiseComparableDate 0; } @Override - public boolean isOlderThan(Log hasModifiedDate) { + public boolean isOlderThan(PointLog hasModifiedDate) { return compareDateWith(hasModifiedDate) < 0; } } diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Logs.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/PointLogs.java similarity index 95% rename from bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Logs.java rename to bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/PointLogs.java index da799145c35..ddf06697896 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Logs.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/PointLogs.java @@ -15,15 +15,18 @@ package org.openhab.binding.plugwiseha.internal.api.model.dto; import java.util.Map; import java.util.Optional; +import com.thoughtworks.xstream.annotations.XStreamAlias; + /** - * The {@link Logs} class is an object model class that + * The {@link PointLogs} class is an object model class that * mirrors the XML structure provided by the Plugwise Home Automation * controller for the collection of logs. * It extends the {@link PlugwiseHACollection} class. * * @author B. van Wetten - Initial contribution */ -public class Logs extends PlugwiseHACollection { +@XStreamAlias("logs") +public class PointLogs extends PlugwiseHACollection { private static final String THERMOSTAT = "thermostat"; private static final String TEMPERATURE = "temperature"; @@ -181,16 +184,16 @@ public class Logs extends PlugwiseHACollection { return this.getLog(POWER_USAGE).map(logEntry -> logEntry.getMeasurementAsDouble()).orElse(Optional.empty()); } - public Optional getLog(String logItem) { + public Optional getLog(String logItem) { return Optional.ofNullable(this.get(logItem)); } @Override - public void merge(Map logsToMerge) { + public void merge(Map logsToMerge) { if (logsToMerge != null) { - for (Log logToMerge : logsToMerge.values()) { + for (PointLog logToMerge : logsToMerge.values()) { String type = logToMerge.getType(); - Log originalLog = this.get(type); + PointLog originalLog = this.get(type); if (originalLog == null || originalLog.isOlderThan(logToMerge)) { this.put(type, logToMerge); diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/xml/PlugwiseHAXStream.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/xml/PlugwiseHAXStream.java index ce826b7167f..0b34e281cdc 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/xml/PlugwiseHAXStream.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/xml/PlugwiseHAXStream.java @@ -24,16 +24,18 @@ import org.openhab.binding.plugwiseha.internal.api.model.dto.ActuatorFunctionali import org.openhab.binding.plugwiseha.internal.api.model.dto.ActuatorFunctionalityToggle; import org.openhab.binding.plugwiseha.internal.api.model.dto.Appliance; import org.openhab.binding.plugwiseha.internal.api.model.dto.Appliances; +import org.openhab.binding.plugwiseha.internal.api.model.dto.CumulativeLog; +import org.openhab.binding.plugwiseha.internal.api.model.dto.CumulativeLogs; import org.openhab.binding.plugwiseha.internal.api.model.dto.DomainObjects; import org.openhab.binding.plugwiseha.internal.api.model.dto.GatewayEnvironment; import org.openhab.binding.plugwiseha.internal.api.model.dto.GatewayInfo; import org.openhab.binding.plugwiseha.internal.api.model.dto.Location; import org.openhab.binding.plugwiseha.internal.api.model.dto.Locations; import org.openhab.binding.plugwiseha.internal.api.model.dto.LocationsArray; -import org.openhab.binding.plugwiseha.internal.api.model.dto.Log; -import org.openhab.binding.plugwiseha.internal.api.model.dto.Logs; import org.openhab.binding.plugwiseha.internal.api.model.dto.Module; import org.openhab.binding.plugwiseha.internal.api.model.dto.Modules; +import org.openhab.binding.plugwiseha.internal.api.model.dto.PointLog; +import org.openhab.binding.plugwiseha.internal.api.model.dto.PointLogs; import org.openhab.binding.plugwiseha.internal.api.model.dto.Service; import org.openhab.binding.plugwiseha.internal.api.model.dto.Services; import org.openhab.binding.plugwiseha.internal.api.model.dto.ZigBeeNode; @@ -91,8 +93,10 @@ public class PlugwiseHAXStream extends XStream { this.allowClass(LocationsArray.class); this.allowClass(Locations.class); this.allowClass(Location.class); - this.allowClass(Logs.class); - this.allowClass(Log.class); + this.allowClass(CumulativeLogs.class); + this.allowClass(CumulativeLog.class); + this.allowClass(PointLogs.class); + this.allowClass(PointLog.class); this.allowClass(Services.class); this.allowClass(Service.class); this.allowClass(ZigBeeNode.class); diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAApplianceHandler.java b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAApplianceHandler.java index ccfd84d92fc..7392987f332 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAApplianceHandler.java +++ b/bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAApplianceHandler.java @@ -33,6 +33,7 @@ import org.openhab.binding.plugwiseha.internal.api.exception.PlugwiseHAException import org.openhab.binding.plugwiseha.internal.api.model.PlugwiseHAController; import org.openhab.binding.plugwiseha.internal.api.model.dto.Appliance; import org.openhab.binding.plugwiseha.internal.config.PlugwiseHAThingConfig; +import org.openhab.core.library.types.DecimalType; import org.openhab.core.library.types.OnOffType; import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.unit.ImperialUnits; @@ -198,6 +199,11 @@ public class PlugwiseHAApplianceHandler extends PlugwiseHABaseHandler(entity.getBurnerOpTime().get(), Units.HOUR); + } + break; + case APPLIANCE_BURNER_DHW_OP_TIME_CHANNEL: + if (entity.getBurnerDHWOPTime().isPresent()) { + state = new QuantityType<>(entity.getBurnerDHWOPTime().get(), Units.HOUR); + } + break; + case APPLIANCE_BURNER_IGNITIONS_FAILEDCHANNEL: + if (entity.getBurnerFailedIgnitions().isPresent()) { + state = new DecimalType(entity.getBurnerFailedIgnitions().get()); + } + break; case APPLIANCE_INTENDEDHEATINGSTATE_CHANNEL: if (entity.getIntendedHeatingState().isPresent()) { state = OnOffType.from(entity.getIntendedHeatingState().get()); diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/i18n/plugwiseha.properties b/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/i18n/plugwiseha.properties index 9235b13c404..4c875dfc0e3 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/i18n/plugwiseha.properties +++ b/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/i18n/plugwiseha.properties @@ -47,6 +47,16 @@ thing-type.config.plugwiseha.zone.id.description = Location ID for the zone channel-type.plugwiseha.boilerTemperature.label = Boiler Temperature channel-type.plugwiseha.boilerTemperature.description = Gets the temperature of this boiler +channel-type.plugwiseha.burnerDHWOpTime.label = DHW Operation Time +channel-type.plugwiseha.burnerDHWOpTime.description = Total operation time for domestic hot water +channel-type.plugwiseha.burnerIgnitionsFailed.label = Burner Ignitions Failed +channel-type.plugwiseha.burnerIgnitionsFailed.description = Total count of failed burner ignitions +channel-type.plugwiseha.burnerOpTime.label = Operation Time +channel-type.plugwiseha.burnerOpTime.description = Total operation time +channel-type.plugwiseha.burnerStarts.label = Burner Starts +channel-type.plugwiseha.burnerStarts.description = Total count of burner starts +channel-type.plugwiseha.burnerStartsFailed.label = Burner Starts Failed +channel-type.plugwiseha.burnerStartsFailed.description = Total count of failed burner starts channel-type.plugwiseha.chState.label = Central Heating Active channel-type.plugwiseha.chState.description = Is the boiler active for central heating, On or OFF channel-type.plugwiseha.coolingAllowed.label = Cooling Allowed diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/channels.xml b/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/channels.xml index 46a3cd0b688..6ffe8128029 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/channels.xml @@ -120,6 +120,49 @@ + + Number + + Total count of failed burner starts + + + + + Number + + Total count of burner starts + + + + + Number + + Total count of failed burner ignitions + + + + + Number:Time + + Total operation time + + Status + Duration + + + + + + Number:Time + + Total operation time for domestic hot water + + Status + Duration + + + + Switch @@ -145,11 +188,11 @@ - Number + Number:DimensionLess Gets the modulation level of this boiler heating - + @@ -209,7 +252,7 @@ Gets the temperature of the domestic hot water setpoint heating - + @@ -217,7 +260,7 @@ Gets the maximum temperature of this boiler heating - + @@ -249,7 +292,7 @@ - Number + Number:DimensionLess Gets the position of the valve (0% closed, 100% open) heating @@ -257,7 +300,7 @@ Status OpenLevel - + diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/thing-types.xml index 3b7dd23b13a..8b922919ffd 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/thing-types.xml @@ -27,6 +27,11 @@ + + + + + @@ -40,6 +45,10 @@ + + 1 + + id @@ -83,6 +92,10 @@ + + 1 + + id diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/update/instructions.xml new file mode 100644 index 00000000000..7442a98757b --- /dev/null +++ b/bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/update/instructions.xml @@ -0,0 +1,40 @@ + + + + + + + + plugwiseha:burnerStartsFailed + + + plugwiseha:burnerStarts + + + plugwiseha:burnerIgnitionsFailed + + + plugwiseha:burnerOpTime + + + plugwiseha:burnerDHWOpTime + + + plugwiseha:modulationLevel + + + + + + + + + + plugwiseha:valvePosition + + + + + diff --git a/bundles/org.openhab.binding.plugwiseha/src/main/resources/domain_objects.xslt b/bundles/org.openhab.binding.plugwiseha/src/main/resources/domain_objects.xslt index 8b1be1382bc..f049fde494f 100644 --- a/bundles/org.openhab.binding.plugwiseha/src/main/resources/domain_objects.xslt +++ b/bundles/org.openhab.binding.plugwiseha/src/main/resources/domain_objects.xslt @@ -75,6 +75,12 @@ + + + + + + @@ -93,6 +99,15 @@ + + + + + + + + +