[openthermgateway] Added support for firmware version 5.0 (#10040)

* Added commands for second central heating circuit
* Added command for temperature sensor
* Added controlsetpoint2 and ch2_enable channels

Signed-off-by: Arjen Korevaar <a.korevaar@mephix.com>
This commit is contained in:
Arjen Korevaar
2021-02-05 09:06:09 +01:00
committed by GitHub
parent 9498590edb
commit f4c2769552
8 changed files with 137 additions and 40 deletions

View File

@@ -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,

View File

@@ -118,6 +118,13 @@ public class OpenThermGatewayHandler extends BaseThingHandler implements OpenThe
}
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 @@ public class OpenThermGatewayHandler extends BaseThingHandler implements OpenThe
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:

View File

@@ -40,6 +40,8 @@ public class DataItemGroup {
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 @@ public class DataItemGroup {
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") });

View File

@@ -120,6 +120,7 @@ public class GatewayCommand {
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 class GatewayCommand {
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");

View File

@@ -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";

View File

@@ -60,6 +60,30 @@
<state readOnly="false" min="0" max="100" step="0.1" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="controlsetpoint2">
<item-type>Number:Temperature</item-type>
<label>Control Setpoint 2</label>
<description>Central heating 2 water setpoint set at boiler</description>
<category>Temperature</category>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="controlsetpoint2requested">
<item-type>Number:Temperature</item-type>
<label>Control Setpoint 2 Requested</label>
<description>Central heating 2 water setpoint requested by Thermostat</description>
<category>Temperature</category>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="controlsetpoint2override">
<item-type>Number:Temperature</item-type>
<label>Control Setpoint 2 Override</label>
<description>Central heating 2 water setpoint configured on OTGW</description>
<category>Temperature</category>
<state readOnly="false" min="0" max="100" step="0.1" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="dhwtemp">
<item-type>Number:Temperature</item-type>
<label>Domestic Hot Water Temperature</label>
@@ -133,6 +157,28 @@
<item-type>Switch</item-type>
<label>Central Heating Overridden</label>
<description>Central heating enabled overridden at OTGW</description>
<state readOnly="false"/>
</channel-type>
<channel-type id="ch2_enable">
<item-type>Switch</item-type>
<label>Central Heating 2 Enabled</label>
<description>Central heating 2 enabled set at boiler</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="ch2_enablerequested">
<item-type>Switch</item-type>
<label>Central Heating 2 Enabled Thermostat</label>
<description>Central heating 2 enabled requested by thermostat</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="ch2_enableoverride">
<item-type>Switch</item-type>
<label>Central Heating 2 Overridden</label>
<description>Central heating 2 enabled overridden at OTGW</description>
<state readOnly="false"/>
</channel-type>
<channel-type id="ch_mode">

View File

@@ -14,6 +14,9 @@
<channel id="controlsetpoint" typeId="controlsetpoint"/>
<channel id="controlsetpointrequested" typeId="controlsetpointrequested"/>
<channel id="controlsetpointoverride" typeId="controlsetpointoverride"/>
<channel id="controlsetpoint2" typeId="controlsetpoint2"/>
<channel id="controlsetpoint2requested" typeId="controlsetpoint2requested"/>
<channel id="controlsetpoint2override" typeId="controlsetpoint2override"/>
<channel id="dhwtemp" typeId="dhwtemp"/>
<channel id="tdhwset" typeId="tdhwset"/>
<channel id="overridedhwsetpoint" typeId="overridedhwsetpoint"/>
@@ -24,6 +27,9 @@
<channel id="ch_enable" typeId="ch_enable"/>
<channel id="ch_enablerequested" typeId="ch_enablerequested"/>
<channel id="ch_enableoverride" typeId="ch_enableoverride"/>
<channel id="ch2_enable" typeId="ch2_enable"/>
<channel id="ch2_enablerequested" typeId="ch2_enablerequested"/>
<channel id="ch2_enableoverride" typeId="ch2_enableoverride"/>
<channel id="ch_mode" typeId="ch_mode"/>
<channel id="dhw_enable" typeId="dhw_enable"/>
<channel id="dhw_mode" typeId="dhw_mode"/>
@@ -41,7 +47,7 @@
<channel id="sendcommand" typeId="sendcommand"/>
</channels>
<properties>
<property name="version">1.1.1</property>
<property name="version">1.2.0</property>
</properties>
<config-description-ref uri="thing-type:openthermgateway:otgw"/>
</thing-type>