Skip to content

Commit

Permalink
Merge pull request #2 from openhab/master
Browse files Browse the repository at this point in the history
Merge with master
  • Loading branch information
peuter committed Jan 15, 2015
2 parents 5a94c5c + deffae8 commit 3b8980b
Show file tree
Hide file tree
Showing 21 changed files with 172 additions and 169 deletions.
61 changes: 32 additions & 29 deletions addons/binding/org.openhab.binding.max/ESH-INF/thing/bridge.xml
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="max"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd">

<bridge-type id="bridge">
<bridge-type id="bridge">
<label>MAX! Cube LAN gateway</label>
<description>This bridge represents the MAX!Cube LAN gateway.</description>
<description>This bridge represents the MAX!Cube LAN gateway.
</description>

<config-description>
<parameter name="ipAddress" type="text">
<context>network_address</context>
<parameter name="ipAddress" type="text" required="true">
<context>network-address</context>
<label>MAX! Cube LAN gateway IP</label>
<description>The IP address of the MAX! Cube LAN gateway</description>
<required>true</required>
<description>The IP address of the MAX! Cube LAN gateway
</description>
</parameter>
<parameter name="port" type="integer">
<context>port</context>
<parameter name="port" type="integer" required="false" min="1"
max="65335">
<context>network-address</context>
<label>MAX! Cube LAN gateway port</label>
<description>Port of the LAN gateway</description>
<default>62910</default>
<required>false</required>
</parameter>
<parameter name="refreshInterval" type="integer">
<parameter name="refreshInterval" type="integer" required="false">
<label>Refresh Interval</label>
<description>The refresh interval in ms which is used to poll given MAX! Cube.</description>
<description>The refresh interval in ms which is used to poll given
MAX! Cube.
</description>
<default>30000</default>
<required>false</required>
</parameter>
<parameter name="serialNumber" type="text">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
<required>true</required>
</parameter>
<parameter name="exclusive" type="boolean">
<parameter name="serialNumber" type="text" required="true">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.
</description>
</parameter>
<parameter name="exclusive" type="boolean" required="false">
<label>Exclusive Mode</label>
<description>If set to true, the binding will leave the connection to the Cube open.</description>
<description>If set to true, the binding will leave the connection
to the Cube open.
</description>
<default>false</default>
<required>false</required>
</parameter>
<parameter name="maxRequestsPerConnection" type="integer">
<parameter name="maxRequestsPerConnection" type="integer"
required="false">
<label>Max Requests per Connection</label>
<description>In exclusive mode, how many requests are allowed until connection is closed and reopened.</description>
<description>In exclusive mode, how many requests are allowed until
connection is closed and reopened.
</description>
<default>1000</default>
<required>false</required>
</parameter>

</config-description>
</bridge-type>


</bridge-type>
</thing:thing-descriptions>
161 changes: 93 additions & 68 deletions addons/binding/org.openhab.binding.max/ESH-INF/thing/thing-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">

<thing-type id="thermostat">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>

<label>MAX! HeatingThermostat</label>
<description>This is a MAX! HeatingThermostat</description>

Expand All @@ -20,20 +20,19 @@
<channel id="set_temp" typeId="set_temp" />
</channels>

<config-description>
<parameter name="serialNumber" type="text">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
<required>true</required>
</parameter>
</config-description>
<config-description>
<parameter name="serialNumber" type="text" required="true">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
</parameter>
</config-description>
</thing-type>

<thing-type id="thermostatplus">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>

<label>MAX! HeatingThermostat+</label>
<description>This is a MAX! HeatingThermostat+</description>

Expand All @@ -45,20 +44,19 @@
<channel id="set_temp" typeId="set_temp" />
</channels>

<config-description>
<parameter name="serialNumber" type="text">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
<required>true</required>
</parameter>
</config-description>
<config-description>
<parameter name="serialNumber" type="text" required="true">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
</parameter>
</config-description>
</thing-type>

<thing-type id="wallthermostat">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>

<label>MAX! WallThermostat+</label>
<description>This is a MAX! WallThermostat+</description>

Expand All @@ -70,41 +68,39 @@
<channel id="set_temp" typeId="set_temp" />
</channels>

<config-description>
<parameter name="serialNumber" type="text">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
<required>true</required>
</parameter>
</config-description>
<config-description>
<parameter name="serialNumber" type="text" required="true">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
</parameter>
</config-description>
</thing-type>

<thing-type id="ecoswitch">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>

<label>MAX! Ecoswitch</label>
<description>This is a MAX! EcoSwitch</description>

<channels>
<channel id="battery_low" typeId="battery" />
</channels>

<config-description>
<parameter name="serialNumber" type="text">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
<required>true</required>
</parameter>
</config-description>
<config-description>
<parameter name="serialNumber" type="text" required="true">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
</parameter>
</config-description>
</thing-type>

<thing-type id="shuttercontact">
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>
<supported-bridge-type-refs>
<bridge-type-ref id="bridge" />
</supported-bridge-type-refs>

<label>MAX! Shutter Contact</label>
<description>This is a MAX! Shutter Contact</description>

Expand All @@ -113,55 +109,84 @@
<channel id="battery_low" typeId="battery" />
</channels>

<config-description>
<parameter name="serialNumber" type="text">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
<required>true</required>
</parameter>
</config-description>
<config-description>
<parameter name="serialNumber" type="text" required="true">
<label>Serial Number</label>
<description>The Serial Number identifies one specific device.</description>
</parameter>
</config-description>
</thing-type>
<channel-type id="valve">

<channel-type id="valve" advanced="true">
<item-type>Number</item-type>
<label>Valve Position</label>
<description>Thermostat Valve Position</description>
<category>Flow</category>
<state pattern="%d %" readOnly="true">
</state>
</channel-type>

<channel-type id="battery">
<item-type>Switch</item-type>
<label>Battery Level Low</label>
<description>Battery charge Level</description>
<category>Battery</category>
</channel-type>
<channel-type id="mode">

<channel-type id="mode">
<item-type>String</item-type>
<label>Mode</label>
<description>Thermostat Mode Setting</description>
<tags>
<tag>heating</tag>
</tags>
<state readOnly="false">
<options>
<option value="AUTOMATIC">AUTOMATIC</option>
<option value="MANUAL">MANUAL</option>
<option value="BOOST">BOOST</option>
<option value="VACATION">VACATION</option>
</options>
</state>
</channel-type>
<channel-type id="actual_temp">
<item-type>Number</item-type>

<channel-type id="actual_temp">
<item-type>Number</item-type>
<label>Actual Temperature</label>
<description>Actual measured room temperature</description>
<category>Temperature</category>
<tags>
<tag>heating</tag>
</tags>
<state pattern="%d °C" readOnly="true">
</state>

</channel-type>
<channel-type id="set_temp">
<item-type>Number</item-type>

<channel-type id="set_temp">
<item-type>Number</item-type>
<label>Set Temperature</label>
<description>Thermostat temperature setpoint</description>
<category>Temperature</category>
<tags>
<tag>heating</tag>
</tags>
<state min="4.5" max="30" step="0.5" pattern="%d °C" readOnly="false">
</state>
</channel-type>

<channel-type id="contact_state">
<channel-type id="contact_state">
<item-type>Contact</item-type>
<label>Contact State</label>
<description>Contact state information</description>
<category>Contact</category>
</channel-type>
<channel-type id="eco_mode">

<channel-type id="eco_mode">
<item-type>Switch</item-type>
<label>Eco Mode</label>
<description>Eco Mode Activated</description>
<category>Switch</category>
</channel-type>

</thing:thing-descriptions>
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@ public static String getStackTrace(Exception e) {
e.printStackTrace(printWriter);
return stringWriter.toString();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ private void sendDiscoveryMessage(String discoverString) {

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ protected ThingHandler createHandler(Thing thing) {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -586,15 +586,15 @@ public void executeCommand(SendCommand sendCommand) {
String commandContent = command.toString().trim().toUpperCase();
S_Command cmd = null;
ThermostatModeType commandThermoType = null;
Double setTemp = Double.parseDouble(device.getTemperatureSetpoint().toString());
if (commandContent.contentEquals(ThermostatModeType.AUTOMATIC.toString())) {
commandThermoType = ThermostatModeType.AUTOMATIC;
cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType);
cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, 0D);
} else if (commandContent.contentEquals(ThermostatModeType.BOOST.toString())) {
commandThermoType = ThermostatModeType.BOOST;
cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType);
cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, setTemp);
} else if (commandContent.contentEquals(ThermostatModeType.MANUAL.toString())) {
commandThermoType = ThermostatModeType.MANUAL;
Double setTemp = Double.parseDouble(device.getTemperatureSetpoint().toString());
cmd = new S_Command(rfAddress, device.getRoomId(), commandThermoType, setTemp);
logger.debug("updates to MANUAL mode with temperature '{}'", setTemp);
} else {
Expand Down Expand Up @@ -657,4 +657,4 @@ private void socketClose() {
socket = null;
}

}
}
Loading

0 comments on commit 3b8980b

Please sign in to comment.