[velux] Fix limit minimum bug (#15088)

Also-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Cor Hoogendoorn <chiuaua@hotmail.com>
This commit is contained in:
Chiuaua79 2023-06-27 23:00:32 +02:00 committed by GitHub
parent 6ff4149899
commit 21044f66f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View 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

View 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 = ",";

View 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;