[helioseasycontrols] Range checks for bypass dates + documentation fixes (#9117)
Signed-off-by: Bernhard Bauer <bern77@gmail.com>
This commit is contained in:
parent
d0b5267ff3
commit
85af35474f
@ -29,7 +29,7 @@ The following channels are supported:
|
|||||||
| Channel | Channel Group | Description | Item Type | RW |
|
| Channel | Channel Group | Description | Item Type | RW |
|
||||||
| -------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -- |
|
| -------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -- |
|
||||||
| sysdate | general | The KWL's system date and time | DateTime | RW |
|
| sysdate | general | The KWL's system date and time | DateTime | RW |
|
||||||
| summerWinter | general | Indicates if summertime or wintertime is active (OFF = wintertime, ON = summertime) | Switch | RW |
|
| summerWinter | general | Indicates if summertime or wintertime is active (0 = wintertime, 1 = summertime) | Number | RW |
|
||||||
| autoSwUpdate | general | Indicates if automatic software updates are enable | Switch | RW |
|
| autoSwUpdate | general | Indicates if automatic software updates are enable | Switch | RW |
|
||||||
| accessHeliosPortal | general | Indicates if access to Helios portal is enabled | Switch | RW |
|
| accessHeliosPortal | general | Indicates if access to Helios portal is enabled | Switch | RW |
|
||||||
| minFanStage | unitConfig | Minimum fan stage (0 or 1) (0, 1) | Number | RW |
|
| minFanStage | unitConfig | Minimum fan stage (0 or 1) (0, 1) | Number | RW |
|
||||||
@ -39,7 +39,6 @@ The following channels are supported:
|
|||||||
| humidityStopTime | humidityControl | Humidity stop time in hours (0-24) (0 - 24 h) | Number:Time | RW |
|
| humidityStopTime | humidityControl | Humidity stop time in hours (0-24) (0 - 24 h) | Number:Time | RW |
|
||||||
| co2ControlSetValue | co2Control | CO2 control set value (in ppm) (300 - 2000 ppm) | Number:Dimensionless | RW |
|
| co2ControlSetValue | co2Control | CO2 control set value (in ppm) (300 - 2000 ppm) | Number:Dimensionless | RW |
|
||||||
| co2ControlSteps | co2Control | CO2 control steps (in ppm) (50 - 400 ppm) | Number:Dimensionless | RW |
|
| co2ControlSteps | co2Control | CO2 control steps (in ppm) (50 - 400 ppm) | Number:Dimensionless | RW |
|
||||||
| vocControlStatus | vocControl | VOC control status (0 = off, 1 = stepped, 2 = stepless) | Number | RW |
|
|
||||||
| vocControlSetValue | vocControl | VOC control set value (in ppm) (300 - 2000 ppm) | Number:Dimensionless | RW |
|
| vocControlSetValue | vocControl | VOC control set value (in ppm) (300 - 2000 ppm) | Number:Dimensionless | RW |
|
||||||
| vocControlSteps | vocControl | VOC control steps (in ppm) (50 - 400 ppm) | Number:Dimensionless | RW |
|
| vocControlSteps | vocControl | VOC control steps (in ppm) (50 - 400 ppm) | Number:Dimensionless | RW |
|
||||||
| comfortTemp | unitConfig | Comfort Temperature (10.0 - 25.0 °C) | Number:Temperature | RW |
|
| comfortTemp | unitConfig | Comfort Temperature (10.0 - 25.0 °C) | Number:Temperature | RW |
|
||||||
@ -51,7 +50,7 @@ The following channels are supported:
|
|||||||
| standbyModeFanStage | operation | Standby mode fan stage (0 - 4) | Number | RW |
|
| standbyModeFanStage | operation | Standby mode fan stage (0 - 4) | Number | RW |
|
||||||
| standbyModeRemainingTime | operation | Standby mode remaining time (0 - 180 min) | Number:Time | R |
|
| standbyModeRemainingTime | operation | Standby mode remaining time (0 - 180 min) | Number:Time | R |
|
||||||
| standbyModeStatus | operation | Standby mode status | Switch | RW |
|
| standbyModeStatus | operation | Standby mode status | Switch | RW |
|
||||||
| operatingMode | operation | Operating mode (automatic/manual) (OFF = automatic, ON = manual) | Switch | RW |
|
| operatingMode | operation | Operating mode (automatic/manual) (0 = automatic, 1 = manual) | Number | RW |
|
||||||
| fanStage | operation | Fan stage (0 - 4) | Number | RW |
|
| fanStage | operation | Fan stage (0 - 4) | Number | RW |
|
||||||
| percentageFanStage | operation | Fan stage in percent (0 - 100 %) | Number:Dimensionless | R |
|
| percentageFanStage | operation | Fan stage in percent (0 - 100 %) | Number:Dimensionless | R |
|
||||||
| temperatureOutsideAir | general | Ouside air temperature in °C (-27.0 - 9998.9 °C) | Number:Temperature | R |
|
| temperatureOutsideAir | general | Ouside air temperature in °C (-27.0 - 9998.9 °C) | Number:Temperature | R |
|
||||||
@ -104,7 +103,7 @@ The following channels are supported:
|
|||||||
| holidayProgrammeActivationTime | operation | Holiday programme activation time in minutes (5 - 300 min) | Number:Time | RW |
|
| holidayProgrammeActivationTime | operation | Holiday programme activation time in minutes (5 - 300 min) | Number:Time | RW |
|
||||||
| runOnTimeVhzNhz | unitConfig | Stopping time preheater/afterheater in seconds (60 - 120 s) | Number:Time | RW |
|
| runOnTimeVhzNhz | unitConfig | Stopping time preheater/afterheater in seconds (60 - 120 s) | Number:Time | RW |
|
||||||
| errorOutputFunction | unitConfig | Error output function (collective error or just error) (1 = collective error, 2 = only error) | Number | RW |
|
| errorOutputFunction | unitConfig | Error output function (collective error or just error) (1 = collective error, 2 = only error) | Number | RW |
|
||||||
| filterChange | unitConfig | Filter change | Switch | RW |
|
| filterChange | unitConfig | Filter change (0 = No, 1 = Yes) | Number | RW |
|
||||||
| filterChangeInterval | unitConfig | Filter change interval in months (1 - 12) | Number | RW |
|
| filterChangeInterval | unitConfig | Filter change interval in months (1 - 12) | Number | RW |
|
||||||
| filterChangeRemainingTime | general | Filter change remaining time in minutes (1 - 55000 min) | Number:Time | R |
|
| filterChangeRemainingTime | general | Filter change remaining time in minutes (1 - 55000 min) | Number:Time | R |
|
||||||
| bypassRoomTemperature | unitConfig | Bypass room temperature in °C (10 - 40 °C) | Number:Temperature | RW |
|
| bypassRoomTemperature | unitConfig | Bypass room temperature in °C (10 - 40 °C) | Number:Temperature | RW |
|
||||||
@ -131,6 +130,7 @@ The following channels are supported:
|
|||||||
| bypassFrom | unitConfig | Bypass active from | DateTime | RW |
|
| bypassFrom | unitConfig | Bypass active from | DateTime | RW |
|
||||||
| bypassTo | unitConfig | Bypass active to | DateTime | RW |
|
| bypassTo | unitConfig | Bypass active to | DateTime | RW |
|
||||||
|
|
||||||
|
|
||||||
## Thing Actions
|
## Thing Actions
|
||||||
|
|
||||||
### Reset Filter Change Timer
|
### Reset Filter Change Timer
|
||||||
@ -227,6 +227,7 @@ The binding provides the following properties:
|
|||||||
| kwlFtfConfig7 | Humidity/temperature sensor configuration 7 (1 = only humidity, 2 = only temperature, 3 = combined) |
|
| kwlFtfConfig7 | Humidity/temperature sensor configuration 7 (1 = only humidity, 2 = only temperature, 3 = combined) |
|
||||||
| humidityControlStatus | Humidity control status (0 = off, 1 = stepped, 2 = stepless) |
|
| humidityControlStatus | Humidity control status (0 = off, 1 = stepped, 2 = stepless) |
|
||||||
| co2ControlStatus | CO2 control status (0 = off, 1 = stepped, 2 = stepless) |
|
| co2ControlStatus | CO2 control status (0 = off, 1 = stepped, 2 = stepless) |
|
||||||
|
| vocControlStatus | VOC control status (0 = off, 1 = stepped, 2 = stepless) |
|
||||||
| dateFormat | Date format (0 = dd.mm.yyyy, 1 = mm.dd.yyyy, 2 = yyyy.mm.dd) |
|
| dateFormat | Date format (0 = dd.mm.yyyy, 1 = mm.dd.yyyy, 2 = yyyy.mm.dd) |
|
||||||
| heatExchangerType | Heat exchanger type (0 = plastic, 1 = aluminium, 2 = enthalpy) |
|
| heatExchangerType | Heat exchanger type (0 = plastic, 1 = aluminium, 2 = enthalpy) |
|
||||||
| serNo | Serial number |
|
| serNo | Serial number |
|
||||||
@ -276,7 +277,6 @@ The binding provides the following properties:
|
|||||||
| sensorConfigKwlFtf8 | Sensor configuration (installed or not) KWL-FTF 8 (OFF = no sensor, ON = sensor installed) |
|
| sensorConfigKwlFtf8 | Sensor configuration (installed or not) KWL-FTF 8 (OFF = no sensor, ON = sensor installed) |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Full Example
|
## Full Example
|
||||||
|
|
||||||
### Thing Configuration
|
### Thing Configuration
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class HeliosEasyControlsActions implements ThingActions {
|
|||||||
handler.writeValue(variableName, "1");
|
handler.writeValue(variableName, "1");
|
||||||
}
|
}
|
||||||
} catch (HeliosException e) {
|
} catch (HeliosException e) {
|
||||||
logger.warn("Error executing action 'resetFilterChangeTimer': {}", e.getMessage());
|
logger.warn("Error executing action triggering switch for variable {}: {}", variableName, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -96,16 +96,44 @@ public class HeliosEasyControlsHandler extends BaseThingHandler {
|
|||||||
// before reading from device
|
// before reading from device
|
||||||
|
|
||||||
private class BypassDate {
|
private class BypassDate {
|
||||||
|
private final int[] MONTH_MAX_DAYS = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||||
|
|
||||||
// initialization to avoid issues when updating before all variables were read
|
// initialization to avoid issues when updating before all variables were read
|
||||||
private int month = 1;
|
private int month = 1;
|
||||||
private int day = 1;
|
private int day = 1;
|
||||||
|
|
||||||
|
public BypassDate() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public BypassDate(int day, int month) {
|
||||||
|
this.setDay(day);
|
||||||
|
this.setMonth(month);
|
||||||
|
}
|
||||||
|
|
||||||
public void setMonth(int month) {
|
public void setMonth(int month) {
|
||||||
this.month = month;
|
if (month < 1) {
|
||||||
|
this.month = 1;
|
||||||
|
} else if (month > 12) {
|
||||||
|
this.month = 12;
|
||||||
|
} else {
|
||||||
|
this.month = month;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMonth() {
|
||||||
|
return this.month;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDay(int day) {
|
public void setDay(int day) {
|
||||||
this.day = day;
|
if (day < 1) {
|
||||||
|
this.day = 1;
|
||||||
|
} else {
|
||||||
|
this.day = Math.min(day, MONTH_MAX_DAYS[month - 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDay() {
|
||||||
|
return this.day;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTimeType toDateTimeType() {
|
public DateTimeType toDateTimeType() {
|
||||||
@ -551,11 +579,14 @@ public class HeliosEasyControlsHandler extends BaseThingHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void setBypass(boolean from, int day, int month) {
|
protected void setBypass(boolean from, int day, int month) {
|
||||||
|
BypassDate bypassDate = new BypassDate(day, month);
|
||||||
try {
|
try {
|
||||||
this.writeValue(from ? HeliosEasyControlsBindingConstants.BYPASS_FROM_DAY
|
this.writeValue(from ? HeliosEasyControlsBindingConstants.BYPASS_FROM_DAY
|
||||||
: HeliosEasyControlsBindingConstants.BYPASS_TO_DAY, Integer.toString(day));
|
: HeliosEasyControlsBindingConstants.BYPASS_TO_DAY, Integer.toString(bypassDate.getDay()));
|
||||||
this.writeValue(from ? HeliosEasyControlsBindingConstants.BYPASS_FROM_MONTH
|
this.writeValue(
|
||||||
: HeliosEasyControlsBindingConstants.BYPASS_TO_MONTH, Integer.toString(month));
|
from ? HeliosEasyControlsBindingConstants.BYPASS_FROM_MONTH
|
||||||
|
: HeliosEasyControlsBindingConstants.BYPASS_TO_MONTH,
|
||||||
|
Integer.toString(bypassDate.getMonth()));
|
||||||
} catch (HeliosException e) {
|
} catch (HeliosException e) {
|
||||||
logger.warn("{} encountered Exception when trying to set bypass period: {}",
|
logger.warn("{} encountered Exception when trying to set bypass period: {}",
|
||||||
HeliosEasyControlsHandler.class.getSimpleName(), e.getMessage());
|
HeliosEasyControlsHandler.class.getSimpleName(), e.getMessage());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user