The binding uses the following configuration parameters.
-| Parameter | Valid for ThingType | Description |
-|-----------|---------------------|----------------------------------------------------------------|
-| ipAddress | Both | IP-Address of the device |
-| password | IntesisHome | Password to login to the local webserver of IntesisHome device |
-| port | IntesisBox | TCP port to connect to IntesisBox device, defaults to 3310 |
+| Parameter | Valid for ThingType | Description |
+|------------------|---------------------|----------------------------------------------------------------|
+| ipAddress | Both | IP-Address of the device |
+| password | IntesisHome | Password to login to the local webserver of IntesisHome device |
+| port | IntesisBox | TCP port to connect to IntesisBox device, defaults to 3310 |
+| pollingInterval | Both | Interval to retrieve updates from the connected devices |
## Channels
public static final String BINDING_ID = "intesis";
public static final int INTESIS_HTTP_API_TIMEOUT_MS = 5000;
- public static final int INTESIS_REFRESH_INTERVAL_SEC = 30;
// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_INTESISHOME = new ThingTypeUID(BINDING_ID, "intesisHome");
String response = contentResponse.getContentAsString().replace("\t", "").replace("\r\n", "").trim();
- if (response != null && !response.isEmpty()) {
+ if (!response.isEmpty()) {
return response;
} else {
return null;
public class IntesisBoxConfiguration {
public String ipAddress = "";
public int port;
+ public int pollingInterval = 45;
}
public class IntesisHomeConfiguration {
public String ipAddress = "";
public String password = "";
+ public int pollingInterval = 30;
}
config = getConfigAs(IntesisBoxConfiguration.class);
if (!config.ipAddress.isEmpty()) {
-
updateStatus(ThingStatus.UNKNOWN);
scheduler.submit(() -> {
intesisLocalApi.sendId();
intesisLocalApi.sendLimitsQuery();
intesisLocalApi.sendAlive();
-
} catch (IOException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
return;
}
updateStatus(ThingStatus.ONLINE);
});
- pollingTask = scheduler.scheduleWithFixedDelay(this::polling, 3, 45, TimeUnit.SECONDS);
+ pollingTask = scheduler.scheduleWithFixedDelay(this::polling, 3, config.pollingInterval, TimeUnit.SECONDS);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "No IP address specified)");
}
break;
case "SETPTEMP":
- if (value.equals("32768")) {
+ if ("32768".equals(value)) {
value = "0";
}
updateState(CHANNEL_TYPE_TARGETTEMP,
private void handleMessage(String data) {
logger.debug("handleMessage(): Message received - {}", data);
- if (data.equals("ACK") || data.equals("")) {
+ if ("ACK".equals(data) || "".equals(data)) {
return;
}
if (data.startsWith(ID + ':')) {
case LIMITS:
logger.debug("handleMessage(): Limits received - {}", data);
String function = message.getFunction();
- if (function.equals("SETPTEMP")) {
+ if ("SETPTEMP".equals(function)) {
List<Double> limits = message.getLimitsValue().stream().map(l -> Double.valueOf(l) / 10.0d)
.collect(Collectors.toList());
if (limits.size() == 2) {
int value = 0;
String channelId = channelUID.getId();
if (command instanceof RefreshType) {
- // Refresh command is not supported as the binding polls all values every 30 seconds
+ getAllUidValues();
} else {
switch (channelId) {
case CHANNEL_TYPE_POWER:
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
}
logger.trace("Start Refresh Job");
- refreshJob = scheduler.scheduleWithFixedDelay(this::getAllUidValues, 0, INTESIS_REFRESH_INTERVAL_SEC,
+ refreshJob = scheduler.scheduleWithFixedDelay(this::getAllUidValues, 0, config.pollingInterval,
TimeUnit.SECONDS);
}
<description>@text/thing-type.config.intesisHome.password.description</description>
<context>password</context>
</parameter>
+ <parameter name="pollingInterval" type="decimal" min="30" unit="s">
+ <label>Polling Interval</label>
+ <description>
+ Defines the time in seconds to pull the
+ state of the connected devices. The minimum is 30
+ seconds.
+ </description>
+ <default>30</default>
+ </parameter>
</config-description>
</thing-type>
<description>The TCP port to the IntesisBox.</description>
<default>3310</default>
</parameter>
+ <parameter name="pollingInterval" type="decimal" min="45" unit="s">
+ <label>Polling Interval</label>
+ <description>
+ Defines the time in seconds to pull the
+ state of the connected devices. The minimum is 45
+ seconds.
+ </description>
+ <default>45</default>
+ </parameter>
</config-description>
</thing-type>