[haywardomnilogic] Added support ColorLogic V2 Lights, Updated Chlor Enable, Alert, Error, Status (#15478)

* Update polling times based on Hayward API recommendations

---------

Signed-off-by: Matt Myers <mmyers75@icloud.com>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Matt 2024-05-09 04:08:38 -04:00 committed by Ciprian Pascu
parent 7b20bf9a23
commit 6937885b8d
26 changed files with 988 additions and 777 deletions

View File

@ -34,8 +34,8 @@ Hayward OmniLogic Connection Parameters:
| Host Name | <https://app1.haywardomnilogic.com/HAAPI/HomeAutomation/API.ash> | Yes | Host name of the Hayward API server |
| User Name | None | Yes | Your Hayward User Name (not email address) |
| Password | None | Yes | Your Hayward User Password |
| Telemetry Poll Delay | 12 | Yes | Telemetry Poll Delay (10-60 seconds) |
| Alarm Poll Delay | 60 | Yes | Alarm Poll Delay (0-120 seconds, 0 disabled) |
| Telemetry Poll Delay | 3 | Yes | Telemetry Poll Delay (2-60 seconds) |
| Alarm Poll Delay | 10 | Yes | Alarm Poll Delay (0-120 seconds, 0 disabled) |
## Channels
@ -65,14 +65,53 @@ Hayward OmniLogic Connection Parameters:
|-----------------------|----------------------|----------------------------------------------------------|:----------:|
| chlorEnable | Switch | Chlorinator enable | R/W |
| chlorOperatingMode | String | Chlorinator operating mode | R |
| chlorTimedPercent | Number:Dimensionless | Chlorinator timed percent | R/W |
| chlorTimedPercent | Number:Dimensionless | Chlorinator salt output (%) | R/W |
| chlorOperatingState | Number | Chlorinator operating state | R |
| chlorScMode | String | Chlorinator super chlorinate mode | R |
| chlorError | Number | Chlorinator error | R |
| chlorAlert | String | Chlorinator alert | R |
| chlorError | String | Chlorinator error bit array | R |
| chlorAlert | String | Chlorinator alert bit array | R |
| chlorAvgSaltLevel | Number:Dimensionless | Chlorinator average salt level in Part per Million (ppm) | R |
| chlorInstantSaltLevel | Number:Dimensionless | Chlorinator instant salt level in Part per Million (ppm) | R |
| chlorStatus | Number | Chlorinator K1/K2 relay status | R |
| chlorStatus | String | Chlorinator status bit array | R |
### Chlorinator Error Bit Array
|Bits |Value |Description |
|------|--------------------------------------------------------------------|-------------------------------|
|1:0 |00 = OK<br> 01 = Short<br> 10 = Open |Current Sensor |
|3:2 |00 = OK<br> 01 = Short<br> 10 = Open |Voltage Sensor |
|5:4 |00 = OK<br> 01 = Short<br> 10 = Open |Cell Temp Sensor |
|7:6 |00 = OK<br> 01 = Short<br> 10 = Open |Board Temp Sensor |
|9:8 |00 = OK<br> 01 = Short<br> 10 = Open |K1 Relay |
|11:10 |00 = OK<br> 01 = Short<br> 10 = Open |K2 Relay |
|13:12 |00 = OK<br> 01 = Type<br> 10 = Authentication <br> 11 = Comm Loss |Cell Errors |
|14 |0 |Aquarite PCB Error |
### Chlorinator Alert Bit Array
|Bits |Value |Description |
|------|--------------------------------------------------------------------|-------------------------------|
|1:0 |00 = OK<br> 01 = Salt Low<br> 10 = Salt too Low |Low salt |
|2 |0 = OK<br> 1 = High |High Current |
|3 |0 = OK<br> 1 = Low |Low Voltage |
|5:4 |00 = OK<br> 01 = Low<br> 10 = Scaleback<br> 11 = High |Cell Water Temp |
|7:6 |00 = OK<br> 01 = High<br> 10 = Clearing |Board Temp |
|8 |0 |Not Used |
|10:9 |0 |Not Used |
|12:11 |00 = OK<br> 01 = Clean |Cell Cleaning/Runtime |
### Chlorinator Status Bit Array
|Bits |Value |Description |
|------|----------------------------------------------------------------|-------------------------------|
|0 |0 = OK<br>1 = Error Present |Error Present |
|1 |0 = OK<br>1 = Alert Present |Alert Present |
|2 |0 = Standy<br>1 = Generating |Generating |
|3 |0 = Not Paused<br>1 = Paused<br> |Paused |
|4 |0 = Local Not Paused<br>1 = Local Paused<br> |Local Pause |
|5 |0 = Not Authenticated<><BR>1 = Authenticated |T-Cell Authenticated |
|6 |0 = K1 Relay Off<br> 1 = K1 Relay On |K1 Relay Active |
|7 |0 = K2 Relay Off<br> 1 = K2 Relay On |K2 Relay Active |
### Colorlogic Light Channels
@ -88,11 +127,11 @@ Hayward OmniLogic Connection Parameters:
|---------------------|----------------------|------------------------|:----------:|
| filterEnable | Switch | Filter enable | R/W |
| filterValvePosition | String | Filter valve position | R |
| filterSpeedPercent | Number:Dimensionless | Filter speed in % | R/W |
| filterSpeedRpm | Number | Filter speed in RPM | R/W |
| filterSpeedPercent | Number:Dimensionless | Filter speed (%) | R/W |
| filterSpeedRpm | Number:Frequency | Filter speed (rpm) | R/W |
| filterSpeedSelect | String | Filter speed presets | R/W |
| filterState | String | Filter state | R |
| filterLastSpeed | Number:Dimensionless | Filter last speed in % | R |
| filterLastSpeed | Number:Dimensionless | Filter last speed (%) | R |
### Heater Channels
@ -106,11 +145,11 @@ Hayward OmniLogic Connection Parameters:
| Channel Type ID | Item Type | Description | Read Write |
|------------------|----------------------|----------------------|:----------:|
| pumpEnable | Switch | Pump enable | R/W |
| pumpSpeedPercent | Number:Dimensionless | Pump speed in % | R/W |
| pumpSpeedRpm | Number | Pump speed in RPM | R/W |
| pumpSpeedPercent | Number:Dimensionless | Pump speed (%) | R/W |
| pumpSpeedRpm | Number: Frequency | Pump speed in rpm | R/W |
| pumpSpeedSelect | String | Pump speed presets | R/W |
| pumpState | String | Pump state | R |
| pumpLastSpeed | Number:Dimensionless | Pump last speed in % | R |
| pumpLastSpeed | Number:Dimensionless | Pump last speed (%) | R |
### Relay Channels
@ -125,6 +164,8 @@ Hayward OmniLogic Connection Parameters:
| heaterEnable | Switch | Heater enable | R |
| heaterCurrentSetpoint | Number:Temperature | Heater Current Setpoint | R/W |
**Item Types Number:Dimensionless should have the units (i.e. %, ppm) defined in the Unit metadata
## Full Example
After installing the binding, you will need to manually add the Hayward Connection thing and enter your credentials.

View File

@ -26,7 +26,7 @@ import org.openhab.core.thing.ThingTypeUID;
@NonNullByDefault
public class HaywardBindingConstants {
private static final String BINDING_ID = "haywardomnilogic";
public static final String BINDING_ID = "haywardomnilogic";
// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_BACKYARD = new ThingTypeUID(BINDING_ID, "backyard");
@ -87,8 +87,13 @@ public class HaywardBindingConstants {
// List of all Channel ids (colorlogic)
public static final String CHANNEL_COLORLOGIC_ENABLE = "colorLogicLightEnable";
public static final String CHANNEL_COLORLOGIC_LIGHTSTATE = "colorLogicLightState";
public static final String CHANNEL_COLORLOGIC_STATE = "colorLogicLightState";
public static final String CHANNEL_COLORLOGIC_CURRENTSHOW = "colorLogicLightCurrentShow";
public static final String CHANNEL_COLORLOGIC_BRIGHTNESS = "colorLogicLightBrightness";
public static final String CHANNEL_COLORLOGIC_SPEED = "colorLogicLightSpeed";
public static final String TYPE_COLORLOGIC_LIGHTBRIGHTNESS = "lightBrightness";
public static final String TYPE_COLORLOGIC_LIGHTSPEED = "lightSpeed";
public static final String PROPERTY_COLORLOGIC_TYPE = "colorlogicType";

View File

@ -104,7 +104,6 @@ public class HaywardHandlerFactory extends BaseThingHandlerFactory {
}
if (thingTypeUID.equals(HaywardBindingConstants.THING_TYPE_RELAY)) {
return new HaywardRelayHandler(thing);
}
if (thingTypeUID.equals(HaywardBindingConstants.THING_TYPE_VIRTUALHEATER)) {
return new HaywardVirtualHeaterHandler(thing);

View File

@ -79,14 +79,19 @@ public abstract class HaywardThingHandler extends BaseThingHandler {
return new QuantityType<>(Integer.parseInt(value), Units.PERCENT);
case HaywardBindingConstants.CHANNEL_FILTER_SPEEDPERCENT:
return new QuantityType<>(Integer.parseInt(value), Units.PERCENT);
case HaywardBindingConstants.CHANNEL_FILTER_SPEEDRPM:
case HaywardBindingConstants.CHANNEL_PUMP_LASTSPEED:
return new QuantityType<>(Integer.parseInt(value), Units.PERCENT);
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDPERCENT:
return new QuantityType<>(Integer.parseInt(value), Units.PERCENT);
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDRPM:
}
return StringType.valueOf(value);
case "Number:Frequency":
switch (channelID) {
case HaywardBindingConstants.CHANNEL_FILTER_SPEEDRPM:
return new QuantityType<>(Integer.parseInt(value), Units.RPM);
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDRPM:
return new QuantityType<>(Integer.parseInt(value), Units.RPM);
}
case "Number:Temperature":
Bridge bridge = getBridge();
if (bridge != null) {

View File

@ -129,6 +129,15 @@ public class HaywardDiscoveryService extends AbstractThingHandlerDiscoveryServic
final List<String> colorLogicProperty1 = thingHandler.evaluateXPath("//Backyard//ColorLogic-Light/Type/text()",
xmlResponse);
final List<String> colorLogicProperty2 = thingHandler
.evaluateXPath("//Backyard//ColorLogic-Light/V2-Active/text()", xmlResponse);
for (int i = 0; i < colorLogicProperty2.size(); i++) {
if (colorLogicProperty1.get(i).equals("COLOR_LOGIC_UCL") && colorLogicProperty2.get(i).equals("yes")) {
colorLogicProperty1.set(i, "COLOR_LOGIC_UCL_V2");
}
}
discoverDevices(thingHandler, xmlResponse, "ColorLogic-Light", HaywardTypeToRequest.COLORLOGIC,
HaywardBindingConstants.THING_TYPE_COLORLOGIC, (props, i) -> {
props.put(HaywardBindingConstants.PROPERTY_COLORLOGIC_TYPE, colorLogicProperty1.get(i));

View File

@ -45,30 +45,27 @@ public class HaywardBackyardHandler extends HaywardThingHandler {
List<String> systemIDs = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
systemIDs = bridgehandler.evaluateXPath("//Backyard/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Air temp
data = bridgehandler.evaluateXPath("//Backyard/@airTemp", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BACKYARD_AIRTEMP, data.get(0));
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
systemIDs = bridgehandler.evaluateXPath("//Backyard/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Air temp
data = bridgehandler.evaluateXPath("//Backyard/@airTemp", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BACKYARD_AIRTEMP, data.get(0));
// Status
data = bridgehandler.evaluateXPath("//Backyard/@status", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BACKYARD_STATUS, data.get(0));
// Status
data = bridgehandler.evaluateXPath("//Backyard/@status", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BACKYARD_STATUS, data.get(0));
// State
data = bridgehandler.evaluateXPath("//Backyard/@state", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BACKYARD_STATE, data.get(0));
}
// State
data = bridgehandler.evaluateXPath("//Backyard/@state", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BACKYARD_STATE, data.get(0));
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
@ -79,54 +76,47 @@ public class HaywardBackyardHandler extends HaywardThingHandler {
String alarmStr;
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
// *****Request Alarm List from Hayward server
String urlParameters = """
<?xml version="1.0" encoding="utf-8"?><Request><Name>GetAlarmList</Name><Parameters>\
<Parameter name="Token" dataType="String">\
""" + bridgehandler.account.token + "</Parameter>"
+ "<Parameter name=\"MspSystemID\" dataType=\"int\">" + bridgehandler.account.mspSystemID
+ "</Parameter>"
+ "<Parameter name=\"CultureInfoName\" dataType=\"String\">en-us</Parameter></Parameters></Request>";
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
// *****Request Alarm List from Hayward server
String urlParameters = """
<?xml version="1.0" encoding="utf-8"?><Request><Name>GetAlarmList</Name><Parameters>\
<Parameter name="Token" dataType="String">\
""" + bridgehandler.account.token + "</Parameter>"
+ "<Parameter name=\"MspSystemID\" dataType=\"int\">" + bridgehandler.account.mspSystemID
+ "</Parameter>"
+ "<Parameter name=\"CultureInfoName\" dataType=\"String\">en-us</Parameter></Parameters></Request>";
try {
String xmlResponse = bridgehandler.httpXmlResponse(urlParameters);
try {
String xmlResponse = bridgehandler.httpXmlResponse(urlParameters);
if (xmlResponse.isEmpty()) {
logger.debug("Hayward getAlarmList XML response was empty");
return false;
}
String status = bridgehandler
.evaluateXPath("/Response/Parameters//Parameter[@name='Status']/text()", xmlResponse)
.get(0);
if (!("0".equals(status))) {
logger.trace("Hayward getAlarm XML response: {}", xmlResponse);
return false;
}
bowID = bridgehandler.evaluateXPath("//Property[@name='BowID']/text()", xmlResponse);
parameter1 = bridgehandler.evaluateXPath("//Property[@name='Parameter1']/text()", xmlResponse);
message = bridgehandler.evaluateXPath("//Property[@name='Message']/text()", xmlResponse);
for (int i = 0; i < 5; i++) {
if (i < bowID.size()) {
alarmStr = parameter1.get(i) + ": " + message.get(i);
} else {
alarmStr = "";
}
updateData("backyardAlarm" + String.format("%01d", i + 1), alarmStr);
}
this.updateStatus(ThingStatus.ONLINE);
return true;
} catch (InterruptedException e) {
if (xmlResponse.isEmpty()) {
logger.debug("Hayward getAlarmList XML response was empty");
return false;
}
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
String status = bridgehandler
.evaluateXPath("/Response/Parameters//Parameter[@name='Status']/text()", xmlResponse).get(0);
if (!("0".equals(status))) {
logger.trace("Hayward getAlarm XML response: {}", xmlResponse);
return false;
}
bowID = bridgehandler.evaluateXPath("//Property[@name='BowID']/text()", xmlResponse);
parameter1 = bridgehandler.evaluateXPath("//Property[@name='Parameter1']/text()", xmlResponse);
message = bridgehandler.evaluateXPath("//Property[@name='Message']/text()", xmlResponse);
for (int i = 0; i < 5; i++) {
if (i < bowID.size()) {
alarmStr = parameter1.get(i) + ": " + message.get(i);
} else {
alarmStr = "";
}
updateData("backyardAlarm" + String.format("%01d", i + 1), alarmStr);
}
this.updateStatus(ThingStatus.ONLINE);
return true;
} catch (InterruptedException e) {
return false;
}
} else {

View File

@ -42,27 +42,24 @@ public class HaywardBowHandler extends HaywardThingHandler {
List<String> data = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
systemIDs = bridgehandler.evaluateXPath("//BodyOfWater/@systemId", xmlResponse);
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
systemIDs = bridgehandler.evaluateXPath("//BodyOfWater/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Flow
data = bridgehandler.evaluateXPath("//BodyOfWater/@flow", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BOW_FLOW, data.get(i));
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Flow
data = bridgehandler.evaluateXPath("//BodyOfWater/@flow", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BOW_FLOW, data.get(i));
// Water Temp
data = bridgehandler.evaluateXPath("//BodyOfWater/@waterTemp", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BOW_WATERTEMP, data.get(i));
}
// Water Temp
data = bridgehandler.evaluateXPath("//BodyOfWater/@waterTemp", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_BOW_WATERTEMP, data.get(i));
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
}

View File

@ -13,12 +13,15 @@
package org.openhab.binding.haywardomnilogic.internal.handler;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.haywardomnilogic.internal.HaywardBindingConstants;
import org.openhab.binding.haywardomnilogic.internal.HaywardException;
import org.openhab.binding.haywardomnilogic.internal.HaywardThingHandler;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.thing.Bridge;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
@ -26,6 +29,7 @@ import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
import org.openhab.core.types.Command;
import org.openhab.core.types.RefreshType;
import org.openhab.core.types.State;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -37,8 +41,7 @@ import org.slf4j.LoggerFactory;
@NonNullByDefault
public class HaywardChlorinatorHandler extends HaywardThingHandler {
private final Logger logger = LoggerFactory.getLogger(HaywardChlorinatorHandler.class);
public String chlorTimedPercent = "";
public String chlorState = "";
private Map<String, State> channelStates = new HashMap<>();
public HaywardChlorinatorHandler(Thing thing) {
super(thing);
@ -50,61 +53,55 @@ public class HaywardChlorinatorHandler extends HaywardThingHandler {
List<String> data = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
systemIDs = bridgehandler.evaluateXPath("//Chlorinator/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Operating Mode
data = bridgehandler.evaluateXPath("//Chlorinator/@operatingMode", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_OPERATINGMODE, data.get(i));
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
systemIDs = bridgehandler.evaluateXPath("//Chlorinator/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Enable
data = bridgehandler.evaluateXPath("//Chlorinator/@enable", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_ENABLE, data.get(i));
// Timed Percent
data = bridgehandler.evaluateXPath("//Chlorinator/@Timed-Percent", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_TIMEDPERCENT, data.get(i));
this.chlorTimedPercent = data.get(0);
// Operating Mode
data = bridgehandler.evaluateXPath("//Chlorinator/@operatingMode", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_OPERATINGMODE, data.get(i));
// scMode
data = bridgehandler.evaluateXPath("//Chlorinator/@scMode", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_SCMODE, data.get(i));
// Timed Percent
data = bridgehandler.evaluateXPath("//Chlorinator/@Timed-Percent", xmlResponse);
channelStates
.putAll(updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_TIMEDPERCENT, data.get(i)));
// Error
data = bridgehandler.evaluateXPath("//Chlorinator/@chlrError", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_ERROR, data.get(i));
// scMode
data = bridgehandler.evaluateXPath("//Chlorinator/@scMode", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_SCMODE, data.get(i));
// Alert
data = bridgehandler.evaluateXPath("//Chlorinator/@chlrAlert", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_ALERT, data.get(i));
// Error Bit Array
data = bridgehandler.evaluateXPath("//Chlorinator/@chlrError", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_ERROR, String
.format("%16s", Integer.toBinaryString(Integer.parseInt(data.get(i)))).replace(" ", "0"));
// Average Salt Level
data = bridgehandler.evaluateXPath("//Chlorinator/@avgSaltLevel", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_AVGSALTLEVEL, data.get(i));
// Alert Bit Array
data = bridgehandler.evaluateXPath("//Chlorinator/@chlrAlert", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_ALERT, String
.format("%16s", Integer.toBinaryString(Integer.parseInt(data.get(i)))).replace(" ", "0"));
// Instant Salt Level
data = bridgehandler.evaluateXPath("//Chlorinator/@instantSaltLevel", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_INSTANTSALTLEVEL, data.get(i));
// Average Salt Level
data = bridgehandler.evaluateXPath("//Chlorinator/@avgSaltLevel", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_AVGSALTLEVEL, data.get(i));
// Status
data = bridgehandler.evaluateXPath("//Chlorinator/@status", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_STATUS, data.get(i));
// Instant Salt Level
data = bridgehandler.evaluateXPath("//Chlorinator/@instantSaltLevel", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_INSTANTSALTLEVEL, data.get(i));
if ("0".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_ENABLE, "0");
// chlorState is used to set the chlorinator cfgState in the timedPercent command
this.chlorState = "2";
} else {
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_ENABLE, "1");
// chlorState is used to set the chlorinator cfgState in the timedPercent command
this.chlorState = "3";
}
}
// Status Bit Array
data = bridgehandler.evaluateXPath("//Chlorinator/@status", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_CHLORINATOR_STATUS, String
.format("%16s", Integer.toBinaryString(Integer.parseInt(data.get(i)))).replace(" ", "0"));
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
@ -121,67 +118,66 @@ public class HaywardChlorinatorHandler extends HaywardThingHandler {
String poolID = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_BOWID);
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
String cmdString = this.cmdToString(command);
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_CHLORINATOR_ENABLE:
if ("1".equals(cmdString)) {
chlorCfgState = "3";
chlorTimedPercent = this.chlorTimedPercent;
} else {
chlorCfgState = "2";
chlorTimedPercent = this.chlorTimedPercent;
}
break;
case HaywardBindingConstants.CHANNEL_CHLORINATOR_TIMEDPERCENT:
chlorCfgState = this.chlorState;
chlorTimedPercent = cmdString;
break;
default:
logger.warn("haywardCommand Unsupported type {}", channelUID);
return;
}
String cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetCHLORParams</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"ChlorID\" dataType=\"int\" alias=\"EquipmentID\">" + systemID
+ "</Parameter>" + "<Parameter name=\"CfgState\" dataType=\"byte\" alias=\"Data1\">"
+ chlorCfgState + "</Parameter>"
+ "<Parameter name=\"OpMode\" dataType=\"byte\" alias=\"Data2\">1</Parameter>"
+ "<Parameter name=\"BOWType\" dataType=\"byte\" alias=\"Data3\">1</Parameter>"
+ "<Parameter name=\"CellType\" dataType=\"byte\" alias=\"Data4\">4</Parameter>"
+ "<Parameter name=\"TimedPercent\" dataType=\"byte\" alias=\"Data5\">" + chlorTimedPercent
+ "</Parameter>"
+ "<Parameter name=\"SCTimeout\" dataType=\"byte\" unit=\"hour\" alias=\"Data6\">24</Parameter>"
+ "<Parameter name=\"ORPTimout\" dataType=\"byte\" unit=\"hour\" alias=\"Data7\">24</Parameter>"
+ "</Parameters></Request>";
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse)
.get(0);
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
String cmdString = this.cmdToString(command);
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_CHLORINATOR_ENABLE:
chlorTimedPercent = channelStates.get(HaywardBindingConstants.CHANNEL_CHLORINATOR_TIMEDPERCENT)
.format("%d");
if ("1".equals(cmdString)) {
chlorCfgState = "3";
} else {
chlorCfgState = "2";
}
break;
case HaywardBindingConstants.CHANNEL_CHLORINATOR_TIMEDPERCENT:
if (channelStates.get(HaywardBindingConstants.CHANNEL_CHLORINATOR_ENABLE) == OnOffType.ON) {
chlorCfgState = "3";
} else {
chlorCfgState = "2";
}
chlorTimedPercent = cmdString;
break;
default:
logger.warn("haywardCommand Unsupported type {}", channelUID);
return;
}
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}",
bridgehandler.config.endpointUrl, bridgehandler.config.username, e.getMessage());
} catch (InterruptedException e) {
}
String cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS + "<Name>SetCHLORParams</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"ChlorID\" dataType=\"int\" alias=\"EquipmentID\">" + systemID
+ "</Parameter>" + "<Parameter name=\"CfgState\" dataType=\"byte\" alias=\"Data1\">"
+ chlorCfgState + "</Parameter>"
+ "<Parameter name=\"OpMode\" dataType=\"byte\" alias=\"Data2\">1</Parameter>"
+ "<Parameter name=\"BOWType\" dataType=\"byte\" alias=\"Data3\">1</Parameter>"
+ "<Parameter name=\"CellType\" dataType=\"byte\" alias=\"Data4\">4</Parameter>"
+ "<Parameter name=\"TimedPercent\" dataType=\"byte\" alias=\"Data5\">" + chlorTimedPercent
+ "</Parameter>"
+ "<Parameter name=\"SCTimeout\" dataType=\"byte\" unit=\"hour\" alias=\"Data6\">24</Parameter>"
+ "<Parameter name=\"ORPTimout\" dataType=\"byte\" unit=\"hour\" alias=\"Data7\">24</Parameter>"
+ "</Parameters></Request>";
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse).get(0);
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}", bridgehandler.config.endpointUrl,
bridgehandler.config.username, e.getMessage());
} catch (InterruptedException e) {
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
}

View File

@ -13,7 +13,9 @@
package org.openhab.binding.haywardomnilogic.internal.handler;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.haywardomnilogic.internal.HaywardBindingConstants;
@ -21,12 +23,20 @@ import org.openhab.binding.haywardomnilogic.internal.HaywardException;
import org.openhab.binding.haywardomnilogic.internal.HaywardThingHandler;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.thing.Bridge;
import org.openhab.core.thing.Channel;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
import org.openhab.core.thing.binding.builder.ChannelBuilder;
import org.openhab.core.thing.binding.builder.ThingBuilder;
import org.openhab.core.thing.type.ChannelTypeUID;
import org.openhab.core.types.Command;
import org.openhab.core.types.RefreshType;
import org.openhab.core.types.State;
import org.openhab.core.types.StateDescriptionFragment;
import org.openhab.core.types.StateDescriptionFragmentBuilder;
import org.openhab.core.types.StateOption;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -38,11 +48,117 @@ import org.slf4j.LoggerFactory;
@NonNullByDefault
public class HaywardColorLogicHandler extends HaywardThingHandler {
private final Logger logger = LoggerFactory.getLogger(HaywardColorLogicHandler.class);
private Map<String, State> channelStates = new HashMap<>();
public HaywardColorLogicHandler(Thing thing) {
super(thing);
}
@Override
public void initialize() {
try {
setStateDescriptions();
if ("COLOR_LOGIC_UCL_V2"
.equals(getThing().getProperties().get(HaywardBindingConstants.PROPERTY_COLORLOGIC_TYPE))) {
addV2Channels();
}
updateStatus(ThingStatus.ONLINE);
} catch (HaywardException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"Unable to set ColorLogixHandler StateDescriptions");
}
}
protected void addV2Channels() {
if (thing.getChannel(HaywardBindingConstants.CHANNEL_COLORLOGIC_BRIGHTNESS) == null) {
ThingBuilder thingBuilder = editThing();
ChannelUID uid = new ChannelUID(thing.getUID(), HaywardBindingConstants.CHANNEL_COLORLOGIC_BRIGHTNESS);
ChannelBuilder chnBuilder = ChannelBuilder.create(uid, "String");
chnBuilder.withType(new ChannelTypeUID(HaywardBindingConstants.BINDING_ID,
HaywardBindingConstants.TYPE_COLORLOGIC_LIGHTBRIGHTNESS));
chnBuilder.withLabel("Brightness");
chnBuilder.withDescription("Brightness");
Channel channel = chnBuilder.build();
thingBuilder.withChannel(channel);
updateThing(thingBuilder.build());
}
if (thing.getChannel(HaywardBindingConstants.CHANNEL_COLORLOGIC_SPEED) == null) {
ThingBuilder thingBuilder = editThing();
ChannelUID uid = new ChannelUID(thing.getUID(), HaywardBindingConstants.CHANNEL_COLORLOGIC_SPEED);
ChannelBuilder chnBuilder = ChannelBuilder.create(uid, "String");
chnBuilder.withType(new ChannelTypeUID(HaywardBindingConstants.BINDING_ID,
HaywardBindingConstants.TYPE_COLORLOGIC_LIGHTSPEED));
chnBuilder.withLabel("Speed");
chnBuilder.withDescription("Speed");
Channel channel = chnBuilder.build();
thingBuilder.withChannel(channel);
updateThing(thingBuilder.build());
}
}
@Override
public void setStateDescriptions() throws HaywardException {
List<StateOption> options = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
// Set Light Shows based on light type
Channel ch = thing.getChannel(HaywardBindingConstants.CHANNEL_COLORLOGIC_CURRENTSHOW);
if (ch != null) {
String lightType = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_COLORLOGIC_TYPE);
if (lightType != null) {
if ("COLOR_LOGIC_2_5".equals(lightType) || "COLOR_LOGIC_4_0".equals(lightType)) {
options.add(new StateOption("0", "Voodoo Lounge"));
options.add(new StateOption("1", "Deep Blue Sea"));
options.add(new StateOption("2", "Afternoon Sky"));
options.add(new StateOption("3", "Emerald"));
options.add(new StateOption("4", "Sangria"));
options.add(new StateOption("5", "Cloud White"));
options.add(new StateOption("6", "Twilight"));
options.add(new StateOption("7", "Tranquility"));
options.add(new StateOption("8", "Gemstone"));
options.add(new StateOption("9", "USA"));
options.add(new StateOption("10", "Mardi Gras"));
options.add(new StateOption("11", "Cool Cabaret"));
} else if (lightType.contains("COLOR_LOGIC_UCL")) {
options.add(new StateOption("0", "Voodoo Lounge"));
options.add(new StateOption("1", "Deep Blue Sea"));
options.add(new StateOption("2", "Royal Blue"));
options.add(new StateOption("3", "Afternoon Sky"));
options.add(new StateOption("4", "Aqua Green"));
options.add(new StateOption("5", "Emerald"));
options.add(new StateOption("6", "Cloud White"));
options.add(new StateOption("7", "Warm Red"));
options.add(new StateOption("8", "Flamingo"));
options.add(new StateOption("9", "Vivid Violet"));
options.add(new StateOption("10", "Sangria"));
options.add(new StateOption("11", "Twilight"));
options.add(new StateOption("12", "Tranquility"));
options.add(new StateOption("13", "Gemstone"));
options.add(new StateOption("14", "USA"));
options.add(new StateOption("15", "Mardi Gras"));
options.add(new StateOption("16", "Cool Cabaret"));
}
if ("COLOR_LOGIC_UCL_V2".equals(lightType)) {
options.add(new StateOption("17", "Yellow"));
options.add(new StateOption("18", "Orange"));
options.add(new StateOption("19", "Gold"));
options.add(new StateOption("20", "Mint"));
options.add(new StateOption("21", "Teal"));
options.add(new StateOption("22", "Burnt Orange"));
options.add(new StateOption("23", "Pure White"));
options.add(new StateOption("24", "Crisp White"));
options.add(new StateOption("25", "Warm White"));
options.add(new StateOption("26", "Bright Yellow"));
}
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withOptions(options).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
}
}
}
@Override
public void getTelemetry(String xmlResponse) throws HaywardException {
List<String> systemIDs = new ArrayList<>();
@ -58,7 +174,7 @@ public class HaywardColorLogicHandler extends HaywardThingHandler {
if (systemIDs.get(i).equals(thingSystemID)) {
// Light State
data = bridgehandler.evaluateXPath("//ColorLogic-Light/@lightState", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_COLORLOGIC_LIGHTSTATE, data.get(i));
updateData(HaywardBindingConstants.CHANNEL_COLORLOGIC_STATE, data.get(i));
if ("0".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_COLORLOGIC_ENABLE, "0");
@ -68,7 +184,25 @@ public class HaywardColorLogicHandler extends HaywardThingHandler {
// Current Show
data = bridgehandler.evaluateXPath("//ColorLogic-Light/@currentShow", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_COLORLOGIC_CURRENTSHOW, data.get(0));
channelStates.putAll(
updateData(HaywardBindingConstants.CHANNEL_COLORLOGIC_CURRENTSHOW, data.get(0)));
// V2 Light Features
String lightType = getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_COLORLOGIC_TYPE);
if (lightType != null) {
if ("COLOR_LOGIC_UCL_V2".equals(lightType)) {
// Brightness
data = bridgehandler.evaluateXPath("//ColorLogic-Light/@brightness", xmlResponse);
channelStates.putAll(
updateData(HaywardBindingConstants.CHANNEL_COLORLOGIC_BRIGHTNESS, data.get(0)));
// Speed
data = bridgehandler.evaluateXPath("//ColorLogic-Light/@speed", xmlResponse);
channelStates.putAll(
updateData(HaywardBindingConstants.CHANNEL_COLORLOGIC_SPEED, data.get(0)));
}
}
}
}
this.updateStatus(ThingStatus.ONLINE);
@ -86,6 +220,9 @@ public class HaywardColorLogicHandler extends HaywardThingHandler {
String systemID = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_SYSTEM_ID);
String poolID = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_BOWID);
String show = channelStates.get(HaywardBindingConstants.CHANNEL_COLORLOGIC_CURRENTSHOW).toString();
String brightness = null;
String speed = null;
Bridge bridge = getBridge();
if (bridge != null) {
@ -93,6 +230,7 @@ public class HaywardColorLogicHandler extends HaywardThingHandler {
if (bridgehandler != null) {
String cmdString = this.cmdToString(command);
String cmdURL = null;
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_COLORLOGIC_ENABLE:
@ -112,17 +250,78 @@ public class HaywardColorLogicHandler extends HaywardThingHandler {
+ HaywardBindingConstants.COMMAND_SCHEDULE + "</Parameters></Request>";
break;
case HaywardBindingConstants.CHANNEL_COLORLOGIC_CURRENTSHOW:
String lightType = getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_COLORLOGIC_TYPE);
if (lightType != null) {
if (!"COLOR_LOGIC_UCL_V2".equals(lightType)) {
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetStandAloneLightShow</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">"
+ bridgehandler.account.token + "</Parameter>"
+ "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"LightID\" dataType=\"int\">" + systemID
+ "</Parameter>" + "<Parameter name=\"Show\" dataType=\"int\">" + cmdString
+ "</Parameter>" + HaywardBindingConstants.COMMAND_SCHEDULE
+ "</Parameters></Request>";
} else {
brightness = channelStates
.get(HaywardBindingConstants.CHANNEL_COLORLOGIC_BRIGHTNESS).toString();
speed = channelStates.get(HaywardBindingConstants.CHANNEL_COLORLOGIC_SPEED)
.toString();
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetStandAloneLightShowV2</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">"
+ bridgehandler.account.token + "</Parameter>"
+ "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"LightID\" dataType=\"int\">" + systemID
+ "</Parameter>" + "<Parameter name=\"Show\" dataType=\"int\">" + cmdString
+ "</Parameter>" + "<Parameter name=\"Speed\" dataType=\"byte\">" + speed
+ "</Parameter>" + "<Parameter name=\"Brightness\" dataType=\"byte\">"
+ brightness + "</Parameter>" + HaywardBindingConstants.COMMAND_SCHEDULE
+ "</Parameters></Request>";
}
}
break;
case HaywardBindingConstants.CHANNEL_COLORLOGIC_BRIGHTNESS:
show = channelStates.get(HaywardBindingConstants.CHANNEL_COLORLOGIC_CURRENTSHOW).toString();
speed = channelStates.get(HaywardBindingConstants.CHANNEL_COLORLOGIC_SPEED).toString();
if (Integer.parseInt(cmdString) > 4) {
cmdString = "4";
}
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetStandAloneLightShow</Name><Parameters>"
+ "<Name>SetStandAloneLightShowV2</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"LightID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"Show\" dataType=\"int\">" + cmdString + "</Parameter>"
+ "<Parameter name=\"Speed\" dataType=\"byte\">4</Parameter>"
+ "<Parameter name=\"Brightness\" dataType=\"byte\">4</Parameter>"
+ "<Parameter name=\"Reserved\" dataType=\"byte\">0</Parameter>"
+ "<Parameter name=\"Show\" dataType=\"int\">" + show + "</Parameter>"
+ "<Parameter name=\"Speed\" dataType=\"byte\">" + speed + "</Parameter>"
+ "<Parameter name=\"Brightness\" dataType=\"byte\">" + cmdString + "</Parameter>"
+ HaywardBindingConstants.COMMAND_SCHEDULE + "</Parameters></Request>";
break;
case HaywardBindingConstants.CHANNEL_COLORLOGIC_SPEED:
brightness = channelStates.get(HaywardBindingConstants.CHANNEL_COLORLOGIC_BRIGHTNESS)
.toString();
show = channelStates.get(HaywardBindingConstants.CHANNEL_COLORLOGIC_CURRENTSHOW).toString();
if (Integer.parseInt(cmdString) > 8) {
cmdString = "8";
}
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetStandAloneLightShowV2</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"LightID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"Show\" dataType=\"int\">" + show + "</Parameter>"
+ "<Parameter name=\"Speed\" dataType=\"byte\">" + cmdString + "</Parameter>"
+ "<Parameter name=\"Brightness\" dataType=\"byte\">" + brightness + "</Parameter>"
+ HaywardBindingConstants.COMMAND_SCHEDULE + "</Parameters></Request>";
break;
default:
@ -131,13 +330,15 @@ public class HaywardColorLogicHandler extends HaywardThingHandler {
}
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse)
.get(0);
if (cmdURL != null) {
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse)
.get(0);
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
return;
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
return;
}
}
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}",
@ -146,7 +347,9 @@ public class HaywardColorLogicHandler extends HaywardThingHandler {
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
} else
{
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}

View File

@ -69,58 +69,55 @@ public class HaywardFilterHandler extends HaywardThingHandler {
String option;
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
// Set Filter Speed % min and max speeds
Channel ch = thing.getChannel(HaywardBindingConstants.CHANNEL_FILTER_SPEEDPERCENT);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MINSPEED)))
.withMaximum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MAXSPEED)))
.build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
// Set Filter Speed % min and max speeds
Channel ch = thing.getChannel(HaywardBindingConstants.CHANNEL_FILTER_SPEEDPERCENT);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MINSPEED)))
.withMaximum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MAXSPEED)))
.withPattern("%d %%").withStep(new BigDecimal(5)).withReadOnly(false).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
// Set Filter Speed RPM min and max speeds
ch = thing.getChannel(HaywardBindingConstants.CHANNEL_FILTER_SPEEDRPM);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MINRPM)))
.withMaximum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MAXRPM)))
.withPattern("%d rpm").withStep(new BigDecimal(200)).withReadOnly(false).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
// Set Filter Speed States
ch = thing.getChannel(HaywardBindingConstants.CHANNEL_FILTER_SPEEDSELECT);
if (ch != null) {
options.add(new StateOption("0", "Off"));
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_LOWSPEED);
if (option != null) {
options.add(new StateOption(option, "Low"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MEDSPEED);
if (option != null) {
options.add(new StateOption(option, "Medium"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_HIGHSPEED);
if (option != null) {
options.add(new StateOption(option, "High"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_CUSTOMSPEED);
if (option != null) {
options.add(new StateOption(option, "Custom"));
}
// Set Filter Speed RPM min and max speeds
ch = thing.getChannel(HaywardBindingConstants.CHANNEL_FILTER_SPEEDRPM);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MINRPM)))
.withMaximum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MAXRPM)))
.build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
// Set Filter Speed States
ch = thing.getChannel(HaywardBindingConstants.CHANNEL_FILTER_SPEEDSELECT);
if (ch != null) {
options.add(new StateOption("0", "Off"));
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_LOWSPEED);
if (option != null) {
options.add(new StateOption(option, "Low"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_MEDSPEED);
if (option != null) {
options.add(new StateOption(option, "Medium"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_HIGHSPEED);
if (option != null) {
options.add(new StateOption(option, "High"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_FILTER_CUSTOMSPEED);
if (option != null) {
options.add(new StateOption(option, "Custom"));
}
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withOptions(options).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withOptions(options).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
}
}
@ -131,53 +128,50 @@ public class HaywardFilterHandler extends HaywardThingHandler {
List<String> data = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
systemIDs = bridgehandler.evaluateXPath("//Filter/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Valve Position
data = bridgehandler.evaluateXPath("//Filter/@valvePosition", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_VALVEPOSITION, data.get(i));
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
systemIDs = bridgehandler.evaluateXPath("//Filter/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Valve Position
data = bridgehandler.evaluateXPath("//Filter/@valvePosition", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_VALVEPOSITION, data.get(i));
// Speed percent
data = bridgehandler.evaluateXPath("//Filter/@filterSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_SPEEDPERCENT, data.get(i));
// Speed percent
data = bridgehandler.evaluateXPath("//Filter/@filterSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_SPEEDPERCENT, data.get(i));
// Speed rpm
String filterMaxRpm = getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_FILTER_MAXRPM);
if (filterMaxRpm != null) {
Integer rpmSpeed = (Integer.parseInt(data.get(i))) * (Integer.parseInt(filterMaxRpm)) / 100;
updateData(HaywardBindingConstants.CHANNEL_FILTER_SPEEDRPM, rpmSpeed.toString());
}
if ("0".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_FILTER_ENABLE, "0");
} else {
updateData(HaywardBindingConstants.CHANNEL_FILTER_ENABLE, "1");
}
// Speed Select
data = bridgehandler.evaluateXPath("//Filter/@filterSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_SPEEDSELECT, data.get(i));
// State
data = bridgehandler.evaluateXPath("//Filter/@filterState", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_STATE, data.get(i));
// lastSpeed
data = bridgehandler.evaluateXPath("//Filter/@lastSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_LASTSPEED, data.get(i));
channelStates.putAll(updateData(HaywardBindingConstants.CHANNEL_FILTER_LASTSPEED, data.get(i)));
// Speed rpm
String filterMaxRpm = getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_FILTER_MAXRPM);
if (filterMaxRpm != null) {
Integer rpmSpeed = (Integer.parseInt(data.get(i))) * (Integer.parseInt(filterMaxRpm)) / 100;
updateData(HaywardBindingConstants.CHANNEL_FILTER_SPEEDRPM, rpmSpeed.toString());
}
if ("0".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_FILTER_ENABLE, "0");
} else {
updateData(HaywardBindingConstants.CHANNEL_FILTER_ENABLE, "1");
}
// Speed Select
data = bridgehandler.evaluateXPath("//Filter/@filterSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_SPEEDSELECT, data.get(i));
// State
data = bridgehandler.evaluateXPath("//Filter/@filterState", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_STATE, data.get(i));
// lastSpeed
data = bridgehandler.evaluateXPath("//Filter/@lastSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_FILTER_LASTSPEED, data.get(i));
channelStates.putAll(updateData(HaywardBindingConstants.CHANNEL_FILTER_LASTSPEED, data.get(i)));
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}

View File

@ -45,30 +45,27 @@ public class HaywardHeaterHandler extends HaywardThingHandler {
List<String> data = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
systemIDs = bridgehandler.evaluateXPath("//Heater/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// State
data = bridgehandler.evaluateXPath("//Heater/@heaterState", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_HEATER_STATE, data.get(i));
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
systemIDs = bridgehandler.evaluateXPath("//Heater/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// State
data = bridgehandler.evaluateXPath("//Heater/@heaterState", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_HEATER_STATE, data.get(i));
// Enable
data = bridgehandler.evaluateXPath("//Heater/@enable", xmlResponse);
if ("0".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_HEATER_ENABLE, "0");
} else {
updateData(HaywardBindingConstants.CHANNEL_HEATER_ENABLE, "1");
}
// Enable
data = bridgehandler.evaluateXPath("//Heater/@enable", xmlResponse);
if ("0".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_HEATER_ENABLE, "0");
} else {
updateData(HaywardBindingConstants.CHANNEL_HEATER_ENABLE, "1");
}
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
}

View File

@ -69,58 +69,55 @@ public class HaywardPumpHandler extends HaywardThingHandler {
String option;
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
// Set Pump % min and max speeds
Channel ch = thing.getChannel(HaywardBindingConstants.CHANNEL_PUMP_SPEEDPERCENT);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MINSPEED)))
.withMaximum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MAXSPEED)))
.build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
// Set Pump % min and max speeds
Channel ch = thing.getChannel(HaywardBindingConstants.CHANNEL_PUMP_SPEEDPERCENT);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MINSPEED)))
.withMaximum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MAXSPEED)))
.withPattern("%d %%").withStep(new BigDecimal(5)).withReadOnly(false).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
// Set Pump Speed RPM min and max speeds
ch = thing.getChannel(HaywardBindingConstants.CHANNEL_PUMP_SPEEDRPM);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MINRPM)))
.withMaximum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MAXRPM)))
.withPattern("%d rpm").withStep(new BigDecimal(200)).withReadOnly(false).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
// Set Pump Speed States
ch = thing.getChannel(HaywardBindingConstants.CHANNEL_PUMP_SPEEDSELECT);
if (ch != null) {
options.add(new StateOption("0", "Off"));
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_LOWSPEED);
if (option != null) {
options.add(new StateOption(option, "Low"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MEDSPEED);
if (option != null) {
options.add(new StateOption(option, "Medium"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_HIGHSPEED);
if (option != null) {
options.add(new StateOption(option, "High"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_CUSTOMSPEED);
if (option != null) {
options.add(new StateOption(option, "Custom"));
}
// Set Pump Speed RPM min and max speeds
ch = thing.getChannel(HaywardBindingConstants.CHANNEL_PUMP_SPEEDRPM);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MINRPM)))
.withMaximum(new BigDecimal(
getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MAXRPM)))
.build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
// Set Pump Speed States
ch = thing.getChannel(HaywardBindingConstants.CHANNEL_PUMP_SPEEDSELECT);
if (ch != null) {
options.add(new StateOption("0", "Off"));
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_LOWSPEED);
if (option != null) {
options.add(new StateOption(option, "Low"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MEDSPEED);
if (option != null) {
options.add(new StateOption(option, "Medium"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_HIGHSPEED);
if (option != null) {
options.add(new StateOption(option, "High"));
}
option = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_CUSTOMSPEED);
if (option != null) {
options.add(new StateOption(option, "Custom"));
}
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withOptions(options).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withOptions(options).build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
}
}
@ -131,49 +128,45 @@ public class HaywardPumpHandler extends HaywardThingHandler {
List<String> data = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
systemIDs = bridgehandler.evaluateXPath("//Pump/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Speed percent
data = bridgehandler.evaluateXPath("//Pump/@pumpSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_PUMP_SPEEDPERCENT, data.get(i));
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
systemIDs = bridgehandler.evaluateXPath("//Pump/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
// Speed percent
data = bridgehandler.evaluateXPath("//Pump/@pumpSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_PUMP_SPEEDPERCENT, data.get(i));
// Speed rpm
String pumpMaxRpm = getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_PUMP_MAXRPM);
if (pumpMaxRpm != null) {
Integer rpmSpeed = (Integer.parseInt(data.get(i))) * (Integer.parseInt(pumpMaxRpm)) / 100;
updateData(HaywardBindingConstants.CHANNEL_PUMP_SPEEDRPM, rpmSpeed.toString());
}
if ("0".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_PUMP_ENABLE, "0");
} else {
updateData(HaywardBindingConstants.CHANNEL_PUMP_ENABLE, "1");
}
// Speed Select
data = bridgehandler.evaluateXPath("//Pump/@pumpSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_PUMP_SPEEDSELECT, data.get(i));
// State
data = bridgehandler.evaluateXPath("//Pump/@pumpState", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_PUMP_STATE, data.get(i));
// lastSpeed
data = bridgehandler.evaluateXPath("//Pump/@lastSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_PUMP_LASTSPEED, data.get(i));
channelStates.putAll(updateData(HaywardBindingConstants.CHANNEL_PUMP_LASTSPEED, data.get(i)));
// Speed rpm
String pumpMaxRpm = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MAXRPM);
if (pumpMaxRpm != null) {
Integer rpmSpeed = (Integer.parseInt(data.get(i))) * (Integer.parseInt(pumpMaxRpm)) / 100;
updateData(HaywardBindingConstants.CHANNEL_PUMP_SPEEDRPM, rpmSpeed.toString());
}
if ("0".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_PUMP_ENABLE, "0");
} else {
updateData(HaywardBindingConstants.CHANNEL_PUMP_ENABLE, "1");
}
// Speed Select
data = bridgehandler.evaluateXPath("//Pump/@pumpSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_PUMP_SPEEDSELECT, data.get(i));
// State
data = bridgehandler.evaluateXPath("//Pump/@pumpState", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_PUMP_STATE, data.get(i));
// lastSpeed
data = bridgehandler.evaluateXPath("//Pump/@lastSpeed", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_PUMP_LASTSPEED, data.get(i));
channelStates.putAll(updateData(HaywardBindingConstants.CHANNEL_PUMP_LASTSPEED, data.get(i)));
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
@ -190,79 +183,74 @@ public class HaywardPumpHandler extends HaywardThingHandler {
String pumpMaxRpm = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_PUMP_MAXRPM);
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
String cmdString = this.cmdToString(command);
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_PUMP_ENABLE:
if (command == OnOffType.ON) {
cmdString = channelStates.get(HaywardBindingConstants.CHANNEL_PUMP_LASTSPEED)
.format("%d");
} else {
cmdString = "0";
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
String cmdString = this.cmdToString(command);
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_PUMP_ENABLE:
if (command == OnOffType.ON) {
cmdString = channelStates.get(HaywardBindingConstants.CHANNEL_PUMP_LASTSPEED).format("%d");
} else {
cmdString = "0";
}
break;
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDPERCENT:
if (pumpMinSpeed != null && pumpMaxSpeed != null) {
if (Integer.parseInt(cmdString) > 0
&& Integer.parseInt(cmdString) < Integer.parseInt(pumpMinSpeed)) {
cmdString = pumpMinSpeed;
} else if (Integer.parseInt(cmdString) > Integer.parseInt(pumpMaxSpeed)) {
cmdString = pumpMaxSpeed;
}
break;
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDPERCENT:
if (pumpMinSpeed != null && pumpMaxSpeed != null) {
if (Integer.parseInt(cmdString) > 0
&& Integer.parseInt(cmdString) < Integer.parseInt(pumpMinSpeed)) {
cmdString = pumpMinSpeed;
} else if (Integer.parseInt(cmdString) > Integer.parseInt(pumpMaxSpeed)) {
cmdString = pumpMaxSpeed;
}
}
break;
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDRPM:
// Convert cmdString from RPM to Percent
if (pumpMaxRpm != null && pumpMaxSpeed != null && pumpMinSpeed != null) {
cmdString = Integer
.toString((Integer.parseInt(cmdString) * 100 / Integer.parseInt(pumpMaxRpm)));
if (Integer.parseInt(cmdString) > 0
&& Integer.parseInt(cmdString) < Integer.parseInt(pumpMinSpeed)) {
cmdString = pumpMinSpeed;
} else if (Integer.parseInt(cmdString) > Integer.parseInt(pumpMaxSpeed)) {
cmdString = pumpMaxSpeed;
}
break;
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDRPM:
// Convert cmdString from RPM to Percent
if (pumpMaxRpm != null && pumpMaxSpeed != null && pumpMinSpeed != null) {
cmdString = Integer
.toString((Integer.parseInt(cmdString) * 100 / Integer.parseInt(pumpMaxSpeed)));
if (Integer.parseInt(cmdString) > 0
&& Integer.parseInt(cmdString) < Integer.parseInt(pumpMinSpeed)) {
cmdString = pumpMinSpeed;
} else if (Integer.parseInt(cmdString) > Integer.parseInt(pumpMaxSpeed)) {
cmdString = pumpMaxSpeed;
}
}
break;
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDSELECT:
break;
default:
logger.warn("haywardCommand Unsupported type {}", channelUID);
return;
}
String cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetUIEquipmentCmd</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"EquipmentID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"IsOn\" dataType=\"int\">" + cmdString + "</Parameter>"
+ HaywardBindingConstants.COMMAND_SCHEDULE + "</Parameters></Request>";
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse)
.get(0);
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
}
break;
case HaywardBindingConstants.CHANNEL_PUMP_SPEEDSELECT:
break;
default:
logger.warn("haywardCommand Unsupported type {}", channelUID);
return;
}
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}",
bridgehandler.config.endpointUrl, bridgehandler.config.username, e.getMessage());
} catch (InterruptedException e) {
}
String cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetUIEquipmentCmd</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"EquipmentID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"IsOn\" dataType=\"int\">" + cmdString + "</Parameter>"
+ HaywardBindingConstants.COMMAND_SCHEDULE + "</Parameters></Request>";
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse).get(0);
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}", bridgehandler.config.endpointUrl,
bridgehandler.config.username, e.getMessage());
} catch (InterruptedException e) {
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
}

View File

@ -48,21 +48,18 @@ public class HaywardRelayHandler extends HaywardThingHandler {
List<String> data = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
systemIDs = bridgehandler.evaluateXPath("//Relay/@systemId", xmlResponse);
data = bridgehandler.evaluateXPath("//Relay/@relayState", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
updateData(HaywardBindingConstants.CHANNEL_RELAY_STATE, data.get(i));
}
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
systemIDs = bridgehandler.evaluateXPath("//Relay/@systemId", xmlResponse);
data = bridgehandler.evaluateXPath("//Relay/@relayState", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
updateData(HaywardBindingConstants.CHANNEL_RELAY_STATE, data.get(i));
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
@ -76,48 +73,44 @@ public class HaywardRelayHandler extends HaywardThingHandler {
String poolID = getThing().getProperties().get(HaywardBindingConstants.PROPERTY_BOWID);
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
String cmdString = this.cmdToString(command);
String cmdURL = null;
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_RELAY_STATE:
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetUIEquipmentCmd</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"EquipmentID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"IsOn\" dataType=\"int\">" + cmdString + "</Parameter>"
+ HaywardBindingConstants.COMMAND_SCHEDULE + "</Parameters></Request>";
break;
default:
logger.warn("haywardCommand Unsupported type {}", channelUID);
return;
}
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse)
.get(0);
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
String cmdString = this.cmdToString(command);
String cmdURL = null;
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_RELAY_STATE:
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetUIEquipmentCmd</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"EquipmentID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"IsOn\" dataType=\"int\">" + cmdString + "</Parameter>"
+ HaywardBindingConstants.COMMAND_SCHEDULE + "</Parameters></Request>";
break;
default:
logger.warn("haywardCommand Unsupported type {}", channelUID);
return;
}
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}",
bridgehandler.config.endpointUrl, bridgehandler.config.username, e.getMessage());
} catch (InterruptedException e) {
}
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse).get(0);
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}", bridgehandler.config.endpointUrl,
bridgehandler.config.username, e.getMessage());
} catch (InterruptedException e) {
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
}

View File

@ -60,20 +60,17 @@ public class HaywardVirtualHeaterHandler extends HaywardThingHandler {
@Override
public void setStateDescriptions() throws HaywardException {
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
// Set heater min and max speeds
Channel ch = thing.getChannel(HaywardBindingConstants.CHANNEL_VIRTUALHEATER_CURRENTSETPOINT);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_VIRTUALHEATER_MINSETTABLEWATERTEMP)))
.withMaximum(new BigDecimal(getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_VIRTUALHEATER_MAXSETTABLEWATERTEMP)))
.build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
// Set heater min and max speeds
Channel ch = thing.getChannel(HaywardBindingConstants.CHANNEL_VIRTUALHEATER_CURRENTSETPOINT);
if (ch != null) {
StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
.withMinimum(new BigDecimal(getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_VIRTUALHEATER_MINSETTABLEWATERTEMP)))
.withMaximum(new BigDecimal(getThing().getProperties()
.get(HaywardBindingConstants.PROPERTY_VIRTUALHEATER_MAXSETTABLEWATERTEMP)))
.build();
bridgehandler.updateChannelStateDescriptionFragment(ch, stateDescriptionFragment);
}
}
}
@ -84,28 +81,25 @@ public class HaywardVirtualHeaterHandler extends HaywardThingHandler {
List<String> data = new ArrayList<>();
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
systemIDs = bridgehandler.evaluateXPath("//VirtualHeater/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
data = bridgehandler.evaluateXPath("//VirtualHeater/@Current-Set-Point", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_VIRTUALHEATER_CURRENTSETPOINT, data.get(i));
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
systemIDs = bridgehandler.evaluateXPath("//VirtualHeater/@systemId", xmlResponse);
String thingSystemID = getThing().getUID().getId();
for (int i = 0; i < systemIDs.size(); i++) {
if (systemIDs.get(i).equals(thingSystemID)) {
data = bridgehandler.evaluateXPath("//VirtualHeater/@Current-Set-Point", xmlResponse);
updateData(HaywardBindingConstants.CHANNEL_VIRTUALHEATER_CURRENTSETPOINT, data.get(i));
data = bridgehandler.evaluateXPath("//VirtualHeater/@enable", xmlResponse);
if ("yes".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_VIRTUALHEATER_ENABLE, "1");
} else if ("no".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_VIRTUALHEATER_ENABLE, "0");
}
data = bridgehandler.evaluateXPath("//VirtualHeater/@enable", xmlResponse);
if ("yes".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_VIRTUALHEATER_ENABLE, "1");
} else if ("no".equals(data.get(i))) {
updateData(HaywardBindingConstants.CHANNEL_VIRTUALHEATER_ENABLE, "0");
}
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
@ -123,75 +117,69 @@ public class HaywardVirtualHeaterHandler extends HaywardThingHandler {
.get(HaywardBindingConstants.PROPERTY_VIRTUALHEATER_MAXSETTABLEWATERTEMP);
Bridge bridge = getBridge();
if (bridge != null) {
HaywardBridgeHandler bridgehandler = (HaywardBridgeHandler) bridge.getHandler();
if (bridgehandler != null) {
String cmdString = this.cmdToString(command);
String cmdURL = null;
if (bridge != null && bridge.getHandler() instanceof HaywardBridgeHandler bridgehandler) {
String cmdString = this.cmdToString(command);
String cmdURL = null;
if (command == OnOffType.ON) {
cmdString = "True";
} else if (command == OnOffType.OFF) {
cmdString = "False";
if (command == OnOffType.ON) {
cmdString = "True";
} else if (command == OnOffType.OFF) {
cmdString = "False";
}
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_VIRTUALHEATER_ENABLE:
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS + "<Name>SetHeaterEnable</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"HeaterID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"Enabled\" dataType=\"bool\">" + cmdString + "</Parameter>"
+ "</Parameters></Request>";
break;
case HaywardBindingConstants.CHANNEL_VIRTUALHEATER_CURRENTSETPOINT:
if (heaterMinSetTemp != null && heaterMaxSetTemp != null) {
if (Integer.parseInt(cmdString) < Integer.parseInt(heaterMinSetTemp)) {
cmdString = heaterMinSetTemp;
} else if (Integer.parseInt(cmdString) > Integer.parseInt(heaterMaxSetTemp)) {
cmdString = heaterMaxSetTemp;
}
}
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS + "<Name>SetUIHeaterCmd</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"HeaterID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"Temp\" dataType=\"int\">" + cmdString + "</Parameter>"
+ "</Parameters></Request>";
break;
default:
logger.warn("haywardCommand Unsupported type {}", channelUID);
return;
}
try {
switch (channelUID.getId()) {
case HaywardBindingConstants.CHANNEL_VIRTUALHEATER_ENABLE:
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetHeaterEnable</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"HeaterID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"Enabled\" dataType=\"bool\">" + cmdString + "</Parameter>"
+ "</Parameters></Request>";
break;
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse).get(0);
case HaywardBindingConstants.CHANNEL_VIRTUALHEATER_CURRENTSETPOINT:
if (heaterMinSetTemp != null && heaterMaxSetTemp != null) {
if (Integer.parseInt(cmdString) < Integer.parseInt(heaterMinSetTemp)) {
cmdString = heaterMinSetTemp;
} else if (Integer.parseInt(cmdString) > Integer.parseInt(heaterMaxSetTemp)) {
cmdString = heaterMaxSetTemp;
}
}
cmdURL = HaywardBindingConstants.COMMAND_PARAMETERS
+ "<Name>SetUIHeaterCmd</Name><Parameters>"
+ "<Parameter name=\"Token\" dataType=\"String\">" + bridgehandler.account.token
+ "</Parameter>" + "<Parameter name=\"MspSystemID\" dataType=\"int\">"
+ bridgehandler.account.mspSystemID + "</Parameter>"
+ "<Parameter name=\"PoolID\" dataType=\"int\">" + poolID + "</Parameter>"
+ "<Parameter name=\"HeaterID\" dataType=\"int\">" + systemID + "</Parameter>"
+ "<Parameter name=\"Temp\" dataType=\"int\">" + cmdString + "</Parameter>"
+ "</Parameters></Request>";
break;
default:
logger.warn("haywardCommand Unsupported type {}", channelUID);
return;
}
// *****Send Command to Hayward server
String xmlResponse = bridgehandler.httpXmlResponse(cmdURL);
String status = bridgehandler.evaluateXPath("//Parameter[@name='Status']/text()", xmlResponse)
.get(0);
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
return;
}
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}",
bridgehandler.config.endpointUrl, bridgehandler.config.username, e.getMessage());
} catch (InterruptedException e) {
if (!("0".equals(status))) {
logger.debug("haywardCommand XML response: {}", xmlResponse);
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
} catch (HaywardException e) {
logger.debug("Unable to send command to Hayward's server {}:{}:{}", bridgehandler.config.endpointUrl,
bridgehandler.config.username, e.getMessage());
} catch (InterruptedException e) {
return;
}
this.updateStatus(ThingStatus.ONLINE);
} else {
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
}
}
}

View File

@ -6,27 +6,16 @@ addon.haywardomnilogic.description = Binding for the Hayward OmniLogix swimming
# thing types
thing-type.haywardomnilogic.backyard.label = Backyard
thing-type.haywardomnilogic.backyard.description = The Hayward Backyard
thing-type.haywardomnilogic.bow.label = Body of Water
thing-type.haywardomnilogic.bow.description = The Hayward Body of Water
thing-type.haywardomnilogic.bridge.label = Hayward OmniLogix Connection
thing-type.haywardomnilogic.bridge.description = Connection to Hayward's Server
thing-type.haywardomnilogic.chlorinator.label = Chlorinator
thing-type.haywardomnilogic.chlorinator.description = Chlorinator
thing-type.haywardomnilogic.colorlogic.label = Color Logic Light
thing-type.haywardomnilogic.colorlogic.description = Color Logic Light
thing-type.haywardomnilogic.filter.label = Filter
thing-type.haywardomnilogic.filter.description = Filter Equipment
thing-type.haywardomnilogic.heater.label = Heater
thing-type.haywardomnilogic.heater.description = Heater
thing-type.haywardomnilogic.pump.label = Pump
thing-type.haywardomnilogic.pump.description = Pump
thing-type.haywardomnilogic.relay.label = Relay
thing-type.haywardomnilogic.relay.description = Relay
thing-type.haywardomnilogic.sensor.label = Sensor
thing-type.haywardomnilogic.sensor.description = Sensor
thing-type.haywardomnilogic.virtualHeater.label = Virtual Heater
thing-type.haywardomnilogic.virtualHeater.description = Virtual Heater
# thing types config
@ -44,68 +33,41 @@ thing-type.config.haywardomnilogic.bridge.username.description = The username to
# channel types
channel-type.haywardomnilogic.airTemp.label = Air Temp
channel-type.haywardomnilogic.airTemp.description = Air Temp
channel-type.haywardomnilogic.alarm.label = Alarm
channel-type.haywardomnilogic.alarm.description = Alarm
channel-type.haywardomnilogic.avgSaltLevel.label = Average Salt Level
channel-type.haywardomnilogic.avgSaltLevel.description = Average Salt Level
channel-type.haywardomnilogic.backyardstate.label = State
channel-type.haywardomnilogic.backyardstate.description = State
channel-type.haywardomnilogic.backyardstate.state.option.0 = Powered Off
channel-type.haywardomnilogic.backyardstate.state.option.1 = Normal
channel-type.haywardomnilogic.backyardstate.state.option.2 = Service Mode
channel-type.haywardomnilogic.backyardstate.state.option.3 = Config Mode
channel-type.haywardomnilogic.backyardstate.state.option.4 = Timed Service Mode
channel-type.haywardomnilogic.backyardstatus.label = Status
channel-type.haywardomnilogic.backyardstatus.description = Status
channel-type.haywardomnilogic.backyardstatus.state.option.1 = Normal
channel-type.haywardomnilogic.backyardstatus.state.option.2 = Alarm
channel-type.haywardomnilogic.backyardstatus.state.option.3 = Expired
channel-type.haywardomnilogic.backyardstatus.state.option.4 = Lost Link
channel-type.haywardomnilogic.backyardstatus.state.option.5 = Service Mode
channel-type.haywardomnilogic.bow.label = Body of Water
channel-type.haywardomnilogic.bow.description = The Body of Water ID
channel-type.haywardomnilogic.chlorAlert.label = Chlorinator Alert
channel-type.haywardomnilogic.chlorAlert.description = Chlorinator Alert
channel-type.haywardomnilogic.chlorAlert.state.option.0 = None
channel-type.haywardomnilogic.chlorAlert.state.option.16 = Low T-Cell Temperature
channel-type.haywardomnilogic.chlorError.label = Chlorinator Error
channel-type.haywardomnilogic.chlorOperatingMode.label = Operating Mode
channel-type.haywardomnilogic.chlorOperatingMode.description = Operating Mode
channel-type.haywardomnilogic.chlorOperatingMode.state.option.0 = Off
channel-type.haywardomnilogic.chlorOperatingMode.state.option.1 = Timed Percent
channel-type.haywardomnilogic.chlorOperatingMode.state.option.2 = ORP Autosense
channel-type.haywardomnilogic.currentSetpoint.label = Current Setpoint
channel-type.haywardomnilogic.currentSetpoint.description = Current Setpoint
channel-type.haywardomnilogic.currentShow.label = Current Show
channel-type.haywardomnilogic.currentShow.description = Current Show
channel-type.haywardomnilogic.currentShow.state.option.0 = Voodoo Lounge
channel-type.haywardomnilogic.currentShow.state.option.1 = Deep Blue Sea
channel-type.haywardomnilogic.currentShow.state.option.2 = Royal Blue
channel-type.haywardomnilogic.currentShow.state.option.3 = Afternoon Sky
channel-type.haywardomnilogic.currentShow.state.option.4 = Aqua Green
channel-type.haywardomnilogic.currentShow.state.option.5 = Emerald
channel-type.haywardomnilogic.currentShow.state.option.6 = Cloud White
channel-type.haywardomnilogic.currentShow.state.option.7 = Warm Red
channel-type.haywardomnilogic.currentShow.state.option.8 = Flamingo
channel-type.haywardomnilogic.currentShow.state.option.9 = Vivid Violet
channel-type.haywardomnilogic.currentShow.state.option.10 = Sangria
channel-type.haywardomnilogic.currentShow.state.option.11 = Twilight
channel-type.haywardomnilogic.currentShow.state.option.12 = Tranquility
channel-type.haywardomnilogic.currentShow.state.option.13 = Gemstone
channel-type.haywardomnilogic.currentShow.state.option.14 = USA
channel-type.haywardomnilogic.currentShow.state.option.15 = Mardi Gras
channel-type.haywardomnilogic.currentShow.state.option.16 = Cool Cabaret
channel-type.haywardomnilogic.data.label = Data
channel-type.haywardomnilogic.data.description = Sensor Data
channel-type.haywardomnilogic.enable.label = Heater Enable
channel-type.haywardomnilogic.enable.description = Heater Enable
channel-type.haywardomnilogic.filterLastSpeed.label = Last Speed
channel-type.haywardomnilogic.filterLastSpeed.description = Last Speed
channel-type.haywardomnilogic.filterSpeed.label = Filter Speed
channel-type.haywardomnilogic.filterSpeed.description = Filter Speed in %
channel-type.haywardomnilogic.filterLastSpeed.description = Last filter speed in percentage
channel-type.haywardomnilogic.filterSpeedPercent.label = Filter Speed
channel-type.haywardomnilogic.filterSpeedPercent.description = Filter speed in percentage
channel-type.haywardomnilogic.filterSpeedRpm.label = Filter Speed
channel-type.haywardomnilogic.filterSpeedRpm.description = Filter speed in rpm
channel-type.haywardomnilogic.filterSpeedSelect.label = Filter Speed States
channel-type.haywardomnilogic.filterSpeedSelect.state.option.0 = Off
channel-type.haywardomnilogic.filterSpeedSelect.state.option.33 = Low
channel-type.haywardomnilogic.filterSpeedSelect.state.option.66 = Medium
channel-type.haywardomnilogic.filterSpeedSelect.state.option.100 = High
channel-type.haywardomnilogic.filterSpeedSelect.state.option.100 = Custom
channel-type.haywardomnilogic.filterState.label = Filter State
channel-type.haywardomnilogic.filterState.description = Filter State
channel-type.haywardomnilogic.filterState.state.option.0 = Off
channel-type.haywardomnilogic.filterState.state.option.1 = Running
channel-type.haywardomnilogic.filterState.state.option.2 = Priming
@ -119,32 +81,65 @@ channel-type.haywardomnilogic.filterState.state.option.9 = Filter Superchlorinat
channel-type.haywardomnilogic.filterState.state.option.10 = Filter Force Priming
channel-type.haywardomnilogic.filterState.state.option.11 = Filter Waiting for Pump to Turn Off
channel-type.haywardomnilogic.instantSaltLevel.label = Instant Salt Level
channel-type.haywardomnilogic.instantSaltLevel.description = Instant Salt Level
channel-type.haywardomnilogic.lightBrightness.label = Light Brightness
channel-type.haywardomnilogic.lightBrightness.state.option.0 = 20%
channel-type.haywardomnilogic.lightBrightness.state.option.1 = 40%
channel-type.haywardomnilogic.lightBrightness.state.option.2 = 60%
channel-type.haywardomnilogic.lightBrightness.state.option.3 = 80%
channel-type.haywardomnilogic.lightBrightness.state.option.4 = 100%
channel-type.haywardomnilogic.lightSpeed.label = Light Speed
channel-type.haywardomnilogic.lightSpeed.state.option.0 = 1/16x
channel-type.haywardomnilogic.lightSpeed.state.option.1 = 1/8x
channel-type.haywardomnilogic.lightSpeed.state.option.2 = 1/4x
channel-type.haywardomnilogic.lightSpeed.state.option.3 = 1/2x
channel-type.haywardomnilogic.lightSpeed.state.option.4 = 1x
channel-type.haywardomnilogic.lightSpeed.state.option.5 = 2x
channel-type.haywardomnilogic.lightSpeed.state.option.6 = 4x
channel-type.haywardomnilogic.lightSpeed.state.option.7 = 8x
channel-type.haywardomnilogic.lightSpeed.state.option.8 = 16x
channel-type.haywardomnilogic.lightState.label = Light State
channel-type.haywardomnilogic.lightState.description = Light State
channel-type.haywardomnilogic.lightState.state.option.0 = Off
channel-type.haywardomnilogic.lightState.state.option.1 = On
channel-type.haywardomnilogic.lightState.state.option.4 = 15 Sec White Light
channel-type.haywardomnilogic.lightState.state.option.7 = Powering Off
channel-type.haywardomnilogic.pumpSpeed.label = Pump Speed in %
channel-type.haywardomnilogic.pumpSpeed.description = Pump Speed
channel-type.haywardomnilogic.pumpLastSpeed.label = Last Speed
channel-type.haywardomnilogic.pumpLastSpeed.description = Last pump speed in percentage
channel-type.haywardomnilogic.pumpSpeedPercent.label = Pump Speed
channel-type.haywardomnilogic.pumpSpeedPercent.description = Pump speed in percentage
channel-type.haywardomnilogic.pumpSpeedRpm.label = Pump Speed
channel-type.haywardomnilogic.pumpSpeedRpm.description = Pump speed in rpm
channel-type.haywardomnilogic.pumpSpeedSelect.label = Pump Speed States
channel-type.haywardomnilogic.pumpSpeedSelect.state.option.0 = Off
channel-type.haywardomnilogic.pumpSpeedSelect.state.option.33 = Low
channel-type.haywardomnilogic.pumpSpeedSelect.state.option.66 = Medium
channel-type.haywardomnilogic.pumpSpeedSelect.state.option.100 = High
channel-type.haywardomnilogic.pumpSpeedSelect.state.option.100 = Custom
channel-type.haywardomnilogic.pumpState.label = Pump State
channel-type.haywardomnilogic.pumpState.state.option.0 = Off
channel-type.haywardomnilogic.pumpState.state.option.1 = Running
channel-type.haywardomnilogic.pumpState.state.option.2 = Priming
channel-type.haywardomnilogic.pumpState.state.option.3 = Waiting to Turn Off
channel-type.haywardomnilogic.pumpState.state.option.4 = Waiting to Turn Off Manual
channel-type.haywardomnilogic.pumpState.state.option.5 = Heater Extend
channel-type.haywardomnilogic.pumpState.state.option.6 = Heater Cool Down
channel-type.haywardomnilogic.pumpState.state.option.7 = Suspended
channel-type.haywardomnilogic.pumpState.state.option.8 = CSAD Extend
channel-type.haywardomnilogic.pumpState.state.option.9 = Superchlorinate
channel-type.haywardomnilogic.pumpState.state.option.10 = Force Priming
channel-type.haywardomnilogic.pumpState.state.option.11 = Waiting for Pump to Turn Off
channel-type.haywardomnilogic.scMode.label = scMode
channel-type.haywardomnilogic.scMode.description = scMode
channel-type.haywardomnilogic.scMode.state.option.0 = Off
channel-type.haywardomnilogic.scMode.state.option.1 = Super Chlorinating
channel-type.haywardomnilogic.state.label = Heater State
channel-type.haywardomnilogic.state.description = Heater State
channel-type.haywardomnilogic.state.state.option.0 = Off
channel-type.haywardomnilogic.state.state.option.1 = Heating
channel-type.haywardomnilogic.state.state.option.2 = Paused
channel-type.haywardomnilogic.status.label = Status
channel-type.haywardomnilogic.status.description = Status
channel-type.haywardomnilogic.timedPercent.label = Salt Output (%)
channel-type.haywardomnilogic.timedPercent.description = Current salt output setting for the chlorinator (%).
channel-type.haywardomnilogic.valvePosition.label = Valve Position
channel-type.haywardomnilogic.valvePosition.description = Valve Position
channel-type.haywardomnilogic.valvePosition.state.option.0 = Off
channel-type.haywardomnilogic.valvePosition.state.option.1 = Pool Only
channel-type.haywardomnilogic.valvePosition.state.option.2 = Spa Only
channel-type.haywardomnilogic.valvePosition.state.option.3 = Spill Over
channel-type.haywardomnilogic.waterFlow.label = Flow Sensor
channel-type.haywardomnilogic.waterFlow.description = Flow Sensor
channel-type.haywardomnilogic.waterTemp.label = Water Temp
channel-type.haywardomnilogic.waterTemp.description = Water Temp

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Backyard</label>
<description>The Hayward Backyard</description>
<channels>
<channel id="backyardAirTemp" typeId="airTemp"/>
<channel id="backyardStatus" typeId="backyardstatus"/>
@ -32,14 +31,12 @@
<channel-type id="airTemp">
<item-type>Number:Temperature</item-type>
<label>Air Temp</label>
<description>Air Temp</description>
<state pattern="%d %unit%" readOnly="true"/>
</channel-type>
<channel-type id="backyardstatus">
<item-type>String</item-type>
<label>Status</label>
<description>Status</description>
<state readOnly="true">
<options>
<option value="1">Normal</option>
@ -54,7 +51,6 @@
<channel-type id="backyardstate">
<item-type>String</item-type>
<label>State</label>
<description>State</description>
<state readOnly="true">
<options>
<option value="0">Powered Off</option>
@ -69,8 +65,7 @@
<channel-type id="alarm">
<item-type>String</item-type>
<label>Alarm</label>
<description>Alarm</description>
<state readOnly="true"/>
<state pattern="%s" readOnly="true"/>
</channel-type>
</thing:thing-descriptions>

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Body of Water</label>
<description>The Hayward Body of Water</description>
<channels>
<channel id="bowFlow" typeId="waterFlow"/>
<channel id="bowWaterTemp" typeId="waterTemp"/>
@ -33,14 +32,12 @@
<channel-type id="waterFlow">
<item-type>Switch</item-type>
<label>Flow Sensor</label>
<description>Flow Sensor</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="waterTemp">
<item-type>Number:Temperature</item-type>
<label>Water Temp</label>
<description>Water Temp</description>
<state pattern="%d %unit%" readOnly="true"/>
</channel-type>

View File

@ -25,14 +25,14 @@
<label>Password</label>
<description>The password to connect to the server.</description>
</parameter>
<parameter name="telemetryPollTime" type="integer" min="10" max="60" unit="s" required="true">
<parameter name="telemetryPollTime" type="integer" min="2" max="60" unit="s" required="true">
<label>Telemetry Poll Delay</label>
<default>12</default>
<default>3</default>
<description>How often to request telemetry data from Hayward Server</description>
</parameter>
<parameter name="alarmPollTime" type="integer" min="0" max="120" unit="s" required="true">
<label>Alarm Poll Delay</label>
<default>60</default>
<default>10</default>
<description>How often to request alarm data from Hayward Server. Enter 0 to disable.</description>
</parameter>
</config-description>

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Chlorinator</label>
<description>Chlorinator</description>
<channels>
<channel id="chlorEnable" typeId="system.power"/>
<channel id="chlorOperatingMode" typeId="chlorOperatingMode"/>
@ -20,7 +19,7 @@
<channel id="chlorAlert" typeId="chlorAlert"/>
<channel id="chlorAvgSaltLevel" typeId="avgSaltLevel"/>
<channel id="chlorInstantSaltLevel" typeId="instantSaltLevel"/>
<channel id="chlorStatus" typeId="status"/>
<channel id="chlorStatus" typeId="chlorStatus"/>
</channels>
<properties>
@ -29,6 +28,7 @@
<property name="chlorMode"></property>
<property name="cellType"></property>
<property name="dispenserType"></property>
<property name="thingTypeVersion">1</property>
</properties>
<representation-property>systemID</representation-property>
@ -37,10 +37,8 @@
<channel-type id="chlorOperatingMode">
<item-type>String</item-type>
<label>Operating Mode</label>
<description>Operating Mode</description>
<state readOnly="true">
<options>
<option value="0">Off</option>
<option value="1">Timed Percent</option>
<option value="2">ORP Autosense</option>
</options>
@ -50,14 +48,12 @@
<channel-type id="timedPercent">
<item-type>Number:Dimensionless</item-type>
<label>Salt Output (%)</label>
<description>Current salt output setting for the chlorinator (%).</description>
<state min="0" max="100" step="1.0" pattern="%d %unit%" readOnly="false"/>
<state min="0" max="100" step="1.0" pattern="%d %" readOnly="false"/>
</channel-type>
<channel-type id="scMode">
<item-type>String</item-type>
<label>scMode</label>
<description>scMode</description>
<state readOnly="true">
<options>
<option value="0">Off</option>
@ -67,41 +63,33 @@
</channel-type>
<channel-type id="chlorError">
<item-type>Number</item-type>
<item-type>String</item-type>
<label>Chlorinator Error</label>
<state readOnly="true"/>
<state pattern="%s" readOnly="true"/>
</channel-type>
<channel-type id="chlorAlert">
<item-type>String</item-type>
<label>Chlorinator Alert</label>
<description>Chlorinator Alert</description>
<state readOnly="true">
<options>
<option value="0">None</option>
<option value="16">Low T-Cell Temperature</option>
</options>
<state pattern="%s" readOnly="true">
</state>
</channel-type>
<channel-type id="avgSaltLevel">
<item-type>Number:Dimensionless</item-type>
<label>Average Salt Level</label>
<description>Average Salt Level</description>
<state pattern="%d %unit%" readOnly="true"/>
<state pattern="%,d ppm" readOnly="true"/>
</channel-type>
<channel-type id="instantSaltLevel">
<item-type>Number:Dimensionless</item-type>
<label>Instant Salt Level</label>
<description>Instant Salt Level</description>
<state pattern="%d %unit%" readOnly="true"/>
<state pattern="%,d ppm" readOnly="true"/>
</channel-type>
<channel-type id="status">
<item-type>Number</item-type>
<channel-type id="chlorStatus">
<item-type>String</item-type>
<label>Status</label>
<description>Status</description>
<state pattern="%d" readOnly="true"/>
<state pattern="%s" readOnly="true"/>
</channel-type>
</thing:thing-descriptions>

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Color Logic Light</label>
<description>Color Logic Light</description>
<channels>
<channel id="colorLogicLightEnable" typeId="system.power"/>
<channel id="colorLogicLightState" typeId="lightState"/>
@ -28,7 +27,6 @@
<channel-type id="lightState">
<item-type>String</item-type>
<label>Light State</label>
<description>Light State</description>
<state readOnly="true">
<options>
<option value="0">Off</option>
@ -39,30 +37,42 @@
</state>
</channel-type>
<channel-type id="currentShow">
<channel-type id="lightBrightness">
<item-type>String</item-type>
<label>Current Show</label>
<description>Current Show</description>
<label>Light Brightness</label>
<state readOnly="false">
<options>
<option value="0">Voodoo Lounge</option>
<option value="1">Deep Blue Sea</option>
<option value="2">Royal Blue</option>
<option value="3">Afternoon Sky</option>
<option value="4">Aqua Green</option>
<option value="5">Emerald</option>
<option value="6">Cloud White</option>
<option value="7">Warm Red</option>
<option value="8">Flamingo</option>
<option value="9">Vivid Violet</option>
<option value="10">Sangria</option>
<option value="11">Twilight</option>
<option value="12">Tranquility</option>
<option value="13">Gemstone</option>
<option value="14">USA</option>
<option value="15">Mardi Gras</option>
<option value="16">Cool Cabaret</option>
<option value="0">20%</option>
<option value="1">40%</option>
<option value="2">60%</option>
<option value="3">80%</option>
<option value="4">100%</option>
</options>
</state>
</channel-type>
<channel-type id="lightSpeed">
<item-type>String</item-type>
<label>Light Speed</label>
<state readOnly="false">
<options>
<option value="0">1/16x</option>
<option value="1">1/8x</option>
<option value="2">1/4x</option>
<option value="3">1/2x</option>
<option value="4">1x</option>
<option value="5">2x</option>
<option value="6">4x</option>
<option value="7">8x</option>
<option value="8">16x</option>
</options>
</state>
</channel-type>
<channel-type id="currentShow">
<item-type>String</item-type>
<label>Current Show</label>
<state pattern="%s" readOnly="false">
</state>
</channel-type>
</thing:thing-descriptions>

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Filter</label>
<description>Filter Equipment</description>
<channels>
<channel id="filterEnable" typeId="system.power"/>
<channel id="filterValvePosition" typeId="valvePosition"/>
@ -35,6 +34,7 @@
<property name="highFilterSpeed"></property>
<property name="customFilterSpeed"></property>
<property name="freezeProtectOverrideInterval"></property>
<property name="thingTypeVersion">1</property>
</properties>
<representation-property>systemID</representation-property>
@ -43,7 +43,6 @@
<channel-type id="valvePosition">
<item-type>String</item-type>
<label>Valve Position</label>
<description>Valve Position</description>
<state readOnly="true">
<options>
<option value="0">Off</option>
@ -56,22 +55,21 @@
<channel-type id="filterSpeedPercent">
<item-type>Number:Dimensionless</item-type>
<label>Filter Speed %</label>
<description>Filter Speed (%)</description>
<state min="0" max="100" step="5" pattern="%d %unit%" readOnly="false"/>
<label>Filter Speed</label>
<description>Filter speed in percentage</description>
<state min="0" max="100" step="5" pattern="%d %%" readOnly="false"/>
</channel-type>
<channel-type id="filterSpeedRpm">
<item-type>Number</item-type>
<label>Filter Speed RPM</label>
<description>Filter Speed (RPM)</description>
<state min="0" max="3600" step="200" pattern="%d" readOnly="false"/>
<item-type>Number:Frequency</item-type>
<label>Filter Speed</label>
<description>Filter speed in rpm</description>
<state min="0" max="3600" step="200" pattern="%d rpm" readOnly="false"/>
</channel-type>
<channel-type id="filterSpeedSelect">
<item-type>String</item-type>
<label>Filter Speed States</label>
<description>Filter Speed States</description>
<state readOnly="false">
<options>
<option value="0">Off</option>
@ -86,7 +84,6 @@
<channel-type id="filterState">
<item-type>String</item-type>
<label>Filter State</label>
<description>Filter State</description>
<state readOnly="true">
<options>
<option value="0">Off</option>
@ -108,8 +105,8 @@
<channel-type id="filterLastSpeed">
<item-type>Number:Dimensionless</item-type>
<label>Last Speed</label>
<description>Last Speed (%)</description>
<state pattern="%d %unit%" readOnly="true"/>
<description>Last filter speed in percentage</description>
<state pattern="%d %%" readOnly="true"/>
</channel-type>
</thing:thing-descriptions>

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Heater</label>
<description>Heater</description>
<channels>
<channel id="heaterState" typeId="state"/>
<channel id="heaterEnable" typeId="enable"/>
@ -28,7 +27,6 @@
<channel-type id="state">
<item-type>String</item-type>
<label>Heater State</label>
<description>Heater State</description>
<state readOnly="true">
<options>
<option value="0">Off</option>
@ -41,7 +39,6 @@
<channel-type id="enable">
<item-type>Switch</item-type>
<label>Heater Enable</label>
<description>Heater Enable</description>
<state readOnly="true"/>
</channel-type>

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Pump</label>
<description>Pump</description>
<channels>
<channel id="pumpEnable" typeId="system.power"/>
<channel id="pumpSpeedPercent" typeId="pumpSpeedPercent"/>
@ -33,6 +32,7 @@
<property name="mediumPumpSpeed"></property>
<property name="highPumpSpeed"></property>
<property name="customPumpSpeed"></property>
<property name="thingTypeVersion">1</property>
</properties>
<representation-property>systemID</representation-property>
@ -40,22 +40,21 @@
<channel-type id="pumpSpeedPercent">
<item-type>Number:Dimensionless</item-type>
<label>Pump Speed %</label>
<description>Pump Speed (%)</description>
<state min="0" max="100" step="1" pattern="%d %unit%" readOnly="false"/>
<label>Pump Speed</label>
<description>Pump speed in percentage</description>
<state min="0" max="100" step="1" pattern="%d %%" readOnly="false"/>
</channel-type>
<channel-type id="pumpSpeedRpm">
<item-type>Number:Dimensionless</item-type>
<label>Pump Speed RPM</label>
<description>Pump Speed (RPM)</description>
<state min="0" max="3600" step="200" pattern="%d" readOnly="false"/>
<item-type>Number:Frequency</item-type>
<label>Pump Speed</label>
<description>Pump speed in rpm</description>
<state min="0" max="3600" step="200" pattern="%d rpm" readOnly="false"/>
</channel-type>
<channel-type id="pumpSpeedSelect">
<item-type>String</item-type>
<label>Pump Speed States</label>
<description>Pump Speed States</description>
<state readOnly="false">
<options>
<option value="0">Off</option>
@ -70,7 +69,6 @@
<channel-type id="pumpState">
<item-type>String</item-type>
<label>Pump State</label>
<description>Pump State</description>
<state readOnly="true">
<options>
<option value="0">Off</option>
@ -92,8 +90,8 @@
<channel-type id="pumpLastSpeed">
<item-type>Number:Dimensionless</item-type>
<label>Last Speed</label>
<description>Last Speed (%)</description>
<state pattern="%d %unit%" readOnly="true"/>
<description>Last pump speed in percentage</description>
<state pattern="%d %%" readOnly="true"/>
</channel-type>
</thing:thing-descriptions>

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Relay</label>
<description>Relay</description>
<channels>
<channel id="relayState" typeId="system.power"/>
</channels>

View File

@ -10,7 +10,6 @@
</supported-bridge-type-refs>
<label>Virtual Heater</label>
<description>Virtual Heater</description>
<channels>
<channel id="virtualHeaterEnable" typeId="system.power"/>
@ -30,7 +29,6 @@
<channel-type id="currentSetpoint">
<item-type>Number:Temperature</item-type>
<label>Current Setpoint</label>
<description>Current Setpoint</description>
<category>Temperature</category>
<state min="65" max="90" step="1.0" pattern="%d %unit%" readOnly="false"/>
</channel-type>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
<thing-type uid="haywardomnilogic:chlorinator">
<instruction-set targetVersion="1">
<update-channel id="chlorError">
<type>haywardomnilogic:chlorError</type>
</update-channel>
<update-channel id="chlorStatus">
<type>haywardomnilogic:chlorStatus</type>
</update-channel>
</instruction-set>
</thing-type>
<thing-type uid="haywardomnilogic:filter">
<instruction-set targetVersion="1">
<update-channel id="filterSpeedRpm">
<type>haywardomnilogic:filterSpeedRpm</type>
</update-channel>
</instruction-set>
</thing-type>
<thing-type uid="haywardomnilogic:pump">
<instruction-set targetVersion="1">
<update-channel id="pumpSpeedRpm">
<type>haywardomnilogic:pumpSpeedRpm</type>
</update-channel>
</instruction-set>
</thing-type>
</update:update-descriptions>