]> git.basschouten.com Git - openhab-addons.git/commitdiff
[velux] Fix limit minimum bug (#15088)
authorChiuaua79 <39282804+Chiuaua79@users.noreply.github.com>
Tue, 27 Jun 2023 21:00:32 +0000 (23:00 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Jun 2023 21:00:32 +0000 (23:00 +0200)
Also-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Cor Hoogendoorn <chiuaua@hotmail.com>
bundles/org.openhab.binding.velux/README.md
bundles/org.openhab.binding.velux/src/main/java/org/openhab/binding/velux/internal/VeluxBindingConstants.java
bundles/org.openhab.binding.velux/src/main/java/org/openhab/binding/velux/internal/handler/VeluxBridgeHandler.java

index ea7c8a561600ec026033b9f0cd1a496b6c28795d..074d46f04700139b519498688f0be45c2d6d1eae 100644 (file)
@@ -235,10 +235,12 @@ The supported Channel and its associated channel type is shown below.
 
 ## Rain Sensor
 
-Unfortunately Velux has decided to closely integrate the rain sensor into the window device.
-The rain sensor is therefore not displayed in the device list.
-On the other hand, the 'limitMinimum' channel of a roof window provides information about rainy weather:
-If it is set internally by the Velux control unit to a value other than zero, it rains. (Joke!!)
+Unfortunately the rain sensor is closely integrated into the window device and it is therefore not possible to display its state via a channel.
+However, the 'limitMinimum' channel can provide information about rainy weather.
+The rain sensor, when triggered, overrides the window position so it cannot open more than the ventilation position.
+(Normally 5% .. 10% depending on the window type, resp. 90% .. 95% inverted).
+So if 'limitMinimum' changes from its normal value (usually 100% resp. 0% inverted) to this ventilation position value, it is an indication that the rain sensor has probably been triggered.
+
 
 ## Properties of the "bridge" Thing
 
index 4264778e363bf8f03dd4961be17387ee72f82f2f..5539df99cafa978c80659b60db2a2c37cd93ca74 100644 (file)
@@ -147,6 +147,9 @@ public class VeluxBindingConstants {
     // List of all virtual shutter channel ids
     public static final String CHANNEL_VSHUTTER_POSITION = "vposition";
 
+    public static final Set<String> POSITION_CHANNELS = Set.of(CHANNEL_ACTUATOR_POSITION, CHANNEL_ACTUATOR_STATE,
+            CHANNEL_VANE_POSITION, CHANNEL_VSHUTTER_POSITION);
+
     // Helper definitions
     public static final String BINDING_VALUES_SEPARATOR = ",";
     public static final String OUTPUT_VALUE_SEPARATOR = ",";
index c85fca7a87774d42960617f3904043d43e7e4451..5d096d02f84e2fc44db459ecbee566d9652b3c8b 100644 (file)
@@ -574,6 +574,10 @@ public class VeluxBridgeHandler extends ExtendedBaseBridgeHandler implements Vel
             ProductBridgeIndex productPbi = product.getBridgeProductIndex();
             logger.trace("syncChannelsWithProducts(): bridge index is {}.", productPbi);
             for (ChannelUID channelUID : BridgeChannels.getAllLinkedChannelUIDs(this)) {
+                if (!VeluxBindingConstants.POSITION_CHANNELS.contains(channelUID.getId())) {
+                    logger.trace("syncChannelsWithProducts(): skipping channel {}.", channelUID);
+                    continue;
+                }
                 if (!channel2VeluxActuator.containsKey(channelUID)) {
                     logger.trace("syncChannelsWithProducts(): channel {} not found.", channelUID);
                     continue;