Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openthermgateway] Added support for firmware version 5.0 #10040

Merged
merged 5 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 47 additions & 36 deletions bundles/org.openhab.binding.openthermgateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,47 @@ The configuration settings for the thing are Hostname/IP address and Port, which

The OpenTherm Gateway binding supports the following channels:

| Channel Type ID | Item Type | Description | Read Only |
|--------------------------|----------------------|----------------------------------------------------------|-----------|
| roomtemp | Number:Temperature | Current sensed room temperature | yes |
| roomsetpoint | Number:Temperature | Current room temperature setpoint | yes |
| temperaturetemporary | Number:Temperature | Temporary override room temperature setpoint | no |
| temperatureconstant | Number:Temperature | Constant override room temperature setpoint | no |
| controlsetpoint | Number:Temperature | Central heating water setpoint set at boiler | yes |
| controlsetpointrequested | Number:Temperature | Central heating water setpoint requested by thermostat | yes |
| controlsetpointoverride | Number:Temperature | Central heating water setpoint configured at gateway | no |
| dhwtemp | Number:Temperature | Domestic hot water temperature | yes |
| tdhwset | Number:Temperature | Domestic hot water temperature setpoint | yes |
| overridedhwsetpoint | Number:Temperature | Domestic hot water temperature setpoint override | no |
| flowtemp | Number:Temperature | Boiler water temperature | yes |
| returntemp | Number:Temperature | Return water temperature | yes |
| outsidetemp | Number:Temperature | Outside temperature | no |
| waterpressure | Number:Pressure | Central heating water pressure | yes |
| ch_enable | Switch | Central heating enabled set at boiler | yes |
| ch_enablerequested | Switch | Central heating enabled requested by thermostat | yes |
| ch_enableoverride | Switch | Central heating enabled overridden at gateway | yes |
| ch_mode | Switch | Central heating active | yes |
| dhw_enable | Switch | Domestic hot water enabled | yes |
| dhw_mode | Switch | Domestic hot water active | yes |
| flame | Switch | Burner active | yes |
| modulevel | Number:Dimensionless | Relative modulation level | yes |
| maxrelmdulevel | Number:Dimensionless | Maximum relative modulation level | yes |
| fault | Switch | Fault indication | yes |
| servicerequest | Switch | Service required | yes |
| lockout-reset | Switch | Lockout-reset enabled | yes |
| lowwaterpress | Switch | Low water pressure fault | yes |
| gasflamefault | Switch | Gas or flame fault | yes |
| airpressfault | Switch | Air pressure fault | yes |
| waterovtemp | Switch | Water over-temperature fault | yes |
| oemfaultcode | Switch | OEM fault code | yes |
| diag | Switch | Diagnostics indication | yes |
| sendcommand | Text | Channel to send commands to the OpenTherm Gateway device | no |
| Channel Type ID | Item Type | Description | Access |
|---------------------------|----------------------|----------------------------------------------------------|--------|
| roomtemp | Number:Temperature | Current sensed room temperature | R |
| roomsetpoint | Number:Temperature | Current room temperature setpoint | R |
| temperaturetemporary | Number:Temperature | Temporary override room temperature setpoint | R/W |
| temperatureconstant | Number:Temperature | Constant override room temperature setpoint | R/W |
| controlsetpoint | Number:Temperature | Central heating water setpoint set at boiler | R |
| controlsetpointrequested | Number:Temperature | Central heating water setpoint requested by thermostat | R |
| controlsetpointoverride | Number:Temperature | Central heating water setpoint configured at gateway | R/W |
| controlsetpoint2 | Number:Temperature | Central heating 2 water setpoint set at boiler | R |
| controlsetpoint2requested | Number:Temperature | Central heating 2 water setpoint requested by thermostat | R |
| controlsetpoint2override | Number:Temperature | Central heating 2 water setpoint configured at gateway | R/W |
| dhwtemp | Number:Temperature | Domestic hot water temperature | R |
| tdhwset | Number:Temperature | Domestic hot water temperature setpoint | R |
| overridedhwsetpoint | Number:Temperature | Domestic hot water temperature setpoint override | R/W |
| flowtemp | Number:Temperature | Boiler water temperature | R |
| returntemp | Number:Temperature | Return water temperature | R |
| outsidetemp | Number:Temperature | Outside temperature | R/W |
| waterpressure | Number:Pressure | Central heating water pressure | R |
| ch_enable | Switch | Central heating enabled set at boiler | R |
| ch_enablerequested | Switch | Central heating enabled requested by thermostat | R |
| ch_enableoverride | Switch | Central heating enabled overridden at gateway | R |
| ch2_enable | Switch | Central heating 2 enabled set at boiler | R |
| ch2_enablerequested | Switch | Central heating 2 enabled requested by thermostat | R |
| ch2_enableoverride | Switch | Central heating 2 enabled overridden at gateway | R |
| ch_mode | Switch | Central heating active | R |
| dhw_enable | Switch | Domestic hot water enabled | R |
| dhw_mode | Switch | Domestic hot water active | R |
| flame | Switch | Burner active | R |
| modulevel | Number:Dimensionless | Relative modulation level | R |
| maxrelmdulevel | Number:Dimensionless | Maximum relative modulation level | R |
| fault | Switch | Fault indication | R |
| servicerequest | Switch | Service required | R |
| lockout-reset | Switch | Lockout-reset enabled | R |
| lowwaterpress | Switch | Low water pressure fault | R |
| gasflamefault | Switch | Gas or flame fault | R |
| airpressfault | Switch | Air pressure fault | R |
| waterovtemp | Switch | Water over-temperature fault | R |
| oemfaultcode | Switch | OEM fault code | R |
| diag | Switch | Diagr / wstics indication | R |
| sendcommand | Text | Channel to send commands to the OpenTherm Gateway device | W |

## Full Example

Expand All @@ -86,6 +92,9 @@ Number:Temperature ConstantRoomSetpointOverride "Constant room setpoint override
Number:Temperature ControlSetpoint "Control setpoint [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:controlsetpoint" }
Number:Temperature ControlSetpointRequested "Control setpoint requested [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:controlsetpointrequested" }
Number:Temperature ControlSetpointOverride "Control setpoint override [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:controlsetpointoverride" }
Number:Temperature ControlSetpoint2 "Control setpoint 2 [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:controlsetpoint2" }
Number:Temperature ControlSetpoint2Requested "Control setpoint 2 requested [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:controlsetpoint2requested" }
Number:Temperature ControlSetpoint2Override "Control setpoint 2 override [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:controlsetpoint2override" }
Number:Temperature DomesticHotWaterTemperature "Domestic hot water temperature [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:dhwtemp" }
Number:Temperature DomesticHotWaterSetpoint "Domestic hot water setpoint [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:tdhwset" }
Number:Temperature DomesticHotWaterSetpointOverride "Domestic hot water setpoint override [%.1f °C]" <temperature> { channel="openthermgateway:otgw:1:overridedhwsetpoint" }
Expand All @@ -96,6 +105,9 @@ Number:Pressure CentralHeatingWaterPressure "Central heating water pressure [%.1
Switch CentralHeatingEnabled "Central heating enabled" <switch> { channel="openthermgateway:otgw:1:ch_enable" }
Switch CentralHeatingEnabledRequested "Central heating enabled requested" <switch> { channel="openthermgateway:otgw:1:ch_enablerequested" }
Switch CentralHeatingEnabledOverride "Central heating enabled override" <switch> { channel="openthermgateway:otgw:1:ch_enableoverride" }
Switch CentralHeating2Enabled "Central heating 2 enabled" <switch> { channel="openthermgateway:otgw:1:ch2_enable" }
Switch CentralHeating2EnabledRequested "Central 2 heating enabled requested" <switch> { channel="openthermgateway:otgw:1:ch2_enablerequested" }
Switch CentralHeating2EnabledOverride "Central 2 heating enabled override" <switch> { channel="openthermgateway:otgw:1:ch2_enableoverride" }
Switch CentralHeatingActive "Central heating active" <switch> { channel="openthermgateway:otgw:1:ch_mode" }
Switch DomesticHotWaterEnabled "Domestic hot water enabled" <switch> { channel="openthermgateway:otgw:1:dhw_enable" }
Switch DomesticHotWaterActive "Domestic hot water active" <switch> { channel="openthermgateway:otgw:1:dhw_mode" }
Expand Down Expand Up @@ -153,5 +165,4 @@ sitemap demo label="Main Menu" {
Switch item="Diagnostics" icon="" label="Diagnostics indication"
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ public class OpenThermGatewayBindingConstants {
public static final String CHANNEL_CENTRAL_HEATING_WATER_SETPOINT = "controlsetpoint";
public static final String CHANNEL_REQUESTED_CENTRAL_HEATING_WATER_SETPOINT = "controlsetpointrequested";
public static final String CHANNEL_OVERRIDE_CENTRAL_HEATING_WATER_SETPOINT = "controlsetpointoverride";
public static final String CHANNEL_CENTRAL_HEATING2_WATER_SETPOINT = "controlsetpoint2";
public static final String CHANNEL_REQUESTED_CENTRAL_HEATING2_WATER_SETPOINT = "controlsetpoint2requested";
public static final String CHANNEL_OVERRIDE_CENTRAL_HEATING2_WATER_SETPOINT = "controlsetpoint2override";
public static final String CHANNEL_CENTRAL_HEATING_WATER_PRESSURE = "waterpressure";
public static final String CHANNEL_CENTRAL_HEATING_ENABLED = "ch_enable";
public static final String CHANNEL_REQUESTED_CENTRAL_HEATING_ENABLED = "ch_enablerequested";
public static final String CHANNEL_OVERRIDE_CENTRAL_HEATING_ENABLED = "ch_enableoverride";
public static final String CHANNEL_CENTRAL_HEATING2_ENABLED = "ch2_enable";
public static final String CHANNEL_REQUESTED_CENTRAL_HEATING2_ENABLED = "ch2_enablerequested";
public static final String CHANNEL_OVERRIDE_CENTRAL_HEATING2_ENABLED = "ch2_enableoverride";
public static final String CHANNEL_CENTRAL_HEATING_MODE = "ch_mode";
public static final String CHANNEL_DOMESTIC_HOT_WATER_TEMPERATURE = "dhwtemp";
public static final String CHANNEL_DOMESTIC_HOT_WATER_ENABLED = "dhw_enable";
Expand All @@ -71,8 +77,11 @@ public class OpenThermGatewayBindingConstants {
CHANNEL_FLOW_TEMPERATURE, CHANNEL_RETURN_TEMPERATURE, CHANNEL_OUTSIDE_TEMPERATURE,
CHANNEL_CENTRAL_HEATING_WATER_PRESSURE, CHANNEL_CENTRAL_HEATING_ENABLED,
CHANNEL_REQUESTED_CENTRAL_HEATING_ENABLED, CHANNEL_OVERRIDE_CENTRAL_HEATING_ENABLED,
CHANNEL_CENTRAL_HEATING_MODE, CHANNEL_CENTRAL_HEATING_WATER_SETPOINT,
CHANNEL_REQUESTED_CENTRAL_HEATING_WATER_SETPOINT, CHANNEL_OVERRIDE_CENTRAL_HEATING_WATER_SETPOINT,
CHANNEL_CENTRAL_HEATING2_ENABLED, CHANNEL_REQUESTED_CENTRAL_HEATING2_ENABLED,
CHANNEL_OVERRIDE_CENTRAL_HEATING2_ENABLED, CHANNEL_CENTRAL_HEATING_MODE,
CHANNEL_CENTRAL_HEATING_WATER_SETPOINT, CHANNEL_REQUESTED_CENTRAL_HEATING_WATER_SETPOINT,
CHANNEL_OVERRIDE_CENTRAL_HEATING_WATER_SETPOINT, CHANNEL_CENTRAL_HEATING2_WATER_SETPOINT,
CHANNEL_REQUESTED_CENTRAL_HEATING2_WATER_SETPOINT, CHANNEL_OVERRIDE_CENTRAL_HEATING2_WATER_SETPOINT,
CHANNEL_DOMESTIC_HOT_WATER_TEMPERATURE, CHANNEL_DOMESTIC_HOT_WATER_ENABLED, CHANNEL_DOMESTIC_HOT_WATER_MODE,
CHANNEL_DOMESTIC_HOT_WATER_SETPOINT, CHANNEL_FLAME, CHANNEL_RELATIVE_MODULATION_LEVEL,
CHANNEL_MAXIMUM_MODULATION_LEVEL, CHANNEL_FAULT, CHANNEL_SERVICEREQUEST, CHANNEL_REMOTE_RESET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ public void handleCommand(ChannelUID channelUID, Command command) {
}
updateState(OpenThermGatewayBindingConstants.CHANNEL_OVERRIDE_CENTRAL_HEATING_ENABLED,
OnOffType.from(!gatewayCommand.getMessage().equals("0.0")));
} else if (code == GatewayCommandCode.ControlSetpoint2) {
if (gatewayCommand.getMessage().equals("0.0")) {
updateState(OpenThermGatewayBindingConstants.CHANNEL_OVERRIDE_CENTRAL_HEATING2_WATER_SETPOINT,
UnDefType.UNDEF);
}
updateState(OpenThermGatewayBindingConstants.CHANNEL_OVERRIDE_CENTRAL_HEATING2_ENABLED,
OnOffType.from(!gatewayCommand.getMessage().equals("0.0")));
}
} else {
connect();
Expand Down Expand Up @@ -274,6 +281,10 @@ private void disconnect() {
return GatewayCommandCode.ControlSetpoint;
case OpenThermGatewayBindingConstants.CHANNEL_OVERRIDE_CENTRAL_HEATING_ENABLED:
return GatewayCommandCode.CentralHeating;
case OpenThermGatewayBindingConstants.CHANNEL_OVERRIDE_CENTRAL_HEATING2_WATER_SETPOINT:
return GatewayCommandCode.ControlSetpoint2;
case OpenThermGatewayBindingConstants.CHANNEL_OVERRIDE_CENTRAL_HEATING2_ENABLED:
return GatewayCommandCode.CentralHeating2;
case OpenThermGatewayBindingConstants.CHANNEL_SEND_COMMAND:
return null;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ private static Map<Integer, DataItem[]> createDataItemGroups() {
new DataItem(0, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 2, "cooling_enabled", CodeType.B),
new DataItem(0, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 3, "otc_active", CodeType.B),
new DataItem(0, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 4, "ch2_enable", CodeType.B),
new DataItem(0, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 4, "ch2_enablerequested", CodeType.T),
new DataItem(0, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 4, "ch2_enableoverride", CodeType.R),
new DataItem(0, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 5, "0x00:5", CodeType.B),
new DataItem(0, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 6, "0x00:6", CodeType.B),
new DataItem(0, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 7, "0x00:7", CodeType.B),
Expand Down Expand Up @@ -104,7 +106,13 @@ private static Map<Integer, DataItem[]> createDataItemGroups() {
new DataItem(6, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 6, "0x06:h6"),
new DataItem(6, Msg.READ, ByteType.HIGHBYTE, DataType.FLAGS, 7, "0x06:h7") });
g.put(7, new DataItem[] { new DataItem(7, Msg.WRITE, ByteType.BOTH, DataType.FLOAT, 0, "0x07") });
g.put(8, new DataItem[] { new DataItem(8, Msg.WRITE, ByteType.BOTH, DataType.FLOAT, 0, "controlsetpoint2") });
g.put(8, new DataItem[] {
new DataItem(8, Msg.WRITE, ByteType.BOTH, DataType.FLOAT, 0, "controlsetpoint2", SIUnits.CELSIUS,
CodeType.B),
new DataItem(8, Msg.WRITE, ByteType.BOTH, DataType.FLOAT, 0, "controlsetpoint2requested",
SIUnits.CELSIUS, CodeType.T),
new DataItem(8, Msg.WRITE, ByteType.BOTH, DataType.FLOAT, 0, "controlsetpoint2override",
SIUnits.CELSIUS, CodeType.R) });
g.put(9, new DataItem[] { new DataItem(9, Msg.READ, ByteType.BOTH, DataType.FLOAT, 0, "overridesetpoint") });
g.put(10, new DataItem[] { new DataItem(10, Msg.WRITE, ByteType.HIGHBYTE, DataType.UINT8, 0, "0x0a:h"),
new DataItem(10, Msg.WRITE, ByteType.LOWBYTE, DataType.UINT8, 0, "0x0a:l") });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public static GatewayCommand parse(@Nullable String code, String message) throws
c.put(GatewayCommandCode.GpioA, "0,1,2,3,4,5,6,7");
c.put(GatewayCommandCode.GpioB, "0,1,2,3,4,5,6,7");
c.put(GatewayCommandCode.SetBack, null);
c.put(GatewayCommandCode.TemperatureSensor, "O,R");
c.put(GatewayCommandCode.AddAlternative, null);
c.put(GatewayCommandCode.DeleteAlternative, null);
c.put(GatewayCommandCode.UnknownID, null);
Expand All @@ -131,7 +132,9 @@ public static GatewayCommand parse(@Nullable String code, String message) throws
c.put(GatewayCommandCode.SetpointWater, null);
c.put(GatewayCommandCode.MaximumModulation, null);
c.put(GatewayCommandCode.ControlSetpoint, null);
c.put(GatewayCommandCode.ControlSetpoint2, null);
c.put(GatewayCommandCode.CentralHeating, "0,1");
c.put(GatewayCommandCode.CentralHeating2, "0,1");
c.put(GatewayCommandCode.VentilationSetpoint, null);
c.put(GatewayCommandCode.Reset, null);
c.put(GatewayCommandCode.IgnoreTransition, "0,1");
Expand Down
Loading