]> git.basschouten.com Git - openhab-addons.git/commitdiff
[plugwiseha] Add and enhance channels (#12349)
authorlsiepel <leosiepel@gmail.com>
Wed, 23 Feb 2022 22:52:07 +0000 (23:52 +0100)
committerGitHub <noreply@github.com>
Wed, 23 Feb 2022 22:52:07 +0000 (23:52 +0100)
* Add two-channels, fix scene and docs

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
12 files changed:
bundles/org.openhab.binding.plugwiseha/README.md
bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/PlugwiseHABindingConstants.java
bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/PlugwiseHAController.java
bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionalities.java
bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionality.java
bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/ActuatorFunctionalityThermostat.java
bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/api/model/dto/Location.java
bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAApplianceHandler.java
bundles/org.openhab.binding.plugwiseha/src/main/java/org/openhab/binding/plugwiseha/internal/handler/PlugwiseHAZoneHandler.java
bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/i18n/plugwiseha.properties
bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/channels.xml
bundles/org.openhab.binding.plugwiseha/src/main/resources/OH-INF/thing/thing-types.xml

index f566e97366298f40b2597a005075c6a58144e685..012216ad44489af8c25ec4108214bb9a0300328e 100644 (file)
@@ -19,7 +19,7 @@ The 'Adam' (from hereon called the gateway) needs to be accessible from the open
 | -                                                        | A Plugwise heating zone configured with at least 1 of the devices below                                            | zone                 |
 | [Adam](https://www.plugwise.com/en_US/products/adam-ha)  | The Plugwise Home Automation Bridge is needed to connect to the Adam boiler gateway                                | gateway              |
 | [Tom](https://www.plugwise.com/en_US/products/tom)       | A Plugwise Home Automation radiator valve                                                                          | appliance_valve      |
-| [Floor](https://www.plugwise.com/en_US/products/floor)   | A Plugwise Home Automation radiator valve specifically used for floor heating                                       | appliance_valve      |
+| [Floor](https://www.plugwise.com/en_US/products/floor)   | A Plugwise Home Automation radiator valve specifically used for floor heating                                      | appliance_valve      |
 | [Circle](https://www.plugwise.com/en_US/products/circle) | A power outlet plug that provides energy measurement and switching control of appliances (e.g. floor heating pump) | appliance_pump       |
 | [Lisa](https://www.plugwise.com/en_US/products/lisa)     | A room thermostat (also supports the 'Anna' room thermostat)                                                       | appliance_thermostat |
 | [Boiler]                                                 | A central boiler used for heating and/or domestic hot water                                                        | appliance_boiler     |
@@ -39,7 +39,7 @@ You must define a Plugwise Home Automation gateway (Bridge) before defining zone
 #### Plugwise Home Automation gateway (Bridge):
 
 | Parameter | Description                                                             | Config   | Default |
-| --------- | ----------------------------------------------------------------------- | -------- | ------- |
+|-----------|-------------------------------------------------------------------------|----------|---------|
 | host      | The IP address or hostname of the Adam HA gateway                       | Required | 'adam'  |
 | username  | The username for the Adam HA gateway                                    | Optional | 'smile' |
 | smileID   | The 8 letter code on the sticker on the back of the Adam boiler gateway | Required | -       |
@@ -54,14 +54,14 @@ You must define a Plugwise Home Automation gateway (Bridge) before defining zone
 #### Plugwise Home Automation appliance (`appliance_valve`):
 
 | Parameter            | Description                                                                                                        | Config   | Default |
-| -------------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ------- |
+|----------------------|--------------------------------------------------------------------------------------------------------------------|----------|---------|
 | id                   | The unique ID of the radiator valve appliance                                                                      | Required | -       |
 | lowBatteryPercentage | Battery charge remaining at which to trigger battery low warning. (*Only applicable for battery operated devices*) | Optional | 15      |
 
 #### Plugwise Home Automation appliance (`appliance_thermostat`):
 
 | Parameter            | Description                                                                                                        | Config   | Default |
-| -------------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ------- |
+|----------------------|--------------------------------------------------------------------------------------------------------------------|----------|---------|
 | id                   | The unique ID of the room thermostat appliance                                                                     | Required | -       |
 | lowBatteryPercentage | Battery charge remaining at which to trigger battery low warning. (*Only applicable for battery operated devices*) | Optional | 15      |
 
@@ -75,7 +75,7 @@ You must define a Plugwise Home Automation gateway (Bridge) before defining zone
 #### Plugwise Home Automation boiler (`appliance_boiler`):
 
 | Parameter | Description                 | Config   | Default |
-| --------- | --------------------------- | -------- | ------- |
+|-----------|-----------------------------|----------|---------|
 | id        | The unique ID of the boiler | Required | -       |
 
 ## Channels
@@ -92,9 +92,11 @@ You must define a Plugwise Home Automation gateway (Bridge) before defining zone
 | chState              | Switch             | Yes        | The current central heating state of the boiler                                                                                                                                                      |
 | dhwState             | Switch             | Yes        | The current domestic hot water state of the boiler                                                                                                                                                   |
 | waterPressure        | Number:Pressure    | Yes        | The current water pressure of the boiler                                                                                                                                                             |
-| presetScene          | String             | Yes        | The current active scene for the zone                                                                                                                                                                |
+| presetScene          | String             | No         | The current active scene for the zone                                                                                                                                                                |
+| regulationControl    | String             | No         | Toggle current regulation control (Active, Passive, Off) for the zone                                                                                                                                |
+| coolingAllowed       | Switch             | No         | Toggle the cooling allowed of a zone ON/OFF                                                                                                                                                          |
 | valvePosition        | Number             | Yes        | The current position of the valve                                                                                                                                                                    |
-| preHeat              | Switch             | Yes        | Toggle the pre heating of a zone ON/OFF                                                                                                                                                              |
+| preHeat              | Switch             | No         | Toggle the pre heating of a zone ON/OFF                                                                                                                                                              |
 | coolingState         | Switch             | Yes        | The current cooling state of the boiler                                                                                                                                                              |
 | intendedBoilerTemp   | Number:Temperature | Yes        | The intended boiler temperature                                                                                                                                                                      |
 | flameState           | Switch             | Yes        | The flame state of the boiler                                                                                                                                                                        |
@@ -107,8 +109,6 @@ You must define a Plugwise Home Automation gateway (Bridge) before defining zone
 | dhwSetpoint          | Number:Temperature | Yes        | The domestic hot water setpoint                                                                                                                                                                      |
 | maxBoilerTemperature | Number:Temperature | Yes        | The maximum temperature of the boiler                                                                                                                                                                |
 | dhwComfortMode       | Switch             | Yes        | The domestic hot water confortmode                                                                                                                                                                   |
-                                                                                                                                                         |
-
 
 ## Full Example
 
@@ -131,8 +131,10 @@ Replace `$device_id` accordingly.
 ```
 Number:Temperature living_room_zone_temperature "Zone temperature" {channel="plugwiseha:zone:home:living_room_zone:temperature"}
 Number:Temperature living_room_zone_temperature_setpoint "Zone temperature setpoint" {channel="plugwiseha:zone:home:living_room_zone:setpointTemperature"}
-Number:Temperature living_room_zone_preset_scene "Zone preset scene" {channel="plugwiseha:zone:home:living_room_zone:presetScene"}
+String living_room_zone_preset_scene "Zone preset scene" {channel="plugwiseha:zone:home:living_room_zone:presetScene"}
 Switch living_room_zone_preheat "Zone preheat enabled" {channel="plugwiseha:zone:home:living_room_zone:preHeat"}
+String living_room_zone_cooling "Zone cooling enabled" {channel="plugwiseha:zone:home:living_room_zone:coolingAllowed"}
+String living_room_zone_regulation_control "Zone regulation control" {channel="plugwiseha:zone:home:living_room_zone:regulationControl"}
 
 Number:Temperature living_room_radiator_temperature "Radiator valve temperature" {channel="plugwiseha:appliance_valve:home:living_room_radiator:temperature"}
 Number:Temperature living_room_radiator_temperature_setpoint "Radiator valve temperature setpoint" {channel="plugwiseha:appliance_valve:home:living_room_radiator:setpointTemperature"}
@@ -181,6 +183,8 @@ sitemap plugwiseha label="PlugwiseHA Binding"
                Setpoint item=living_room_zone_temperature_setpoint label="Living room [%.1f °C]" minValue=5.0 maxValue=25 step=0.5
                Text item=living_room_zone_presetScene
                Switch item=living_room_zone_preheat
+               Text item=living_room_zone_regulation_control
+               Switch item=living_room_zone_cooling
 
                Text item=living_room_radiator_temperature
                Setpoint item=living_room_radiator_temperature_setpoint label="Living room [%.1f °C]" minValue=5.0 maxValue=25 step=0.5
index ec97161add12ffe246074d8b8a51f037b0f8b34c..49b77e4370557f907d7efd9c72fc57831a4f573b 100644 (file)
@@ -85,10 +85,12 @@ public class PlugwiseHABindingConstants {
     public static final String LOCATION_PROPERTY_FUNCTIONALITIES = "functionalities";
 
     // List of all Channel IDs
+    public static final String ZONE_COOLING_CHANNEL = "coolingAllowed";
     public static final String ZONE_SETPOINT_CHANNEL = "setpointTemperature";
     public static final String ZONE_TEMPERATURE_CHANNEL = "temperature";
     public static final String ZONE_PRESETSCENE_CHANNEL = "presetScene";
     public static final String ZONE_PREHEAT_CHANNEL = "preHeat";
+    public static final String ZONE_REGULATION_CHANNEL = "regulationControl";
 
     public static final String APPLIANCE_SETPOINT_CHANNEL = "setpointTemperature";
     public static final String APPLIANCE_TEMPERATURE_CHANNEL = "temperature";
index 2b6e4b721080af6313df37af7e423cb561200df6..c46f0a8f09149eb75e3e0061cf7873cd718430ea 100644 (file)
@@ -322,76 +322,80 @@ public class PlugwiseHAController {
         }
     }
 
-    public void switchRelay(Appliance appliance, String state) throws PlugwiseHAException {
-        List<String> allowStates = Arrays.asList("on", "off");
-        if (allowStates.contains(state.toLowerCase())) {
-            if (state.toLowerCase().equals("on")) {
-                switchRelayOn(appliance);
-            } else {
-                switchRelayOff(appliance);
-            }
-        }
+    public void setPreHeating(Location location, Boolean state) throws PlugwiseHAException {
+        PlugwiseHAControllerRequest<Void> request = newRequest(Void.class);
+        Optional<ActuatorFunctionality> thermostat = location.getActuatorFunctionalities().getFunctionalityThermostat();
+
+        request.setPath("/core/locations");
+        request.addPathParameter("id", String.format("%s/thermostat", location.getId()));
+        request.addPathParameter("id", String.format("%s", thermostat.get().getId()));
+        request.setBodyParameter(new ActuatorFunctionalityThermostat(state, null, null));
+
+        executeRequest(request);
     }
 
-    public void setPreHeating(Location location, Boolean state) throws PlugwiseHAException {
+    public void setAllowCooling(Location location, Boolean state) throws PlugwiseHAException {
         PlugwiseHAControllerRequest<Void> request = newRequest(Void.class);
         Optional<ActuatorFunctionality> thermostat = location.getActuatorFunctionalities().getFunctionalityThermostat();
 
         request.setPath("/core/locations");
         request.addPathParameter("id", String.format("%s/thermostat", location.getId()));
         request.addPathParameter("id", String.format("%s", thermostat.get().getId()));
-        request.setBodyParameter(new ActuatorFunctionalityThermostat(state));
+        request.setBodyParameter(new ActuatorFunctionalityThermostat(null, state, null));
 
         executeRequest(request);
     }
 
-    public void switchRelayOn(Appliance appliance) throws PlugwiseHAException {
+    public void setRegulationControl(Location location, String state) throws PlugwiseHAException {
+        List<String> allowStates = Arrays.asList("active", "passive", "off");
+        if (!allowStates.contains(state.toLowerCase())) {
+            this.logger.warn("Trying to set the regulation control to an invalid state");
+            return;
+        }
+
         PlugwiseHAControllerRequest<Void> request = newRequest(Void.class);
+        Optional<ActuatorFunctionality> thermostat = location.getActuatorFunctionalities().getFunctionalityThermostat();
 
-        request.setPath("/core/appliances");
-        request.addPathParameter("id", String.format("%s/relay", appliance.getId()));
-        request.setBodyParameter(new ActuatorFunctionalityRelay("on"));
+        request.setPath("/core/locations");
+        request.addPathParameter("id", String.format("%s/thermostat", location.getId()));
+        request.addPathParameter("id", String.format("%s", thermostat.get().getId()));
+        request.setBodyParameter(new ActuatorFunctionalityThermostat(null, null, state));
 
         executeRequest(request);
     }
 
-    public void switchRelayOff(Appliance appliance) throws PlugwiseHAException {
+    public void setRelay(Appliance appliance, Boolean state) throws PlugwiseHAException {
         PlugwiseHAControllerRequest<Void> request = newRequest(Void.class);
 
         request.setPath("/core/appliances");
         request.addPathParameter("id", String.format("%s/relay", appliance.getId()));
-        request.setBodyParameter(new ActuatorFunctionalityRelay("off"));
+        request.setBodyParameter(new ActuatorFunctionalityRelay(state ? "on" : "off"));
 
         executeRequest(request);
     }
 
-    public void switchRelayLock(Appliance appliance, String state) throws PlugwiseHAException {
-        List<String> allowStates = Arrays.asList("on", "off");
-        if (allowStates.contains(state.toLowerCase())) {
-            if (state.toLowerCase().equals("on")) {
-                switchRelayLockOn(appliance);
-            } else {
-                switchRelayLockOff(appliance);
-            }
-        }
-    }
-
-    public void switchRelayLockOff(Appliance appliance) throws PlugwiseHAException {
+    public void setRelayLock(Appliance appliance, Boolean state) throws PlugwiseHAException {
         PlugwiseHAControllerRequest<Void> request = newRequest(Void.class);
 
         request.setPath("/core/appliances");
         request.addPathParameter("id", String.format("%s/relay", appliance.getId()));
-        request.setBodyParameter(new ActuatorFunctionalityRelay(null, false));
+        request.setBodyParameter(new ActuatorFunctionalityRelay(null, state));
 
         executeRequest(request);
     }
 
-    public void switchRelayLockOn(Appliance appliance) throws PlugwiseHAException {
+    public void setPresetScene(Location location, String state) throws PlugwiseHAException {
+        List<String> allowStates = Arrays.asList("home", "asleep", "away", "vacation", "no_frost");
+        if (!allowStates.contains(state.toLowerCase())) {
+            this.logger.warn("Trying to set the preset scene to an invalid state");
+            return;
+        }
+
         PlugwiseHAControllerRequest<Void> request = newRequest(Void.class);
 
-        request.setPath("/core/appliances");
-        request.addPathParameter("id", String.format("%s/relay", appliance.getId()));
-        request.setBodyParameter(new ActuatorFunctionalityRelay(null, true));
+        request.setPath("/core/locations");
+        request.addPathParameter("id", String.format("%s", location.getId()));
+        request.setBodyParameter(new Location(state));
 
         executeRequest(request);
     }
index 2f9ff67f939488433ca26e3b0053ca00e8cf9449..4d4ec3081adfaa96d7517b1d6126b6d40b374279 100644 (file)
@@ -35,6 +35,15 @@ public class ActuatorFunctionalities extends PlugwiseHACollection<ActuatorFuncti
                 .map(Boolean::parseBoolean);
     }
 
+    public Optional<String> getRegulationControl() {
+        return this.getFunctionalityThermostat().flatMap(ActuatorFunctionality::getRegulationControl);
+    }
+
+    public Optional<Boolean> getCoolingAllowed() {
+        return this.getFunctionalityThermostat().flatMap(ActuatorFunctionality::getCoolingAllowed)
+                .map(Boolean::parseBoolean);
+    }
+
     public Optional<Boolean> getPreHeatState() {
         return this.getFunctionalityThermostat().flatMap(ActuatorFunctionality::getPreHeatState)
                 .map(Boolean::parseBoolean);
index ab4013be5fbd736e242a5a4ba4c6a68cd7dffcb4..d42ff7ddef0f59ae6696937dc57c52f58dafb1cb 100644 (file)
@@ -35,6 +35,12 @@ public class ActuatorFunctionality extends PlugwiseBaseModel implements Plugwise
     private String resolution;
     private String lock;
 
+    @XStreamAlias("regulation_control")
+    private String regulationControl;
+
+    @XStreamAlias("cooling_allowed")
+    private String coolingAllowed;
+
     @XStreamAlias("preheating_allowed")
     private String preHeat;
 
@@ -75,6 +81,14 @@ public class ActuatorFunctionality extends PlugwiseBaseModel implements Plugwise
         return updatedDate;
     }
 
+    public Optional<String> getRegulationControl() {
+        return Optional.ofNullable(regulationControl);
+    }
+
+    public Optional<String> getCoolingAllowed() {
+        return Optional.ofNullable(coolingAllowed);
+    }
+
     public Optional<String> getPreHeatState() {
         return Optional.ofNullable(preHeat);
     }
index fda093981686e8c7b4f1c8e0b669aaabd2dfc910..311be627ab800bf792d2ebd4ca7cdb2dad1cf8a4 100644 (file)
@@ -28,11 +28,22 @@ public class ActuatorFunctionalityThermostat extends ActuatorFunctionality {
     @XStreamAlias("preheating_allowed")
     private Boolean preheatingAllowed;
 
+    @SuppressWarnings("unused")
+    @XStreamAlias("cooling_allowed")
+    private Boolean coolingAllowed;
+
+    @SuppressWarnings("unused")
+    @XStreamAlias("regulation_control")
+    private String regulationControl;
+
     public ActuatorFunctionalityThermostat(Double temperature) {
         this.setpoint = temperature;
     }
 
-    public ActuatorFunctionalityThermostat(Boolean preheatingAllowed) {
+    public ActuatorFunctionalityThermostat(Boolean preheatingAllowed, Boolean coolingAllowed,
+            String regulationControl) {
         this.preheatingAllowed = preheatingAllowed;
+        this.coolingAllowed = coolingAllowed;
+        this.regulationControl = regulationControl;
     }
 }
index c91e4fc22c06b66e9451266b4298cde9b64b40df..521849dc412358e71533d2a7274429dd6b98ac76 100644 (file)
@@ -47,6 +47,10 @@ public class Location extends PlugwiseBaseModel implements PlugwiseComparableDat
     @XStreamImplicit(itemFieldName = "actuator_functionality", keyFieldName = "type")
     private ActuatorFunctionalities actuatorFunctionalities;
 
+    public Location(String presetScene) {
+        this.preset = presetScene;
+    }
+
     public String getName() {
         return name;
     }
@@ -101,6 +105,14 @@ public class Location extends PlugwiseBaseModel implements PlugwiseComparableDat
         return this.actuatorFunctionalities.getPreHeatState();
     }
 
+    public Optional<Boolean> getCoolingAllowed() {
+        return this.actuatorFunctionalities.getCoolingAllowed();
+    }
+
+    public Optional<String> getRegulationControl() {
+        return this.actuatorFunctionalities.getRegulationControl();
+    }
+
     public int applianceCount() {
         if (this.locationAppliances == null) {
             return 0;
index 0773ff462749c4b892ba2925e7728ffa546474da..9a2df943742097bc308cc05c62b927c3021b4614 100644 (file)
@@ -142,11 +142,7 @@ public class PlugwiseHAApplianceHandler extends PlugwiseHABaseHandler<Appliance,
             case APPLIANCE_LOCK_CHANNEL:
                 if (command instanceof OnOffType) {
                     try {
-                        if (command == OnOffType.ON) {
-                            controller.switchRelayLockOn(entity);
-                        } else {
-                            controller.switchRelayLockOff(entity);
-                        }
+                        controller.setRelay(entity, (command == OnOffType.ON));
                     } catch (PlugwiseHAException e) {
                         logger.warn("Unable to switch relay lock {} for appliance '{}'", (State) command,
                                 entity.getName());
@@ -173,11 +169,7 @@ public class PlugwiseHAApplianceHandler extends PlugwiseHABaseHandler<Appliance,
             case APPLIANCE_POWER_CHANNEL:
                 if (command instanceof OnOffType) {
                     try {
-                        if (command == OnOffType.ON) {
-                            controller.switchRelayOn(entity);
-                        } else {
-                            controller.switchRelayOff(entity);
-                        }
+                        controller.setRelay(entity, command == OnOffType.ON);
                     } catch (PlugwiseHAException e) {
                         logger.warn("Unable to switch relay {} for appliance '{}'", (State) command, entity.getName());
                     }
index 182debb1b0ba382b1f49b6d0bd2b5f35bf3d9890..658cf016737a6ea79a02e031d2e0aa0a066520c6 100644 (file)
@@ -118,6 +118,16 @@ public class PlugwiseHAZoneHandler extends PlugwiseHABaseHandler<Location, Plugw
             PlugwiseHAController controller = bridge.getController();
             if (controller != null) {
                 switch (channelID) {
+                    case ZONE_COOLING_CHANNEL:
+                        if (command instanceof OnOffType) {
+                            try {
+                                controller.setAllowCooling(entity, command == OnOffType.ON);
+                            } catch (PlugwiseHAException e) {
+                                logger.warn("Unable to switch allow cooling {} for zone '{}'", (State) command,
+                                        entity.getName());
+                            }
+                        }
+                        break;
                     case ZONE_SETPOINT_CHANNEL:
                         if (command instanceof QuantityType) {
                             Unit<Temperature> unit = entity.getSetpointTemperatureUnit().orElse(UNIT_CELSIUS)
@@ -143,6 +153,26 @@ public class PlugwiseHAZoneHandler extends PlugwiseHABaseHandler<Location, Plugw
                             }
                         }
                         break;
+                    case ZONE_REGULATION_CHANNEL:
+                        if (command instanceof StringType) {
+                            try {
+                                controller.setRegulationControl(entity, command.toString());
+                            } catch (PlugwiseHAException e) {
+                                logger.warn("Unable to switch regulation control {} for zone '{}'", (State) command,
+                                        entity.getName());
+                            }
+                        }
+                        break;
+                    case ZONE_PRESETSCENE_CHANNEL:
+                        if (command instanceof StringType) {
+                            try {
+                                controller.setPresetScene(entity, command.toString());
+                            } catch (PlugwiseHAException e) {
+                                logger.warn("Unable to switch preset scene {} for zone '{}'", (State) command,
+                                        entity.getName());
+                            }
+                        }
+                        break;
                     default:
                         logger.warn("Ignoring unsupported command = {} for channel = {}", command, channelUID);
                 }
@@ -153,8 +183,10 @@ public class PlugwiseHAZoneHandler extends PlugwiseHABaseHandler<Location, Plugw
     private State getDefaultState(String channelID) {
         State state = UnDefType.NULL;
         switch (channelID) {
+            case ZONE_COOLING_CHANNEL:
             case ZONE_PREHEAT_CHANNEL:
             case ZONE_PRESETSCENE_CHANNEL:
+            case ZONE_REGULATION_CHANNEL:
             case ZONE_SETPOINT_CHANNEL:
             case ZONE_TEMPERATURE_CHANNEL:
                 state = UnDefType.NULL;
@@ -169,6 +201,12 @@ public class PlugwiseHAZoneHandler extends PlugwiseHABaseHandler<Location, Plugw
         State state = getDefaultState(channelID);
 
         switch (channelID) {
+            case ZONE_COOLING_CHANNEL:
+                Optional<Boolean> allowCoolingState = entity.getCoolingAllowed();
+                if (allowCoolingState.isPresent()) {
+                    state = OnOffType.from(allowCoolingState.get());
+                }
+                break;
             case ZONE_PREHEAT_CHANNEL:
                 Optional<Boolean> preHeatState = entity.getPreHeatState();
                 if (preHeatState.isPresent()) {
@@ -185,6 +223,9 @@ public class PlugwiseHAZoneHandler extends PlugwiseHABaseHandler<Location, Plugw
                     state = new QuantityType<Temperature>(entity.getSetpointTemperature().get(), unit);
                 }
                 break;
+            case ZONE_REGULATION_CHANNEL:
+                state = new StringType(entity.getRegulationControl().orElse(null));
+                break;
             case ZONE_TEMPERATURE_CHANNEL:
                 if (entity.getTemperature().isPresent()) {
                     Unit<Temperature> unit = entity.getTemperatureUnit().orElse(UNIT_CELSIUS).equals(UNIT_CELSIUS)
index dba13ae55db8d2e0d381fd14a43efe72850976b1..d45afdc7b3836663d0db7160761979c3c521b3b4 100644 (file)
@@ -49,6 +49,8 @@ channel-type.plugwiseha.boilerTemperature.label = Boiler Temperature
 channel-type.plugwiseha.boilerTemperature.description = Gets the temperature of this boiler
 channel-type.plugwiseha.chState.label = Central Heating Active
 channel-type.plugwiseha.chState.description = Is the boiler active for central heating, On or OFF
+channel-type.plugwiseha.coolingAllowed.label = Cooling Allowed
+channel-type.plugwiseha.coolingAllowed.description = Switch the cooling allowed of a zone ON or OFF
 channel-type.plugwiseha.coolingState.label = Cooling State
 channel-type.plugwiseha.coolingState.description = Is the boiler active for cooling, On or OFF
 channel-type.plugwiseha.dhwComfortMode.label = Domestic Hot Water Comfort Mode
@@ -83,7 +85,17 @@ channel-type.plugwiseha.powerUsage.label = Power Usage
 channel-type.plugwiseha.preHeat.label = Preheat
 channel-type.plugwiseha.preHeat.description = Switch the preheating of a zone ON or OFF
 channel-type.plugwiseha.presetScene.label = Preset Scene
-channel-type.plugwiseha.presetScene.description = Gets the preset scene of the zone
+channel-type.plugwiseha.presetScene.description = Gets or sets the preset scene of the zone
+channel-type.plugwiseha.presetScene.state.option.home = Home
+channel-type.plugwiseha.presetScene.state.option.asleep = A Sleep
+channel-type.plugwiseha.presetScene.state.option.away = Away
+channel-type.plugwiseha.presetScene.state.option.vacation = Vacation
+channel-type.plugwiseha.presetScene.state.option.no_frost = No Frost
+channel-type.plugwiseha.regulationControl.label = Regulation Control
+channel-type.plugwiseha.regulationControl.description = Switch the regulation control of a zone to Active, Passive or Off
+channel-type.plugwiseha.regulationControl.state.option.active = Active
+channel-type.plugwiseha.regulationControl.state.option.passive = Passive
+channel-type.plugwiseha.regulationControl.state.option.off = Off
 channel-type.plugwiseha.setpointTemperature.label = Setpoint Temperature
 channel-type.plugwiseha.setpointTemperature.description = Gets or sets the set point of this zone
 channel-type.plugwiseha.temperature.label = Zone Temperature
index 7f57acc9717ab4886087a819caa1f6f766173fcc..5c605deca47625ceb27d66fd031c6d63d4698b1d 100644 (file)
                <category>switch</category>
        </channel-type>
 
+       <channel-type id="coolingAllowed">
+               <item-type>Switch</item-type>
+               <label>Cooling Allowed</label>
+               <description>Switch the cooling allowed of a zone ON or OFF</description>
+               <category>switch</category>
+       </channel-type>
+
+       <channel-type id="regulationControl">
+               <item-type>String</item-type>
+               <label>Regulation Control</label>
+               <description>Switch the regulation control of a zone to Active, Passive or Off</description>
+               <category>switch</category>
+               <state>
+                       <options>
+                               <option value="active">Active</option>
+                               <option value="passive">Passive</option>
+                               <option value="off">Off</option>
+                       </options>
+               </state>
+       </channel-type>
+
        <channel-type id="power">
                <item-type>Switch</item-type>
                <label>Power</label>
        <channel-type id="presetScene">
                <item-type>String</item-type>
                <label>Preset Scene</label>
-               <description>Gets the preset scene of the zone</description>
+               <description>Gets or sets the preset scene of the zone</description>
                <category>heating</category>
-               <state readOnly="true"/>
+               <state>
+                       <options>
+                               <option value="home">Home</option>
+                               <option value="asleep">A Sleep</option>
+                               <option value="away">Away</option>
+                               <option value="vacation">Vacation</option>
+                               <option value="no_frost">No Frost</option>
+                       </options>
+               </state>
        </channel-type>
 
        <channel-type id="valvePosition">
index 11d3b11e4b31692b7ad71b052b99fcef8ca616ab..53d8754b25f3686d215eec9b799269ce06ca1cf6 100644 (file)
@@ -58,6 +58,8 @@
                        <channel id="temperature" typeId="temperature"/>
                        <channel id="presetScene" typeId="presetScene"/>
                        <channel id="preHeat" typeId="preHeat"/>
+                       <channel id="coolingAllowed" typeId="coolingAllowed"/>
+                       <channel id="regulationControl" typeId="regulationControl"/>
                </channels>
 
                <representation-property>id</representation-property>