]> git.basschouten.com Git - openhab-addons.git/commitdiff
[somfytahoma] Added support for the thermostatic valve (#9122)
authorOndrej Pecta <opecta@gmail.com>
Fri, 27 Nov 2020 07:29:37 +0000 (08:29 +0100)
committerGitHub <noreply@github.com>
Fri, 27 Nov 2020 07:29:37 +0000 (08:29 +0100)
Signed-off-by: Ondrej Pecta <opecta@gmail.com>
18 files changed:
bundles/org.openhab.binding.somfytahoma/README.md
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaException.java [deleted file]
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaHandlerFactory.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGateHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHeatingSystemHandler.java [deleted file]
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPodHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaThermostatHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaValveHeatingSystemHandler.java [new file with mode: 0644]
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaZwaveHeatingSystemHandler.java [new file with mode: 0644]
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/gate.xml
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/heatingsystem.xml
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/thermostat.xml
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/valveheatingsystem.xml [new file with mode: 0644]

index 8531794da5ed1942da5652a73b91e8b16315935c..86f37019ea2d38e462ef8300d7ffc15ab405b941 100644 (file)
@@ -31,6 +31,7 @@ home automation systems.
 - electricity sensors (get energy consumption)
 - door locks (LOCK/UNLOCK, OPEN/CLOSE commands)
 - heating systems (control temperature, set heating level)
+- valve heating systems (control temperature, derogation mode and temperature)
 - exterior heating systems (set heating level)
 - alarms (both interior/external)
 - pods
@@ -62,63 +63,67 @@ Please see the example below.
 
 ## Channels
 
-| Thing                                                                         |        Channel        | Note                                                                                                                          |
-|-------------------------------------------------------------------------------|:---------------------:|-------------------------------------------------------------------------------------------------------------------------------|
-| bridge                                                                        |           N.A           | bridge does not expose any channel                                                                                          |
-| gateway                                                                       |          status         | status of your Tahoma gateway                                                                                               |
-| gate                                                                          |       gate_command      | used for controlling your gate (open, close, stop, pedestrian)                                                              |
-| gate                                                                          |        gate_state       | get state of your gate                                                                                                      |
-| roller shutter, screen, venetian blind, garage door, awning, pergola, curtain |         control         | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/MY/STOP + closure 0-100                                |
-| window                                                                        |         control         | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/STOP + closure 0-100                                   |
-| silent roller shutter                                                         |      silent_control     | similar to control channel but in silent mode                                                                               |
-| venetian blind, adjustable slats roller shutter                               |       orientation       | percentual orientation of the blind's slats, it can have value 0-100. For IO Homecontrol devices only (non RTS)             |
-| venetian blind, adjustable slats roller shutter                               |   closure_orientation   | percentual closure and orientation of the blind's slats, it can have value 0-100. For IO Homecontrol devices only (non RTS) |
-| adjustable slats roller shutter                                               |          rocker         | used for setting the rocker position of the roller shutter, the only position allowing the slats control                    |
-| action group                                                                  |      execute_action     | switch which reacts to ON command and triggers the predefined Tahoma action                                                 |
-| onoff, light                                                                  |          switch         | reacts to standard ON/OFF commands                                                                                          |
-| dimmer light                                                                  |     light_intensity     | sets/gets intensity of the dimmer light or ON/OFF                                                                           |
-| smoke sensor, occupancy sensor, contact sensor & water sensor                 |         contact         | normal value is CLOSE, changes to OPEN when detection triggered                                                             |
-| smoke sensor, occupancy sensor, contact sensor & water sensor                 |      sensor_defect      | indicates the health of the sensor (dead, lowBatter, maintenanceRequired, noDefect)                                         |
-| smoke sensor                                                                  |      radio_battery      | maintenance radio part battery state (low, normal)                                                                          |
-| smoke sensor                                                                  |      sensor_battery     | maintenance sensor part battery state (absence, low, normal)                                                                |
-| smoke sensor                                                                  |       short_check       | triggering the smoke sensor's short check                                                                                   |
-| smoke sensor                                                                  |        long_check       | triggering the smoke sensor's long check                                                                                    |
-| light sensor                                                                  |        luminance        | light luminance value in luxes                                                                                              |
-| electricity sensor                                                            |    energy_consumption   | energy consumption value in watts                                                                                           |
-| humidity sensor                                                               |         humidity        | current relative humidity                                                                                                   |
-| dock                                                                          |      battery_status     | indicates running on battery (yes/no)                                                                                       |
-| dock                                                                          |      battery_level      | remaining battery percentage                                                                                                |
-| dock                                                                          |       siren_status      | used for controlling and getting siren state (on, off, cyclic)                                                              |
-| dock                                                                          |        short_beep       | testing of dock's siren - short beep                                                                                        |
-| dock                                                                          |        long_beep        | testing of dock's siren - long beep                                                                                         |
-| siren                                                                         |         battery         | battery level full/low/normal/verylow                                                                                       |
-| siren                                                                         |          onoff          | controlling siren status ON/OFF                                                                                             |
-| siren                                                                         |     memorized_volume    | setting memorized volume (normal/highest)                                                                                   |
-| pod                                                                           |      cyclic_button      | pod cyclic button state                                                                                                     |
-| pod                                                                           |      battery_status     | pod battery status state                                                                                                    |
-| pod                                                                           |  lighting_led_pod_mode  | lighting LED pod mod state                                                                                                  |
-| interior alarm                                                                |      alarm_command      | used for sending commands to Somfy alarm device                                                                             |
-| interior alarm                                                                |    intrusion_control    | used for alarm external intrusion controlling                                                                               |
-| interior alarm, myfox alarm                                                   |       alarm_state       | state of the Somfy alarm                                                                                                    |
-| interior alarm                                                                |    target_alarm_state   | target state of the Somfy alarm                                                                                             |
-| interior alarm, myfox alarm                                                   |     intrusion_state     | intrusion state of the Somfy alarm                                                                                          |
-| external alarm                                                                |    active_zones_state   | state of external alarm active zones                                                                                        |
-| door lock                                                                     |           lock          | switch representing unlocked/locked state                                                                                   |
-| door lock                                                                     |           open          | switch representing open/close state                                                                                        |
-| on/off heating system                                                         |   target_heating_level  | target heating level (off, eco, comfort, frostprotection)                                                                   |
-| heating system                                                                |   current_temperature   | current temperature of the heating system                                                                                   |
-| heating system                                                                |      current_state      | current state of the heating system                                                                                         |
-| heating system, thermostat                                                    |    target_temperature   | target temperature of the heating system                                                                                    |
-| heating system, thermostat                                                    |      battery_level      | battery level of the heating system                                                                                         |
-| exterior heating system                                                       |      heating_level      | heating level of the exterior heating system or ON/OFF                                                                      |
-| thermostat                                                                    |       heating_mode      | standard heating mode of the thermostat (away, freeze, manual, ...)                                                         |
-| thermostat                                                                    | derogation_heating_mode | derogation heating mode of the thermostat (away, freeze, manual, ...)                                                       |
-| thermostat                                                                    |  derogation_activation  | derogation activation state (inactive, active)                                                                              |
-| temperature sensor                                                            |       temperature       | temperature reported by the sensor                                                                                          |
-| myfox camera, myfox alarm                                                     |       cloud_status      | cloud connection status                                                                                                     |
-| myfox camera                                                                  |          shutter        | controlling of the camera shutter                                                                                           |
-| myfox alarm                                                                   |   myfox_alarm_command   | used for sending commands to Somfy Myfox alarm device                                                                       |
-
+| Thing                                                                         | Channel                      | Note                                                                                                                        |
+|-------------------------------------------------------------------------------|------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
+| bridge                                                                        | N.A                          | bridge does not expose any channel                                                                                          |
+| gateway                                                                       | status                       | status of your Tahoma gateway                                                                                               |
+| gate                                                                          | gate_command                 | used for controlling your gate (open, close, stop, pedestrian)                                                              |
+| gate                                                                          | gate_state                   | get state of your gate (open, closed, pedestrian)                                                                           |
+| gate                                                                          | gate_position                | get position (0-100%) of your gate (where supported)                                                                        |
+| roller shutter, screen, venetian blind, garage door, awning, pergola, curtain | control                      | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/MY/STOP + closure 0-100                                |
+| window                                                                        | control                      | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/STOP + closure 0-100                                   |
+| silent roller shutter                                                         | silent_control               | similar to control channel but in silent mode                                                                               |
+| venetian blind, adjustable slats roller shutter                               | orientation                  | percentual orientation of the blind's slats, it can have value 0-100. For IO Homecontrol devices only (non RTS)             |
+| venetian blind, adjustable slats roller shutter                               | closure_orientation          | percentual closure and orientation of the blind's slats, it can have value 0-100. For IO Homecontrol devices only (non RTS) |
+| adjustable slats roller shutter                                               | rocker                       | used for setting the rocker position of the roller shutter, the only position allowing the slats control                    |
+| action group                                                                  | execute_action               | switch which reacts to ON command and triggers the predefined Tahoma action                                                 |
+| onoff, light                                                                  | switch                       | reacts to standard ON/OFF commands                                                                                          |
+| dimmer light                                                                  | light_intensity              | sets/gets intensity of the dimmer light or ON/OFF                                                                           |
+| smoke sensor, occupancy sensor, contact sensor & water sensor                 | contact                      | normal value is CLOSE, changes to OPEN when detection triggered                                                             |
+| smoke sensor, occupancy sensor, contact sensor & water sensor                 | sensor_defect                | indicates the health of the sensor (dead, lowBatter, maintenanceRequired, noDefect)                                         |
+| smoke sensor                                                                  | radio_battery                | maintenance radio part battery state (low, normal)                                                                          |
+| smoke sensor                                                                  | sensor_battery               | maintenance sensor part battery state (absence, low, normal)                                                                |
+| smoke sensor                                                                  | short_check                  | triggering the smoke sensor's short check                                                                                   |
+| smoke sensor                                                                  | long_check                   | triggering the smoke sensor's long check                                                                                    |
+| light sensor                                                                  | luminance                    | light luminance value in luxes                                                                                              |
+| electricity sensor                                                            | energy_consumption           | energy consumption value in watts                                                                                           |
+| humidity sensor                                                               | humidity                     | current relative humidity                                                                                                   |
+| dock                                                                          | battery_status               | indicates running on battery (yes/no)                                                                                       |
+| dock                                                                          | battery_level                | remaining battery percentage                                                                                                |
+| dock                                                                          | siren_status                 | used for controlling and getting siren state (on, off, cyclic)                                                              |
+| dock                                                                          | short_beep                   | testing of dock's siren - short beep                                                                                        |
+| dock                                                                          | long_beep                    | testing of dock's siren - long beep                                                                                         |
+| siren                                                                         | battery                      | battery level full/low/normal/verylow                                                                                       |
+| siren                                                                         | onoff                        | controlling siren status ON/OFF                                                                                             |
+| siren                                                                         | memorized_volume             | setting memorized volume (normal/highest)                                                                                   |
+| pod                                                                           | cyclic_button                | pod cyclic button state                                                                                                     |
+| pod                                                                           | battery_status               | pod battery status state                                                                                                    |
+| pod                                                                           | lighting_led_pod_mode        | lighting LED pod mod state                                                                                                  |
+| interior alarm                                                                | alarm_command                | used for sending commands to Somfy alarm device                                                                             |
+| interior alarm                                                                | intrusion_control            | used for alarm external intrusion controlling                                                                               |
+| interior alarm, myfox alarm                                                   | alarm_state                  | state of the Somfy alarm                                                                                                    |
+| interior alarm                                                                | target_alarm_state           | target state of the Somfy alarm                                                                                             |
+| interior alarm, myfox alarm                                                   | intrusion_state              | intrusion state of the Somfy alarm                                                                                          |
+| external alarm                                                                | active_zones_state           | state of external alarm active zones                                                                                        |
+| door lock                                                                     | lock                         | switch representing unlocked/locked state                                                                                   |
+| door lock                                                                     | open                         | switch representing open/close state                                                                                        |
+| on/off heating system                                                         | target_heating_level         | target heating level (off, eco, comfort, frostprotection)                                                                   |
+| heating system                                                                | current_temperature          | current temperature of the heating system                                                                                   |
+| heating system                                                                | current_state                | current state of the heating system                                                                                         |
+| heating system, valve heating system, thermostat                              | target_temperature           | target temperature of the heating system                                                                                    |
+| heating system, valve heating system, thermostat                              | battery_level                | battery level of the heating system                                                                                         |
+| valve heating system, thermostat                                              | derogation_heating_mode      | derogation heating mode of the thermostat (away, freeze, manual, ...)                                                       |
+| valve heating system, thermostat                                              | derogated_target_temperature | target temperature of the heating system                                                                                    |
+| valve heating system                                                          | current_heating_mode         | current heating mode of the thermostatic valve                                                                              |
+| valve heating system                                                          | open_closed_valve            | current open/closed state of the thermostatic valve                                                                         |
+| valve heating system                                                          | operating mode               | operating mode of the thermostatic valve                                                                                    |
+| thermostat                                                                    | heating_mode                 | standard heating mode of the thermostat (away, freeze, manual, ...)                                                         |
+| thermostat                                                                    | derogation_activation        | derogation activation state (inactive, active)                                                                              |
+| exterior heating system                                                       | heating_level                | heating level of the exterior heating system or ON/OFF                                                                      |
+| temperature sensor                                                            | temperature                  | temperature reported by the sensor                                                                                          |
+| myfox camera, myfox alarm                                                     | cloud_status                 | cloud connection status                                                                                                     |
+| myfox camera                                                                  | shutter                      | controlling of the camera shutter                                                                                           |
+| myfox alarm                                                                   | myfox_alarm_command          | used for sending commands to Somfy Myfox alarm device                                                                       |
 
 ### Remarks
 
index 5f832a102bddfdbdbb567fa375b990096142bed4..abcaad01c2bd5910aa0a06e56594186e5b94720e 100644 (file)
@@ -106,7 +106,9 @@ public class SomfyTahomaBindingConstants {
     public static final ThingTypeUID THING_TYPE_POD = new ThingTypeUID(BINDING_ID, "pod");
 
     // Heating system
-    public static final ThingTypeUID THING_TYPE_HEATING_SYSTEM = new ThingTypeUID(BINDING_ID, "heatingsystem");
+    public static final ThingTypeUID THING_TYPE_VALVE_HEATING_SYSTEM = new ThingTypeUID(BINDING_ID,
+            "valveheatingsystem");
+    public static final ThingTypeUID THING_TYPE_ZWAVE_HEATING_SYSTEM = new ThingTypeUID(BINDING_ID, "heatingsystem");
     public static final ThingTypeUID THING_TYPE_ONOFF_HEATING_SYSTEM = new ThingTypeUID(BINDING_ID,
             "onoffheatingsystem");
     public static final ThingTypeUID THING_TYPE_EXTERIOR_HEATING_SYSTEM = new ThingTypeUID(BINDING_ID,
@@ -220,15 +222,24 @@ public class SomfyTahomaBindingConstants {
 
     // Thermostat
     public static final String HEATING_MODE = "heating_mode";
-    public static final String DEROGATION_HEATING_MODE = "derogation_heating_mode";
     public static final String DEROGATION_ACTIVATION = "derogation_activation";
 
+    // Thermostat & Valve Heating system
+    public static final String DEROGATED_TARGET_TEMPERATURE = "derogated_target_temperature";
+    public static final String DEROGATION_HEATING_MODE = "derogation_heating_mode";
+
+    // Valve heating system
+    public static final String CURRENT_HEATING_MODE = "current_heating_mode";
+    public static final String OPEN_CLOSED_VALVE = "open_closed_valve";
+    public static final String OPERATING_MODE = "operating_mode";
+
     // Window handle
     public static final String HANDLE_STATE = "handle_state";
 
     // Gate
     public static final String GATE_STATE = "gate_state";
     public static final String GATE_COMMAND = "gate_command";
+    public static final String GATE_POSITION = "gate_position";
 
     // ElectricitySensor
     public static final String ENERGY_CONSUMPTION = "energy_consumption";
@@ -285,6 +296,7 @@ public class SomfyTahomaBindingConstants {
     public static final String COMMAND_SET_HEATINGLEVEL = "setHeatingLevel";
     public static final String COMMAND_SET_PEDESTRIANPOSITION = "setPedestrianPosition";
     public static final String COMMAND_SET_ROCKERPOSITION = "setRockerPosition";
+    public static final String COMMAND_SET_DEROGATION = "setDerogation";
     public static final String COMMAND_UP = "up";
     public static final String COMMAND_DOWN = "down";
     public static final String COMMAND_OPEN = "open";
@@ -309,10 +321,12 @@ public class SomfyTahomaBindingConstants {
     public static final String BATTERY_LEVEL_STATE = "core:BatteryLevelState";
     public static final String SIREN_STATUS_STATE = "internal:SirenStatusState";
     public static final String TARGET_TEMPERATURE_STATE = "core:TargetTemperatureState";
+    public static final String TARGET_ROOM_TEMPERATURE_STATE = "core:TargetRoomTemperatureState";
     public static final String SMOKE_STATE = "core:SmokeState";
     public static final String SENSOR_DEFECT_STATE = "core:SensorDefectState";
     public static final String RADIO_PART_BATTERY_STATE = "io:MaintenanceRadioPartBatteryState";
     public static final String SENSOR_PART_BATTERY_STATE = "io:MaintenanceSensorPartBatteryState";
+    public static final String ZWAVE_SET_POINT_TYPE_STATE = "zwave:SetPointTypeState";
 
     // supported uiClasses
     public static final String CLASS_ROLLER_SHUTTER = "RollerShutter";
@@ -361,12 +375,12 @@ public class SomfyTahomaBindingConstants {
             THING_TYPE_EXTERIORSCREEN, THING_TYPE_EXTERIORVENETIANBLIND, THING_TYPE_GARAGEDOOR, THING_TYPE_AWNING,
             THING_TYPE_ACTIONGROUP, THING_TYPE_ONOFF, THING_TYPE_LIGHT, THING_TYPE_LIGHTSENSOR, THING_TYPE_SMOKESENSOR,
             THING_TYPE_CONTACTSENSOR, THING_TYPE_OCCUPANCYSENSOR, THING_TYPE_WINDOW, THING_TYPE_INTERNAL_ALARM,
-            THING_TYPE_EXTERNAL_ALARM, THING_TYPE_POD, THING_TYPE_HEATING_SYSTEM, THING_TYPE_ONOFF_HEATING_SYSTEM,
+            THING_TYPE_EXTERNAL_ALARM, THING_TYPE_POD, THING_TYPE_ZWAVE_HEATING_SYSTEM, THING_TYPE_ONOFF_HEATING_SYSTEM,
             THING_TYPE_DOOR_LOCK, THING_TYPE_PERGOLA, THING_TYPE_WINDOW_HANDLE, THING_TYPE_TEMPERATURESENSOR,
             THING_TYPE_GATE, THING_TYPE_CURTAIN, THING_TYPE_ELECTRICITYSENSOR, THING_TYPE_DOCK, THING_TYPE_SIREN,
             THING_TYPE_ADJUSTABLE_SLATS_ROLLERSHUTTER, THING_TYPE_MYFOX_CAMERA, THING_TYPE_ROLLERSHUTTER_UNO,
             THING_TYPE_WATERSENSOR, THING_TYPE_HUMIDITYSENSOR, THING_TYPE_MYFOX_ALARM, THING_TYPE_THERMOSTAT,
-            THING_TYPE_DIMMER_LIGHT, THING_TYPE_EXTERIOR_HEATING_SYSTEM));
+            THING_TYPE_DIMMER_LIGHT, THING_TYPE_EXTERIOR_HEATING_SYSTEM, THING_TYPE_VALVE_HEATING_SYSTEM));
 
     // somfy gateways
     public static Map<Integer, String> gatewayTypes = new HashMap<Integer, String>() {
diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaException.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaException.java
deleted file mode 100644 (file)
index a29cad3..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (c) 2010-2020 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.somfytahoma.internal;
-
-import org.eclipse.jdt.annotation.NonNullByDefault;
-
-/**
- * The {@link SomfyTahomaException} represents an exception in the response of
- * the TahomaLink cloud service.
- *
- * @author Ondrej Pecta - Initial contribution
- */
-@NonNullByDefault
-public class SomfyTahomaException extends RuntimeException {
-
-    private static final long serialVersionUID = 1L;
-
-    public SomfyTahomaException(String message) {
-        super(message);
-    }
-
-    public SomfyTahomaException(final Throwable cause) {
-        super(cause);
-    }
-
-    public SomfyTahomaException(final String message, final Throwable cause) {
-        super(message, cause);
-    }
-}
index 4cf0aa53416a197dcbb6973761904167ff08fc53..688e67bee0f4f3b8c2d96d2d306c0949a23e5c5a 100644 (file)
@@ -108,8 +108,10 @@ public class SomfyTahomaHandlerFactory extends BaseThingHandlerFactory {
             return new SomfyTahomaExternalAlarmHandler(thing);
         } else if (thingTypeUID.equals(THING_TYPE_POD)) {
             return new SomfyTahomaPodHandler(thing);
-        } else if (thingTypeUID.equals(THING_TYPE_HEATING_SYSTEM)) {
-            return new SomfyTahomaHeatingSystemHandler(thing);
+        } else if (thingTypeUID.equals(THING_TYPE_VALVE_HEATING_SYSTEM)) {
+            return new SomfyTahomaValveHeatingSystemHandler(thing);
+        } else if (thingTypeUID.equals(THING_TYPE_ZWAVE_HEATING_SYSTEM)) {
+            return new SomfyTahomaZwaveHeatingSystemHandler(thing);
         } else if (thingTypeUID.equals(THING_TYPE_ONOFF_HEATING_SYSTEM)) {
             return new SomfyTahomaOnOffHeatingSystemHandler(thing);
         } else if (thingTypeUID.equals(THING_TYPE_EXTERIOR_HEATING_SYSTEM)) {
index fd6b1b5d420a879ba9b0ef93c7f6ce4b75f9e150..d79152aac836e70df3bff3a584c08415cfaee0f1 100644 (file)
@@ -237,10 +237,14 @@ public class SomfyTahomaItemDiscoveryService extends AbstractDiscoveryService
             case CLASS_HEATING_SYSTEM:
                 if ("SomfyThermostat".equals(device.getWidget())) {
                     deviceDiscovered(device, THING_TYPE_THERMOSTAT);
+                } else if ("ValveHeatingTemperatureInterface".equals(device.getWidget())) {
+                    deviceDiscovered(device, THING_TYPE_VALVE_HEATING_SYSTEM);
                 } else if (isOnOffHeatingSystem(device)) {
                     deviceDiscovered(device, THING_TYPE_ONOFF_HEATING_SYSTEM);
+                } else if (isZwaveHeatingSystem(device)) {
+                    deviceDiscovered(device, THING_TYPE_ZWAVE_HEATING_SYSTEM);
                 } else {
-                    deviceDiscovered(device, THING_TYPE_HEATING_SYSTEM);
+                    logUnsupportedDevice(device);
                 }
                 break;
             case CLASS_EXTERIOR_HEATING_SYSTEM:
@@ -354,6 +358,10 @@ public class SomfyTahomaItemDiscoveryService extends AbstractDiscoveryService
         return hasCommmand(device, COMMAND_SET_HEATINGLEVEL);
     }
 
+    private boolean isZwaveHeatingSystem(SomfyTahomaDevice device) {
+        return hasState(device, ZWAVE_SET_POINT_TYPE_STATE);
+    }
+
     private boolean hasCommmand(SomfyTahomaDevice device, String command) {
         return device.getDefinition().getCommands().stream().anyMatch(cmd -> command.equals(cmd.getCommandName()));
     }
index 7e12dc9cd63cfa72df77e11f8462e78c557398f8..4dcab75512d05937cff7c7d7462e95c2b9919b30 100644 (file)
@@ -54,7 +54,7 @@ public abstract class SomfyTahomaBaseThingHandler extends BaseThingHandler {
         return stateNames;
     }
 
-    private String url = "";
+    protected String url = "";
 
     @Override
     public void initialize() {
@@ -124,7 +124,7 @@ public abstract class SomfyTahomaBaseThingHandler extends BaseThingHandler {
     protected void sendCommand(String cmd, String param) {
         SomfyTahomaBridgeHandler handler = getBridgeHandler();
         if (handler != null) {
-            handler.sendCommand(url, cmd, param);
+            handler.sendCommand(url, cmd, param, EXEC_URL + "apply");
         }
     }
 
index cee8000bff2713bb906e88cb1247af60ddb16a51..9004f4f31f8d493047aa1d816514266373f972b3 100644 (file)
@@ -556,23 +556,23 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
                 .timeout(TAHOMA_TIMEOUT, TimeUnit.SECONDS).agent(TAHOMA_AGENT);
     }
 
-    public void sendCommand(String io, String command, String params) {
+    public void sendCommand(String io, String command, String params, String url) {
         if (ThingStatus.OFFLINE == thing.getStatus() && !reLogin()) {
             return;
         }
 
-        Boolean result = sendCommandInternal(io, command, params);
+        Boolean result = sendCommandInternal(io, command, params, url);
         if (!result) {
-            sendCommandInternal(io, command, params);
+            sendCommandInternal(io, command, params, url);
         }
     }
 
-    private Boolean sendCommandInternal(String io, String command, String params) {
+    private Boolean sendCommandInternal(String io, String command, String params, String url) {
         String value = params.equals("[]") ? command : params.replace("\"", "");
         String urlParameters = "{\"label\":\"" + getThingLabelByURL(io) + " - " + value
                 + " - OH2\",\"actions\":[{\"deviceURL\":\"" + io + "\",\"commands\":[{\"name\":\"" + command
                 + "\",\"parameters\":" + params + "}]}]}";
-        SomfyTahomaApplyResponse response = invokeCallToURL(EXEC_URL + "apply", urlParameters, HttpMethod.POST,
+        SomfyTahomaApplyResponse response = invokeCallToURL(url, urlParameters, HttpMethod.POST,
                 SomfyTahomaApplyResponse.class);
         if (response != null) {
             if (!response.getExecId().isEmpty()) {
@@ -699,6 +699,7 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
                     break;
                 case DELETE:
                     response = sendDeleteToTahomaWithCookie(url);
+                default:
             }
             return classOfT != null ? gson.fromJson(response, classOfT) : null;
         } catch (JsonSyntaxException e) {
index c334274c263622fcee6485dab86c8ffb58105a9a..c823bc8d7c3502536b82e3649a33e4e7f983be40 100644 (file)
@@ -32,6 +32,7 @@ public class SomfyTahomaGateHandler extends SomfyTahomaBaseThingHandler {
     public SomfyTahomaGateHandler(Thing thing) {
         super(thing);
         stateNames.put(GATE_STATE, "core:OpenClosedPedestrianState");
+        stateNames.put(GATE_POSITION, "core:ClosureState");
     }
 
     @Override
@@ -42,6 +43,8 @@ public class SomfyTahomaGateHandler extends SomfyTahomaBaseThingHandler {
         } else {
             if (GATE_COMMAND.equals(channelUID.getId())) {
                 sendCommand(getGateCommand(command.toString().toLowerCase()));
+            } else if (GATE_POSITION.equals(channelUID.getId())) {
+                sendCommand(COMMAND_SET_CLOSURE, "[" + toInteger(command) + "]");
             }
         }
     }
diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHeatingSystemHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHeatingSystemHandler.java
deleted file mode 100644 (file)
index d6c4d24..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Copyright (c) 2010-2020 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.somfytahoma.internal.handler;
-
-import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*;
-
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.openhab.core.thing.ChannelUID;
-import org.openhab.core.thing.Thing;
-import org.openhab.core.types.Command;
-import org.openhab.core.types.RefreshType;
-
-/**
- * The {@link SomfyTahomaHeatingSystemHandler} is responsible for handling commands,
- * which are sent to one of the channels of the heating system thing.
- *
- * @author Ondrej Pecta - Initial contribution
- */
-@NonNullByDefault
-public class SomfyTahomaHeatingSystemHandler extends SomfyTahomaBaseThingHandler {
-
-    public SomfyTahomaHeatingSystemHandler(Thing thing) {
-        super(thing);
-        stateNames.put(TARGET_TEMPERATURE, TARGET_TEMPERATURE_STATE);
-        stateNames.put(CURRENT_TEMPERATURE, "zwave:SetPointHeatingValueState");
-        stateNames.put(BATTERY_LEVEL, BATTERY_LEVEL_STATE);
-        stateNames.put(CURRENT_STATE, "zwave:SetPointTypeState");
-    }
-
-    @Override
-    public void handleCommand(ChannelUID channelUID, Command command) {
-        super.handleCommand(channelUID, command);
-        if (command instanceof RefreshType) {
-            return;
-        } else {
-            if (TARGET_TEMPERATURE.equals(channelUID.getId())) {
-                String param = "[" + command.toString() + "]";
-                sendCommand("setTargetTemperature", param);
-            }
-        }
-    }
-}
index c3c5c1e81e7c2afabe39419bd5632aa00e8738f8..c6fb0eaae47c3ca8f42b3a00050cdc509ef87a7b 100644 (file)
@@ -15,7 +15,10 @@ package org.openhab.binding.somfytahoma.internal.handler;
 import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.core.thing.ChannelUID;
 import org.openhab.core.thing.Thing;
+import org.openhab.core.types.Command;
+import org.openhab.core.types.RefreshType;
 
 /**
  * The {@link SomfyTahomaPodHandler} is responsible for handling commands,
@@ -32,4 +35,25 @@ public class SomfyTahomaPodHandler extends SomfyTahomaBaseThingHandler {
         stateNames.put(BATTERY_STATUS, BATTERY_STATUS_STATE);
         stateNames.put(LIGHTING_LED_POD_MODE, "internal:LightingLedPodModeState");
     }
+
+    @Override
+    public void handleCommand(ChannelUID channelUID, Command command) {
+        super.handleCommand(channelUID, command);
+        if (!LIGHTING_LED_POD_MODE.equals(channelUID.getId())) {
+            return;
+        }
+
+        if (command instanceof RefreshType) {
+            return;
+        } else {
+            sendPodCommand("setLightingLedPodMode", "[" + command + "]");
+        }
+    }
+
+    private void sendPodCommand(String cmd, String param) {
+        SomfyTahomaBridgeHandler handler = getBridgeHandler();
+        if (handler != null) {
+            handler.sendCommand(url, cmd, param, EXEC_URL + "apply/internal");
+        }
+    }
 }
index 25fdbf2a61c8e52009c059d95f18fa7b87f2f404..83a41dd1f3d684f8e699242d0bf4c41727a3e30e 100644 (file)
@@ -33,5 +33,6 @@ public class SomfyTahomaThermostatHandler extends SomfyTahomaBaseThingHandler {
         stateNames.put(HEATING_MODE, "somfythermostat:HeatingModeState");
         stateNames.put(DEROGATION_HEATING_MODE, "somfythermostat:DerogationHeatingModeState");
         stateNames.put(DEROGATION_ACTIVATION, "core:DerogationActivationState");
+        stateNames.put(DEROGATED_TARGET_TEMPERATURE, "core:DerogatedTargetTemperatureState");
     }
 }
diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaValveHeatingSystemHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaValveHeatingSystemHandler.java
new file mode 100644 (file)
index 0000000..991e996
--- /dev/null
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2010-2020 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.somfytahoma.internal.handler;
+
+import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.core.library.types.QuantityType;
+import org.openhab.core.thing.ChannelUID;
+import org.openhab.core.thing.Thing;
+import org.openhab.core.types.Command;
+import org.openhab.core.types.RefreshType;
+
+/**
+ * The {@link SomfyTahomaValveHeatingSystemHandler} is responsible for handling commands,
+ * which are sent to one of the channels of the valve heating system thing.
+ *
+ * @author Ondrej Pecta - Initial contribution
+ */
+@NonNullByDefault
+public class SomfyTahomaValveHeatingSystemHandler extends SomfyTahomaBaseThingHandler {
+
+    public SomfyTahomaValveHeatingSystemHandler(Thing thing) {
+        super(thing);
+        stateNames.put(TARGET_TEMPERATURE, TARGET_ROOM_TEMPERATURE_STATE);
+        stateNames.put(BATTERY_LEVEL, BATTERY_LEVEL_STATE);
+        stateNames.put(DEROGATION_HEATING_MODE, "io:DerogationHeatingModeState");
+        stateNames.put(DEROGATED_TARGET_TEMPERATURE, "core:DerogatedTargetTemperatureState");
+        stateNames.put(CURRENT_HEATING_MODE, "io:CurrentHeatingModeState");
+        stateNames.put(OPEN_CLOSED_VALVE, "core:OpenClosedValveState");
+        stateNames.put(OPERATING_MODE, "core:OperatingModeState");
+    }
+
+    @Override
+    public void handleCommand(ChannelUID channelUID, Command command) {
+        super.handleCommand(channelUID, command);
+        if (command instanceof RefreshType) {
+            return;
+        } else {
+            if (DEROGATED_TARGET_TEMPERATURE.equals(channelUID.getId()) && command instanceof QuantityType) {
+                QuantityType type = (QuantityType) command;
+                String param = "[" + type.doubleValue() + ", \"next_mode\"]";
+                sendCommand(COMMAND_SET_DEROGATION, param);
+            } else if (DEROGATION_HEATING_MODE.equals(channelUID.getId())) {
+                switch (command.toString()) {
+                    case "auto":
+                        sendCommand("exitDerogation");
+                        break;
+                    case "away":
+                    case "comfort":
+                    case "eco":
+                    case "frostprotection":
+                        String param = "[\"" + command.toString() + "\", \"next_mode\"]";
+                        sendCommand(COMMAND_SET_DEROGATION, param);
+                        break;
+                    default:
+
+                }
+            }
+        }
+    }
+}
diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaZwaveHeatingSystemHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaZwaveHeatingSystemHandler.java
new file mode 100644 (file)
index 0000000..3cf4743
--- /dev/null
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2010-2020 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.somfytahoma.internal.handler;
+
+import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.core.thing.ChannelUID;
+import org.openhab.core.thing.Thing;
+import org.openhab.core.types.Command;
+import org.openhab.core.types.RefreshType;
+
+/**
+ * The {@link SomfyTahomaZwaveHeatingSystemHandler} is responsible for handling commands,
+ * which are sent to one of the channels of the z-wave heating system thing.
+ *
+ * @author Ondrej Pecta - Initial contribution
+ */
+@NonNullByDefault
+public class SomfyTahomaZwaveHeatingSystemHandler extends SomfyTahomaBaseThingHandler {
+
+    public SomfyTahomaZwaveHeatingSystemHandler(Thing thing) {
+        super(thing);
+        stateNames.put(TARGET_TEMPERATURE, TARGET_TEMPERATURE_STATE);
+        stateNames.put(CURRENT_TEMPERATURE, "zwave:SetPointHeatingValueState");
+        stateNames.put(BATTERY_LEVEL, BATTERY_LEVEL_STATE);
+        stateNames.put(CURRENT_STATE, ZWAVE_SET_POINT_TYPE_STATE);
+    }
+
+    @Override
+    public void handleCommand(ChannelUID channelUID, Command command) {
+        super.handleCommand(channelUID, command);
+        if (command instanceof RefreshType) {
+            return;
+        } else {
+            if (TARGET_TEMPERATURE.equals(channelUID.getId())) {
+                String param = "[" + command.toString() + "]";
+                sendCommand("setTargetTemperature", param);
+            }
+        }
+    }
+}
index d8ad874881714ed375ab63a51f6dbaf7746b3fc6..934e625fb99413e42514f87b7fa9aa8a532b7df9 100644 (file)
                <state readOnly="true"/>
        </channel-type>
 
+       <channel-type id="gate_position">
+               <item-type>Dimmer</item-type>
+               <label>Position</label>
+               <description>Position of the gate</description>
+               <state max="100" min="0" step="1" pattern="%d %%" readOnly="false"/>
+       </channel-type>
+
        <channel-type id="open">
                <item-type>Switch</item-type>
                <label>Open/Close</label>
        <channel-type id="derogation_heating_mode">
                <item-type>String</item-type>
                <label>Derogation Heating Mode</label>
-               <description>Derogation heating mode of the Somfy thermostat</description>
-               <state readOnly="true"/>
+               <description>Derogation heating mode of the Somfy thermostat/valve</description>
+               <command>
+                       <options>
+                               <option value="auto">Program</option>
+                               <option value="away">Away</option>
+                               <option value="comfort">Home</option>
+                               <option value="frost protection">Frost protection</option>
+                               <option value="manual">Manual</option>
+                               <option value="eco">Night</option>
+                       </options>
+               </command>
        </channel-type>
 
        <channel-type id="derogation_activation">
                <description>The level of the heating</description>
                <state max="100" min="0" step="1" pattern="%d %%"/>
        </channel-type>
+
+       <channel-type id="current_heating_mode">
+               <item-type>String</item-type>
+               <label>Current Heating Mode</label>
+               <description>Current heating mode of the Somfy thermostatic valve</description>
+               <state readOnly="true"/>
+       </channel-type>
+
+       <channel-type id="open_closed_valve">
+               <item-type>Contact</item-type>
+               <label>Valve Open/Closed state</label>
+               <description>Current open/closed state of the Somfy thermostatic valve</description>
+               <state readOnly="true"/>
+       </channel-type>
+
+       <channel-type id="operating_mode">
+               <item-type>String</item-type>
+               <label>Operating mode</label>
+               <description>Operating mode of the Somfy thermostatic valve</description>
+               <state readOnly="true"/>
+       </channel-type>
 </thing:thing-descriptions>
index 65ec0d88fd9e4f83b8d88c27c1b0d15d635ba3ac..1d35192313f9b1d3369bb813e4a5063f5f8a47e2 100644 (file)
@@ -12,6 +12,7 @@
                <channels>
                        <channel id="gate_state" typeId="gate_state"></channel>
                        <channel id="gate_command" typeId="gate_command"></channel>
+                       <channel id="gate_position" typeId="gate_position"></channel>
                </channels>
                <config-description-ref uri="thing-type:somfytahoma:device"/>
        </thing-type>
index e509d851fc0544792334fde40e98898c652dc21f..e97800f99110bf9b7a5193ef2b0346d63f35817f 100644 (file)
@@ -8,7 +8,7 @@
                <supported-bridge-type-refs>
                        <bridge-type-ref id="bridge"/>
                </supported-bridge-type-refs>
-               <label>Somfy Heating System</label>
+               <label>Z-Wave Heating System</label>
                <channels>
                        <channel id="current_temperature" typeId="current_temperature"></channel>
                        <channel id="current_state" typeId="current_state"></channel>
index e06b786755c5d7177e5c58e9a86fec4ea4f7bdf6..690f9a1cec77c3f22fd3f93aa5aff67f8d5c79d7 100644 (file)
                </supported-bridge-type-refs>
                <label>Somfy Thermostat</label>
                <channels>
-                       <channel id="target_temperature" typeId="target_temperature"></channel>
+                       <channel id="target_temperature" typeId="temperature"></channel>
                        <channel id="battery_level" typeId="system.battery-level"></channel>
                        <channel id="heating_mode" typeId="heating_mode"></channel>
                        <channel id="derogation_heating_mode" typeId="derogation_heating_mode"></channel>
                        <channel id="derogation_activation" typeId="derogation_activation"></channel>
+                       <channel id="derogated_target_temperature" typeId="target_temperature"></channel>
                </channels>
                <config-description-ref uri="thing-type:somfytahoma:device"/>
        </thing-type>
diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/valveheatingsystem.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/valveheatingsystem.xml
new file mode 100644 (file)
index 0000000..049ff44
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="somfytahoma"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
+       xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
+
+       <thing-type id="valveheatingsystem">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bridge"/>
+               </supported-bridge-type-refs>
+               <label>Somfy Thermostatic Valve</label>
+               <channels>
+                       <channel id="target_temperature" typeId="temperature"></channel>
+                       <channel id="battery_level" typeId="system.battery-level"></channel>
+                       <channel id="derogation_heating_mode" typeId="derogation_heating_mode"></channel>
+                       <channel id="derogated_target_temperature" typeId="target_temperature"></channel>
+                       <channel id="current_heating_mode" typeId="current_heating_mode"></channel>
+                       <channel id="open_closed_valve" typeId="open_closed_valve"></channel>
+                       <channel id="operating_mode" typeId="operating_mode"></channel>
+               </channels>
+               <config-description-ref uri="thing-type:somfytahoma:device"/>
+       </thing-type>
+
+</thing:thing-descriptions>