Skip to content

Commit

Permalink
Add channel return temp (openhab#13833)
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
  • Loading branch information
lsiepel authored and andrasU committed Dec 24, 2022
1 parent c47442b commit 3b81c19
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bundles/org.openhab.binding.plugwiseha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,18 @@ Switch main_boiler_chState "Heating active" { channel="plugwiseha:appliance_boil
Switch main_boiler_dhwState "Domestic hot water active" { channel="plugwiseha:appliance_boiler:home:main_boiler:dhwState"}
Switch main_boiler_coolingState "Cooling state" { channel="plugwiseha:appliance_boiler:home:main_boiler:coolingState"}
Number:Temperature main_boiler_intendedBoilerTemp "Intended boiler temperature" {channel="plugwiseha:appliance_boiler:home:living_room_thermostat:intendedBoilerTemp"}
Number:Temperature main_boiler_intendedBoilerTemp "Intended boiler temperature" {channel="plugwiseha:appliance_boiler:home:main_boiler:intendedBoilerTemp"}
Switch main_boiler_flameState "Flame state" { channel="plugwiseha:appliance_boiler:home:main_boiler:flameState"}
Switch main_boiler_intendedHeatingState "Intended heating state" { channel="plugwiseha:appliance_boiler:home:main_boiler:intendedHeatingState"}
Number main_boiler_modulationLevel "Modulation level" {channel="plugwiseha:appliance_boiler:home:living_room_radiator:modulationLevel"}
Number main_boiler_otAppFaultCode "Opentherm app. faultcode" {channel="plugwiseha:appliance_boiler:home:living_room_radiator:otAppFaultCode"}
Number:Temperature main_boiler_dhwTemperature "DHW temperature" {channel="plugwiseha:appliance_boiler:home:living_room_thermostat:dhwTemperature"}
Number main_boiler_otOEMFaultCode "Opentherm OEM faultcode" {channel="plugwiseha:appliance_boiler:home:living_room_radiator:otOEMFaultCode"}
Number:Temperature main_boiler_boilerTemperature "Boiler temperature" {channel="plugwiseha:appliance_boiler:home:living_room_thermostat:boilerTemperature"}
Number:Temperature main_boiler_dhwSetpoint "DHW setpoint" {channel="plugwiseha:appliance_boiler:home:living_room_thermostat:dhwSetpoint"}
Number:Temperature main_boiler_maxBoilerTemperature "Max. boiler temperature" {channel="plugwiseha:appliance_boiler:home:living_room_thermostat:maxBoilerTemperature"}
Number:Temperature main_boiler_dhwTemperature "DHW temperature" {channel="plugwiseha:appliance_boiler:home:main_boiler:dhwTemperature"}
Number main_boiler_otOEMFaultCode "Opentherm OEM faultcode" {channel="plugwiseha:appliance_boiler:home:main_boiler:otOEMFaultCode"}
Number:Temperature main_boiler_boilerTemperature "Boiler temperature" {channel="plugwiseha:appliance_boiler:home:main_boiler:boilerTemperature"}
Number:Temperature main_boiler_dhwSetpoint "DHW setpoint" {channel="plugwiseha:appliance_boiler:home:main_boiler:dhwSetpoint"}
Number:Temperature main_boiler_maxBoilerTemperature "Max. boiler temperature" {channel="plugwiseha:appliance_boiler:home:main_boiler:maxBoilerTemperature"}
Switch main_boiler_dhwComfortMode "DHW comfort mode" { channel="plugwiseha:appliance_boiler:home:main_boiler:dhwComfortMode"}
Number:Temperature main_boiler_returnTemperature "Boiler return temperature" {channel="plugwiseha:appliance_boiler:home:main_boiler:returnWaterTemperature"}
```

**transform/plugwiseha.map**
Expand Down Expand Up @@ -214,6 +215,7 @@ sitemap plugwiseha label="PlugwiseHA Binding"
Number item=main_boiler_dhwSetpoint
Number item=main_boiler_maxBoilerTemperature
Switch item=main_boiler_dhwComfortMode
Number item=main_boiler_returnTemperature
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public class PlugwiseHABindingConstants {
public static final String APPLIANCE_DHWSETPOINT_CHANNEL = "dhwSetpoint";
public static final String APPLIANCE_MAXBOILERTEMPERATURE_CHANNEL = "maxBoilerTemperature";
public static final String APPLIANCE_DHWCOMFORTMODE_CHANNEL = "dhwComfortMode";
public static final String APPLIANCE_RETURNWATERTEMPERATURE_CHANNEL = "returnWaterTemperature";

// List of all Appliance Types
public static final String APPLIANCE_TYPE_THERMOSTAT = "thermostat";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ public Optional<String> getIntendedBoilerTempUnit() {
return this.pointLogs.getIntendedBoilerTempUnit();
}

public Optional<Double> getReturnWaterTemp() {
return this.pointLogs.getReturnWaterTemp();
}

public Optional<String> getReturnWaterTempUnit() {
return this.pointLogs.getReturnWaterTempUnit();
}

public Optional<Boolean> getFlameState() {
return this.pointLogs.getFlameState();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class Logs extends PlugwiseHACollection<Log> {
private static final String CHSTATE = "central_heating_state";
private static final String VALVE_POSITION = "valve_position";
private static final String WATER_PRESSURE = "central_heater_water_pressure";
private static final String RETURNWATERTEMP = "return_water_temperature";

public Optional<Boolean> getCoolingState() {
return this.getLog(COOLINGSTATE).map(logEntry -> logEntry.getMeasurementAsBoolean()).orElse(Optional.empty());
Expand Down Expand Up @@ -99,6 +100,14 @@ public Optional<String> getBoilerTempUnit() {
return this.getLog(BOILERTEMP).map(logEntry -> logEntry.getMeasurementUnit()).orElse(Optional.empty());
}

public Optional<Double> getReturnWaterTemp() {
return this.getLog(RETURNWATERTEMP).map(logEntry -> logEntry.getMeasurementAsDouble()).orElse(Optional.empty());
}

public Optional<String> getReturnWaterTempUnit() {
return this.getLog(RETURNWATERTEMP).map(logEntry -> logEntry.getMeasurementUnit()).orElse(Optional.empty());
}

public Optional<Double> getDHTSetpoint() {
return this.getLog(DHWSETPOINT).map(logEntry -> logEntry.getMeasurementAsDouble()).orElse(Optional.empty());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ private State getDefaultState(String channelID) {
case APPLIANCE_TEMPERATURE_CHANNEL:
case APPLIANCE_VALVEPOSITION_CHANNEL:
case APPLIANCE_WATERPRESSURE_CHANNEL:
case APPLIANCE_RETURNWATERTEMPERATURE_CHANNEL:
state = UnDefType.NULL;
break;
case APPLIANCE_BATTERYLEVELLOW_CHANNEL:
Expand Down Expand Up @@ -359,6 +360,14 @@ protected void refreshChannel(Appliance entity, ChannelUID channelUID) {
state = new QuantityType<Dimensionless>(entity.getOTAppFaultCode().get().intValue(), Units.PERCENT);
}
break;
case APPLIANCE_RETURNWATERTEMPERATURE_CHANNEL:
if (entity.getBoilerTemp().isPresent()) {
Unit<Temperature> unit = entity.getReturnWaterTempUnit().orElse(UNIT_CELSIUS).equals(UNIT_CELSIUS)
? SIUnits.CELSIUS
: ImperialUnits.FAHRENHEIT;
state = new QuantityType<Temperature>(entity.getReturnWaterTemp().get(), unit);
}
break;
case APPLIANCE_DHWTEMPERATURE_CHANNEL:
if (entity.getDHWTemp().isPresent()) {
Unit<Temperature> unit = entity.getDHWTempUnit().orElse(UNIT_CELSIUS).equals(UNIT_CELSIUS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ channel-type.plugwiseha.regulationControl.description = Switch the regulation co
channel-type.plugwiseha.regulationControl.state.option.active = Active
channel-type.plugwiseha.regulationControl.state.option.passive = Passive
channel-type.plugwiseha.regulationControl.state.option.off = Off
channel-type.plugwiseha.returnWaterTemperature.label = Return Water Temperature
channel-type.plugwiseha.returnWaterTemperature.description = Gets the temperature of the boiler return water
channel-type.plugwiseha.setpointTemperature.label = Setpoint Temperature
channel-type.plugwiseha.setpointTemperature.description = Gets or sets the set point of this zone
channel-type.plugwiseha.temperature.label = Zone Temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>

<channel-type id="returnWaterTemperature">
<item-type>Number:Temperature</item-type>
<label>Return Water Temperature</label>
<description>Gets the temperature of the return water</description>
<category>heating</category>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>

<channel-type id="dhwSetpoint">
<item-type>Number:Temperature</item-type>
<label>Domestic Hot Water Setpoint Temperature</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<channel id="boilerTemperature" typeId="boilerTemperature"/>
<channel id="dhwSetpoint" typeId="dhwSetpoint"/>
<channel id="maxBoilerTemperature" typeId="maxBoilerTemperature"/>
<channel id="returnWaterTemperature" typeId="returnWaterTemperature"/>
</channels>

<representation-property>id</representation-property>
Expand Down

0 comments on commit 3b81c19

Please sign in to comment.