diff --git a/bundles/org.openhab.binding.openthermgateway/README.md b/bundles/org.openhab.binding.openthermgateway/README.md index 17bc52fe2eb71..3d829137c0bd8 100644 --- a/bundles/org.openhab.binding.openthermgateway/README.md +++ b/bundles/org.openhab.binding.openthermgateway/README.md @@ -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 @@ -86,6 +92,9 @@ Number:Temperature ConstantRoomSetpointOverride "Constant room setpoint override Number:Temperature ControlSetpoint "Control setpoint [%.1f °C]" { channel="openthermgateway:otgw:1:controlsetpoint" } Number:Temperature ControlSetpointRequested "Control setpoint requested [%.1f °C]" { channel="openthermgateway:otgw:1:controlsetpointrequested" } Number:Temperature ControlSetpointOverride "Control setpoint override [%.1f °C]" { channel="openthermgateway:otgw:1:controlsetpointoverride" } +Number:Temperature ControlSetpoint2 "Control setpoint 2 [%.1f °C]" { channel="openthermgateway:otgw:1:controlsetpoint2" } +Number:Temperature ControlSetpoint2Requested "Control setpoint 2 requested [%.1f °C]" { channel="openthermgateway:otgw:1:controlsetpoint2requested" } +Number:Temperature ControlSetpoint2Override "Control setpoint 2 override [%.1f °C]" { channel="openthermgateway:otgw:1:controlsetpoint2override" } Number:Temperature DomesticHotWaterTemperature "Domestic hot water temperature [%.1f °C]" { channel="openthermgateway:otgw:1:dhwtemp" } Number:Temperature DomesticHotWaterSetpoint "Domestic hot water setpoint [%.1f °C]" { channel="openthermgateway:otgw:1:tdhwset" } Number:Temperature DomesticHotWaterSetpointOverride "Domestic hot water setpoint override [%.1f °C]" { channel="openthermgateway:otgw:1:overridedhwsetpoint" } @@ -96,6 +105,9 @@ Number:Pressure CentralHeatingWaterPressure "Central heating water pressure [%.1 Switch CentralHeatingEnabled "Central heating enabled" { channel="openthermgateway:otgw:1:ch_enable" } Switch CentralHeatingEnabledRequested "Central heating enabled requested" { channel="openthermgateway:otgw:1:ch_enablerequested" } Switch CentralHeatingEnabledOverride "Central heating enabled override" { channel="openthermgateway:otgw:1:ch_enableoverride" } +Switch CentralHeating2Enabled "Central heating 2 enabled" { channel="openthermgateway:otgw:1:ch2_enable" } +Switch CentralHeating2EnabledRequested "Central 2 heating enabled requested" { channel="openthermgateway:otgw:1:ch2_enablerequested" } +Switch CentralHeating2EnabledOverride "Central 2 heating enabled override" { channel="openthermgateway:otgw:1:ch2_enableoverride" } Switch CentralHeatingActive "Central heating active" { channel="openthermgateway:otgw:1:ch_mode" } Switch DomesticHotWaterEnabled "Domestic hot water enabled" { channel="openthermgateway:otgw:1:dhw_enable" } Switch DomesticHotWaterActive "Domestic hot water active" { channel="openthermgateway:otgw:1:dhw_mode" } @@ -153,5 +165,4 @@ sitemap demo label="Main Menu" { Switch item="Diagnostics" icon="" label="Diagnostics indication" } } - ``` diff --git a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/OpenThermGatewayBindingConstants.java b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/OpenThermGatewayBindingConstants.java index e3396e76590e3..1ed28ae4d4695 100644 --- a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/OpenThermGatewayBindingConstants.java +++ b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/OpenThermGatewayBindingConstants.java @@ -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"; @@ -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, diff --git a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/handler/OpenThermGatewayHandler.java b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/handler/OpenThermGatewayHandler.java index 14bd284742d2d..b515d2fbf34cf 100644 --- a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/handler/OpenThermGatewayHandler.java +++ b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/handler/OpenThermGatewayHandler.java @@ -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(); @@ -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: diff --git a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/DataItemGroup.java b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/DataItemGroup.java index 61e0c688d0a8d..8932d63864aa9 100644 --- a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/DataItemGroup.java +++ b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/DataItemGroup.java @@ -40,6 +40,8 @@ private static Map 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), @@ -104,7 +106,13 @@ private static Map 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") }); diff --git a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/GatewayCommand.java b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/GatewayCommand.java index 9c8427804c9ae..5187625f1f810 100644 --- a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/GatewayCommand.java +++ b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/GatewayCommand.java @@ -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); @@ -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"); diff --git a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/GatewayCommandCode.java b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/GatewayCommandCode.java index 4e3d5ab8fb481..2f5ac1facf716 100644 --- a/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/GatewayCommandCode.java +++ b/bundles/org.openhab.binding.openthermgateway/src/main/java/org/openhab/binding/openthermgateway/internal/GatewayCommandCode.java @@ -38,6 +38,7 @@ public class GatewayCommandCode { public static final String GpioA = "GA"; public static final String GpioB = "GB"; public static final String SetBack = "SB"; + public static final String TemperatureSensor = "TS"; public static final String AddAlternative = "AA"; public static final String DeleteAlternative = "DA"; public static final String UnknownID = "UI"; @@ -49,7 +50,9 @@ public class GatewayCommandCode { public static final String SetpointWater = "SW"; public static final String MaximumModulation = "MM"; public static final String ControlSetpoint = "CS"; + public static final String ControlSetpoint2 = "C2"; public static final String CentralHeating = "CH"; + public static final String CentralHeating2 = "H2"; public static final String VentilationSetpoint = "VS"; public static final String Reset = "RS"; public static final String IgnoreTransition = "IT"; diff --git a/bundles/org.openhab.binding.openthermgateway/src/main/resources/OH-INF/thing/channels.xml b/bundles/org.openhab.binding.openthermgateway/src/main/resources/OH-INF/thing/channels.xml index 8bf158cff5860..43a9182ac4d89 100644 --- a/bundles/org.openhab.binding.openthermgateway/src/main/resources/OH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.openthermgateway/src/main/resources/OH-INF/thing/channels.xml @@ -60,6 +60,30 @@ + + Number:Temperature + + Central heating 2 water setpoint set at boiler + Temperature + + + + + Number:Temperature + + Central heating 2 water setpoint requested by Thermostat + Temperature + + + + + Number:Temperature + + Central heating 2 water setpoint configured on OTGW + Temperature + + + Number:Temperature @@ -133,6 +157,28 @@ Switch Central heating enabled overridden at OTGW + + + + + Switch + + Central heating 2 enabled set at boiler + + + + + Switch + + Central heating 2 enabled requested by thermostat + + + + + Switch + + Central heating 2 enabled overridden at OTGW + diff --git a/bundles/org.openhab.binding.openthermgateway/src/main/resources/OH-INF/thing/otgw.xml b/bundles/org.openhab.binding.openthermgateway/src/main/resources/OH-INF/thing/otgw.xml index 32ad1a0a50364..6d29d1981c154 100644 --- a/bundles/org.openhab.binding.openthermgateway/src/main/resources/OH-INF/thing/otgw.xml +++ b/bundles/org.openhab.binding.openthermgateway/src/main/resources/OH-INF/thing/otgw.xml @@ -14,6 +14,9 @@ + + + @@ -24,6 +27,9 @@ + + + @@ -41,7 +47,7 @@ - 1.1.1 + 1.2.0