mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[plugwiseha] Add 5 boiler related channels (#17737)
* Improvements * Fix compile warnings * Sync config with readme * Fix unit detection * Add 5 channels * Update documentation * Add semantic tags * Add default state * Adjust DTO structure * Improve state pattern * Fix NPE Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
parent
caf163e9ce
commit
336875797b
@ -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
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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<Double> getBurnerFailedStarts() {
|
||||
return this.cumulativeLogs.getBurnerFailedStarts();
|
||||
}
|
||||
|
||||
public Optional<Double> getBurnerStarts() {
|
||||
return this.cumulativeLogs.getBurnerStarts();
|
||||
}
|
||||
|
||||
public Optional<Double> getBurnerOpTime() {
|
||||
return this.cumulativeLogs.getBurnerOpTime();
|
||||
}
|
||||
|
||||
public Optional<Double> getBurnerDHWOPTime() {
|
||||
return this.cumulativeLogs.getBurnerDHWOPTime();
|
||||
}
|
||||
|
||||
public Optional<Double> getBurnerFailedIgnitions() {
|
||||
return this.cumulativeLogs.getBurnerFailedIgnitions();
|
||||
}
|
||||
|
||||
public Optional<Boolean> getIntendedHeatingState() {
|
||||
return this.pointLogs.getIntendedHeatingState();
|
||||
}
|
||||
|
@ -36,11 +36,16 @@ public class Appliances extends PlugwiseHACollection<Appliance> {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -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<CumulativeLog> {
|
||||
|
||||
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<String> getMeasurement() {
|
||||
return Optional.ofNullable(measurement);
|
||||
}
|
||||
|
||||
public Optional<Boolean> 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<Double> getMeasurementAsDouble() {
|
||||
try {
|
||||
if (measurement != null) {
|
||||
return Optional.of(Double.parseDouble(measurement));
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
public Optional<String> 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;
|
||||
}
|
||||
}
|
@ -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<CumulativeLog> {
|
||||
|
||||
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<Double> getBurnerFailedStarts() {
|
||||
return this.getLog(FAILED_BURNER_STARTS).map(logEntry -> logEntry.getMeasurementAsDouble())
|
||||
.orElse(Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<Double> getBurnerStarts() {
|
||||
return this.getLog(BURNER_STARTS).map(logEntry -> logEntry.getMeasurementAsDouble()).orElse(Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<Double> getBurnerOpTime() {
|
||||
return this.getLog(BURNER_OP_TIME).map(logEntry -> logEntry.getMeasurementAsDouble()).orElse(Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<Double> getBurnerDHWOPTime() {
|
||||
return this.getLog(DHW_BURNER_OP_TIME).map(logEntry -> logEntry.getMeasurementAsDouble())
|
||||
.orElse(Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<Double> getBurnerFailedIgnitions() {
|
||||
return this.getLog(FAILED_BURNER_IGNITIONS).map(logEntry -> logEntry.getMeasurementAsDouble())
|
||||
.orElse(Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<CumulativeLog> getLog(String logItem) {
|
||||
return Optional.ofNullable(this.get(logItem));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void merge(Map<String, CumulativeLog> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ public class Location extends PlugwiseBaseModel implements PlugwiseComparableDat
|
||||
private List<String> 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;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class Locations extends PlugwiseHACollection<Location> {
|
||||
}
|
||||
|
||||
if (originalLocation != null && originalLocationIsOlder) {
|
||||
Logs updatedPointLogs = location.getPointLogs();
|
||||
PointLogs updatedPointLogs = location.getPointLogs();
|
||||
if (updatedPointLogs != null) {
|
||||
updatedPointLogs.merge(originalLocation.getPointLogs());
|
||||
}
|
||||
|
@ -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<Log> {
|
||||
public class PointLog extends PlugwiseBaseModel implements PlugwiseComparableDate<PointLog> {
|
||||
|
||||
private String type;
|
||||
|
||||
@ -89,7 +89,7 @@ public class Log extends PlugwiseBaseModel implements PlugwiseComparableDate<Log
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareDateWith(Log compareTo) {
|
||||
public int compareDateWith(PointLog compareTo) {
|
||||
if (compareTo == null) {
|
||||
return -1;
|
||||
}
|
||||
@ -105,12 +105,12 @@ public class Log extends PlugwiseBaseModel implements PlugwiseComparableDate<Log
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNewerThan(Log hasModifiedDate) {
|
||||
public boolean isNewerThan(PointLog hasModifiedDate) {
|
||||
return compareDateWith(hasModifiedDate) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOlderThan(Log hasModifiedDate) {
|
||||
public boolean isOlderThan(PointLog hasModifiedDate) {
|
||||
return compareDateWith(hasModifiedDate) < 0;
|
||||
}
|
||||
}
|
@ -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<Log> {
|
||||
@XStreamAlias("logs")
|
||||
public class PointLogs extends PlugwiseHACollection<PointLog> {
|
||||
|
||||
private static final String THERMOSTAT = "thermostat";
|
||||
private static final String TEMPERATURE = "temperature";
|
||||
@ -181,16 +184,16 @@ public class Logs extends PlugwiseHACollection<Log> {
|
||||
return this.getLog(POWER_USAGE).map(logEntry -> logEntry.getMeasurementAsDouble()).orElse(Optional.empty());
|
||||
}
|
||||
|
||||
public Optional<Log> getLog(String logItem) {
|
||||
public Optional<PointLog> getLog(String logItem) {
|
||||
return Optional.ofNullable(this.get(logItem));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void merge(Map<String, Log> logsToMerge) {
|
||||
public void merge(Map<String, PointLog> 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);
|
@ -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);
|
||||
|
@ -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<Appliance,
|
||||
case APPLIANCE_COOLINGSTATE_CHANNEL:
|
||||
case APPLIANCE_INTENDEDBOILERTEMP_CHANNEL:
|
||||
case APPLIANCE_FLAMESTATE_CHANNEL:
|
||||
case APPLIANCE_BURNER_STARTS_FAILED_CHANNEL:
|
||||
case APPLIANCE_BURNER_STARTS_CHANNEL:
|
||||
case APPLIANCE_BURNER_OP_TIME_CHANNEL:
|
||||
case APPLIANCE_BURNER_DHW_OP_TIME_CHANNEL:
|
||||
case APPLIANCE_BURNER_IGNITIONS_FAILEDCHANNEL:
|
||||
case APPLIANCE_INTENDEDHEATINGSTATE_CHANNEL:
|
||||
case APPLIANCE_MODULATIONLEVEL_CHANNEL:
|
||||
case APPLIANCE_OTAPPLICATIONFAULTCODE_CHANNEL:
|
||||
@ -336,6 +342,31 @@ public class PlugwiseHAApplianceHandler extends PlugwiseHABaseHandler<Appliance,
|
||||
state = OnOffType.from(entity.getFlameState().get());
|
||||
}
|
||||
break;
|
||||
case APPLIANCE_BURNER_STARTS_FAILED_CHANNEL:
|
||||
if (entity.getBurnerFailedStarts().isPresent()) {
|
||||
state = new DecimalType(entity.getBurnerFailedStarts().get());
|
||||
}
|
||||
break;
|
||||
case APPLIANCE_BURNER_STARTS_CHANNEL:
|
||||
if (entity.getBurnerStarts().isPresent()) {
|
||||
state = new DecimalType(entity.getBurnerStarts().get());
|
||||
}
|
||||
break;
|
||||
case APPLIANCE_BURNER_OP_TIME_CHANNEL:
|
||||
if (entity.getBurnerOpTime().isPresent()) {
|
||||
state = new QuantityType<>(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());
|
||||
|
@ -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
|
||||
|
@ -120,6 +120,49 @@
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="burnerStartsFailed">
|
||||
<item-type>Number</item-type>
|
||||
<label>Burner Starts Failed</label>
|
||||
<description>Total count of failed burner starts</description>
|
||||
<state pattern="%.0f" readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="burnerStarts">
|
||||
<item-type>Number</item-type>
|
||||
<label>Burner Starts</label>
|
||||
<description>Total count of burner starts</description>
|
||||
<state pattern="%.0f" readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="burnerIgnitionsFailed">
|
||||
<item-type>Number</item-type>
|
||||
<label>Burner Ignitions Failed</label>
|
||||
<description>Total count of failed burner ignitions</description>
|
||||
<state pattern="%.0f" readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="burnerOpTime">
|
||||
<item-type unitHint="h">Number:Time</item-type>
|
||||
<label>Operation Time</label>
|
||||
<description>Total operation time</description>
|
||||
<tags>
|
||||
<tag>Status</tag>
|
||||
<tag>Duration</tag>
|
||||
</tags>
|
||||
<state pattern="%.0f %unit%" readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="burnerDHWOpTime">
|
||||
<item-type unitHint="h">Number:Time</item-type>
|
||||
<label>DHW Operation Time</label>
|
||||
<description>Total operation time for domestic hot water</description>
|
||||
<tags>
|
||||
<tag>Status</tag>
|
||||
<tag>Duration</tag>
|
||||
</tags>
|
||||
<state pattern="%.0f %unit%" readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="intendedHeatingState">
|
||||
<item-type>Switch</item-type>
|
||||
<label>Intended Heating State</label>
|
||||
@ -145,11 +188,11 @@
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="modulationLevel">
|
||||
<item-type>Number</item-type>
|
||||
<item-type>Number:DimensionLess</item-type>
|
||||
<label>Modulelation Level</label>
|
||||
<description>Gets the modulation level of this boiler</description>
|
||||
<category>heating</category>
|
||||
<state readOnly="true" pattern="%.0f"/>
|
||||
<state readOnly="true" pattern="%.0f %%"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="otAppFaultCode">
|
||||
@ -209,7 +252,7 @@
|
||||
<label>Domestic Hot Water Setpoint Temperature</label>
|
||||
<description>Gets the temperature of the domestic hot water setpoint</description>
|
||||
<category>heating</category>
|
||||
<state readOnly="true" pattern="%.1f %unit%"/>
|
||||
<state readOnly="true" pattern="%.0f %unit%"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="maxBoilerTemperature">
|
||||
@ -217,7 +260,7 @@
|
||||
<label>Max Boiler Temperature</label>
|
||||
<description>Gets the maximum temperature of this boiler</description>
|
||||
<category>heating</category>
|
||||
<state readOnly="true" pattern="%.1f %unit%"/>
|
||||
<state readOnly="true" pattern="%.0f %unit%"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="waterPressure">
|
||||
@ -249,7 +292,7 @@
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="valvePosition">
|
||||
<item-type>Number</item-type>
|
||||
<item-type>Number:DimensionLess</item-type>
|
||||
<label>Valve Position</label>
|
||||
<description>Gets the position of the valve (0% closed, 100% open)</description>
|
||||
<category>heating</category>
|
||||
@ -257,7 +300,7 @@
|
||||
<tag>Status</tag>
|
||||
<tag>OpenLevel</tag>
|
||||
</tags>
|
||||
<state readOnly="true" pattern="%.0f"/>
|
||||
<state readOnly="true" pattern="%.0f %%"/>
|
||||
</channel-type>
|
||||
|
||||
</thing:thing-descriptions>
|
||||
|
@ -27,6 +27,11 @@
|
||||
<channel id="waterPressure" typeId="waterPressure"/>
|
||||
<channel id="coolingState" typeId="coolingState"/>
|
||||
<channel id="flameState" typeId="flameState"/>
|
||||
<channel id="burnerStartsFailed" typeId="burnerStartsFailed"/>
|
||||
<channel id="burnerStarts" typeId="burnerStarts"/>
|
||||
<channel id="burnerIgnitionsFailed" typeId="burnerIgnitionsFailed"/>
|
||||
<channel id="burnerOpTime" typeId="burnerOpTime"/>
|
||||
<channel id="burnerDHWOpTime" typeId="burnerDHWOpTime"/>
|
||||
<channel id="intendedHeatingState" typeId="intendedHeatingState"/>
|
||||
<channel id="dhwComfortMode" typeId="dhwComfortMode"/>
|
||||
<channel id="intendedBoilerTemp" typeId="intendedBoilerTemp"/>
|
||||
@ -40,6 +45,10 @@
|
||||
<channel id="returnWaterTemperature" typeId="returnWaterTemperature"/>
|
||||
</channels>
|
||||
|
||||
<properties>
|
||||
<property name="thingTypeVersion">1</property>
|
||||
</properties>
|
||||
|
||||
<representation-property>id</representation-property>
|
||||
|
||||
<config-description-ref uri="thing-type:plugwiseha:appliance_boiler"/>
|
||||
@ -83,6 +92,10 @@
|
||||
<channel id="valvePosition" typeId="valvePosition"/>
|
||||
</channels>
|
||||
|
||||
<properties>
|
||||
<property name="thingTypeVersion">1</property>
|
||||
</properties>
|
||||
|
||||
<representation-property>id</representation-property>
|
||||
|
||||
<config-description-ref uri="thing-type:plugwiseha:appliance_valve"/>
|
||||
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
|
||||
|
||||
<thing-type uid="plugwiseha:appliance_boiler">
|
||||
|
||||
<instruction-set targetVersion="1">
|
||||
<add-channel id="burnerStartsFailed">
|
||||
<type>plugwiseha:burnerStartsFailed</type>
|
||||
</add-channel>
|
||||
<add-channel id="burnerStarts">
|
||||
<type>plugwiseha:burnerStarts</type>
|
||||
</add-channel>
|
||||
<add-channel id="burnerIgnitionsFailed">
|
||||
<type>plugwiseha:burnerIgnitionsFailed</type>
|
||||
</add-channel>
|
||||
<add-channel id="burnerOpTime">
|
||||
<type>plugwiseha:burnerOpTime</type>
|
||||
</add-channel>
|
||||
<add-channel id="burnerDHWOpTime">
|
||||
<type>plugwiseha:burnerDHWOpTime</type>
|
||||
</add-channel>
|
||||
<update-channel id="modulationLevel">
|
||||
<type>plugwiseha:modulationLevel</type>
|
||||
</update-channel>
|
||||
</instruction-set>
|
||||
|
||||
</thing-type>
|
||||
|
||||
<thing-type uid="plugwiseha:appliance_valve">
|
||||
|
||||
<instruction-set targetVersion="1">
|
||||
<update-channel id="valvePosition">
|
||||
<type>plugwiseha:valvePosition</type>
|
||||
</update-channel>
|
||||
</instruction-set>
|
||||
|
||||
</thing-type>
|
||||
</update:update-descriptions>
|
@ -75,6 +75,12 @@
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="cumulative_log">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="appliance/location">
|
||||
@ -93,6 +99,15 @@
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="logs/cumulative_log/period">
|
||||
<xsl:element name="measurement_date">
|
||||
<xsl:value-of select="measurement/@log_date"/>
|
||||
</xsl:element>
|
||||
<xsl:element name="measurement">
|
||||
<xsl:value-of select="measurement/text()"/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*[name() = 'location' or name()='appliance']/actuator_functionalities">
|
||||
<xsl:for-each select="./*">
|
||||
<xsl:element name="actuator_functionality">
|
||||
|
Loading…
Reference in New Issue
Block a user