]> git.basschouten.com Git - openhab-addons.git/commitdiff
[velbus] Add modules VMBKP, VMBIN, VMB4PB (#13939)
authorDaniel Rosengarten <github@praetorians.be>
Sat, 31 Dec 2022 16:25:03 +0000 (17:25 +0100)
committerGitHub <noreply@github.com>
Sat, 31 Dec 2022 16:25:03 +0000 (17:25 +0100)
* [velbus] Add new functionality PRESSED and LONG PRESSED and fix bug

New functionnality :
Add the the possibility to simulate the PRESSED and LONG PRESSED message of an input.

Module supported with button simulation :
VMB1RYS (button : CH6)
VMB6IN (buttons : CH1 ... CH6)
VMB2PBN, VMB6PBN, VMB7IN, VMB8IR, VMB8PB, VMB8PBU, VMBEL1, VMBEL2, VMBEL4, VMBGP1, VMBGP1-2, VMBGP2, VMBGP2-2, VMBGP4, VMBGP4-2, VMBGP4PIR, VMBGP4PIR-2 (buttons : CH1 ... CH8)
VMBELO, VMBGPOD, VMBGPOD-2 (buttons : CH1 ... CH32)

Fix bug :

The channels names were not correctly assigned to the thing properties. The last channel had the default name, not the one retrieved from the module.

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* Update bundles/org.openhab.binding.velbus/README.md

Co-authored-by: cedricboon <cedric.boon@hotmail.com>
Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* Update bundles/org.openhab.binding.velbus/README.md

Co-authored-by: cedricboon <cedric.boon@hotmail.com>
Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* Update bundles/org.openhab.binding.velbus/README.md

Co-authored-by: cedricboon <cedric.boon@hotmail.com>
Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* Add trigger on channel when using button simulation

Remove uneeded  Thread.sleep in code.
Trigger the events PRESSED, LONG_PRESSED, RELEASED on the linked trigger channel when using the button simulation.

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* Fix redundant superinterface DiscoveryService

Redundant superinterface DiscoveryService for the type VelbusThingDiscoveryService, already defined by AbstractDiscoveryService.

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* Fix bug #11521

Typo in the Counter Channel name for VMB7IN.

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* [velbus] Add VMBELPIR module

Add the module VMBELPIR

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* [velbus] VMBELPIR added to discovery service

Forgot to add the module VMBELPIR in the discovery service.

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* [velbus] Updates clock alarms management

Changes the clocks alarm management :
- Global alarms are now set from the bridge thing.
- Local alarms are still set from the module thing, but the alarm type channels on modules are now readonly.

Reduces the flooding of the bus by adding a delay of 10 seconds before sending the update on the bus :
- Removes the send on the bus after each update of a clock alarm value.
- Sends only the values of the last update after 10 seconds.

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* [velbus] PR modifications

Modifications asked in PR review.

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* [velbus] PR modifications 2

Modifications asked in PR review 2.

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* [velbus] Add modules VMBKP, VMBIN, VMB4PB

New functionnality : Add the support of the modules VMBKP, VMBIN, VMB4PB

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
* [velbus] Fix code style error

Fix code style error in VelbusSensorWithAlarmClockHandler.java

Signed-off-by: Daniel Rosengarten <github@praetorians.be>
Signed-off-by: Daniel Rosengarten <github@praetorians.be>
Co-authored-by: cedricboon <cedric.boon@hotmail.com>
bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java
bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java
bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java
bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties
bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml

index df98433e5da63970dbdd1c8e3d6b70bea9e5c066..ff13ebdf75b58ddccc4e2a8badad9e91db8debad 100644 (file)
@@ -84,22 +84,25 @@ public class VelbusBindingConstants {
     public static final ThingTypeUID THING_TYPE_VMBPIRO = new ThingTypeUID(BINDING_ID, "vmbpiro");
     public static final ThingTypeUID THING_TYPE_VMBRFR8S = new ThingTypeUID(BINDING_ID, "vmbrfr8s");
     public static final ThingTypeUID THING_TYPE_VMBVP1 = new ThingTypeUID(BINDING_ID, "vmbvp1");
+    public static final ThingTypeUID THING_TYPE_VMBKP = new ThingTypeUID(BINDING_ID, "vmbkp");
+    public static final ThingTypeUID THING_TYPE_VMBIN = new ThingTypeUID(BINDING_ID, "vmbin");
+    public static final ThingTypeUID THING_TYPE_VMB4PB = new ThingTypeUID(BINDING_ID, "vmb4pb");
 
     // thing type sets
     public static final Set<ThingTypeUID> BRIDGE_THING_TYPES_UIDS = Collections
             .unmodifiableSet(new HashSet<>(Arrays.asList(BRIDGE_THING_TYPE, NETWORK_BRIDGE_THING_TYPE)));
-    public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
-            .unmodifiableSet(new HashSet<>(Arrays.asList(THING_TYPE_VMB1BL, THING_TYPE_VMB1BLS, THING_TYPE_VMB1DM,
-                    THING_TYPE_VMB1LED, THING_TYPE_VMB1RY, THING_TYPE_VMB1RYNO, THING_TYPE_VMB1RYNOS,
-                    THING_TYPE_VMB1RYS, THING_TYPE_VMB1TS, THING_TYPE_VMB2BL, THING_TYPE_VMB2BLE, THING_TYPE_VMB2PBN,
-                    THING_TYPE_VMB4AN, THING_TYPE_VMB4DC, THING_TYPE_VMB4RY, THING_TYPE_VMB4RYLD, THING_TYPE_VMB4RYNO,
-                    THING_TYPE_VMB6IN, THING_TYPE_VMB6PBN, THING_TYPE_VMB7IN, THING_TYPE_VMB8IR, THING_TYPE_VMB8PB,
-                    THING_TYPE_VMB8PBU, THING_TYPE_VMBDME, THING_TYPE_VMBDMI, THING_TYPE_VMBDMIR, THING_TYPE_VMBEL1,
-                    THING_TYPE_VMBEL2, THING_TYPE_VMBEL4, THING_TYPE_VMBELO, THING_TYPE_VMBELPIR, THING_TYPE_VMBGP1,
-                    THING_TYPE_VMBGP1_2, THING_TYPE_VMBGP2, THING_TYPE_VMBGP2_2, THING_TYPE_VMBGP4, THING_TYPE_VMBGP4_2,
-                    THING_TYPE_VMBGP4PIR, THING_TYPE_VMBGP4PIR_2, THING_TYPE_VMBGPO, THING_TYPE_VMBGPOD,
-                    THING_TYPE_VMBGPOD_2, THING_TYPE_VMBMETEO, THING_TYPE_VMBPIRC, THING_TYPE_VMBPIRM,
-                    THING_TYPE_VMBPIRO, THING_TYPE_VMBRFR8S, THING_TYPE_VMBVP1)));
+    public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
+            new HashSet<>(Arrays.asList(THING_TYPE_VMB1BL, THING_TYPE_VMB1BLS, THING_TYPE_VMB1DM, THING_TYPE_VMB1LED,
+                    THING_TYPE_VMB1RY, THING_TYPE_VMB1RYNO, THING_TYPE_VMB1RYNOS, THING_TYPE_VMB1RYS, THING_TYPE_VMB1TS,
+                    THING_TYPE_VMB2BL, THING_TYPE_VMB2BLE, THING_TYPE_VMB2PBN, THING_TYPE_VMB4AN, THING_TYPE_VMB4DC,
+                    THING_TYPE_VMB4RY, THING_TYPE_VMB4RYLD, THING_TYPE_VMB4RYNO, THING_TYPE_VMB6IN, THING_TYPE_VMB6PBN,
+                    THING_TYPE_VMB7IN, THING_TYPE_VMB8IR, THING_TYPE_VMB8PB, THING_TYPE_VMB8PBU, THING_TYPE_VMBDME,
+                    THING_TYPE_VMBDMI, THING_TYPE_VMBDMIR, THING_TYPE_VMBEL1, THING_TYPE_VMBEL2, THING_TYPE_VMBEL4,
+                    THING_TYPE_VMBELO, THING_TYPE_VMBELPIR, THING_TYPE_VMBGP1, THING_TYPE_VMBGP1_2, THING_TYPE_VMBGP2,
+                    THING_TYPE_VMBGP2_2, THING_TYPE_VMBGP4, THING_TYPE_VMBGP4_2, THING_TYPE_VMBGP4PIR,
+                    THING_TYPE_VMBGP4PIR_2, THING_TYPE_VMBGPO, THING_TYPE_VMBGPOD, THING_TYPE_VMBGPOD_2,
+                    THING_TYPE_VMBMETEO, THING_TYPE_VMBPIRC, THING_TYPE_VMBPIRM, THING_TYPE_VMBPIRO,
+                    THING_TYPE_VMBRFR8S, THING_TYPE_VMBVP1, THING_TYPE_VMBKP, THING_TYPE_VMBIN, THING_TYPE_VMB4PB)));
 
     // Velbus module types
     public static final byte MODULE_TYPE_VMB8PB = 0x01;
@@ -150,6 +153,9 @@ public class VelbusBindingConstants {
     public static final byte MODULE_TYPE_VMBGPOD_2 = 0x3D;
     public static final byte MODULE_TYPE_VMBGP4PIR_2 = 0x3E;
     public static final byte MODULE_TYPE_VMB1RYS = 0x41;
+    public static final byte MODULE_TYPE_VMBKP = 0x42;
+    public static final byte MODULE_TYPE_VMBIN = 0x43;
+    public static final byte MODULE_TYPE_VMB4PB = 0x44;
 
     // Velbus commands
     public static final byte COMMAND_PUSH_BUTTON_STATUS = 0x00;
index 3ae22ce65bb96e5184e553ba4f0b42e57cfab0cf..0697d4c87b5d0c4d9582ce270dc5e612c1af3482 100644 (file)
@@ -311,6 +311,18 @@ public class VelbusThingDiscoveryService extends AbstractDiscoveryService
                 velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber,
                         lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBVP1, 8);
                 break;
+            case MODULE_TYPE_VMBKP:
+                velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber,
+                        lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBKP, 8);
+                break;
+            case MODULE_TYPE_VMBIN:
+                velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber,
+                        lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBIN, 8);
+                break;
+            case MODULE_TYPE_VMB4PB:
+                velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber,
+                        lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB4PB, 8);
+                break;
         }
 
         if (velbusModule != null) {
index 6e1eab2544310f7ba8d4d03570810116609f296b..82ae4fe99022893471e4cecf12f1b58b67413e70 100644 (file)
@@ -41,14 +41,14 @@ import org.openhab.core.types.RefreshType;
  * sent to one of the channels.
  *
  * @author Cedric Boon - Initial contribution
- * @author Daniel Rosengarten - Add VMBELPIR support, removes global alarm configuration from module (moved on bridge),
- *         reduces bus flooding on alarm value update
+ * @author Daniel Rosengarten - Add new module support, removes global alarm configuration from module (moved on
+ *         bridge), reduces bus flooding on alarm value update
  */
 @NonNullByDefault
 public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler {
-    public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = new HashSet<>(
-            Arrays.asList(THING_TYPE_VMB2PBN, THING_TYPE_VMB6PBN, THING_TYPE_VMB8PBU, THING_TYPE_VMBPIRC,
-                    THING_TYPE_VMBPIRM, THING_TYPE_VMBRFR8S, THING_TYPE_VMBVP1));
+    public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB2PBN,
+            THING_TYPE_VMB6PBN, THING_TYPE_VMB8PBU, THING_TYPE_VMBPIRC, THING_TYPE_VMBPIRM, THING_TYPE_VMBRFR8S,
+            THING_TYPE_VMBVP1, THING_TYPE_VMBKP, THING_TYPE_VMBIN, THING_TYPE_VMB4PB));
     private static final HashMap<ThingTypeUID, Integer> ALARM_CONFIGURATION_MEMORY_ADDRESSES = new HashMap<ThingTypeUID, Integer>();
 
     static {
@@ -79,6 +79,9 @@ public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler {
         ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBGPOD_2, 0x0284);
         ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBRFR8S, 0x0093);
         ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBVP1, 0x002B);
+        ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBKP, 0x00A7);
+        ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBIN, 0x00A7);
+        ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMB4PB, 0x00A7);
     }
 
     private static final byte ALARM_CONFIGURATION_MEMORY_SIZE = 0x09;
index e53696cff1fc3eaabce1f06c10657fb0b55bb14b..6010701dfd74bca634bfdd11881c8911b8e53c38 100644 (file)
@@ -37,6 +37,8 @@ thing-type.velbus.vmb4an.label = VMB4AN
 thing-type.velbus.vmb4an.description = Analog I/O module
 thing-type.velbus.vmb4dc.label = VMB4DC
 thing-type.velbus.vmb4dc.description = 4-channel 0/1-10V dimmer controller
+thing-type.velbus.vmb4pb.label = VMB4PB
+thing-type.velbus.vmb4pb.description = 4 button interface module
 thing-type.velbus.vmb4ry.label = VMB4RY
 thing-type.velbus.vmb4ry.description = 4-channel relay module
 thing-type.velbus.vmb4ryld.label = VMB4RYLD
@@ -93,6 +95,10 @@ thing-type.velbus.vmbgpod-2.label = VMBGPOD-2
 thing-type.velbus.vmbgpod-2.description = Glass control module with oled display and temperature controller (Edition 2)
 thing-type.velbus.vmbgpod.label = VMBGPOD
 thing-type.velbus.vmbgpod.description = Glass control module with oled display and temperature controller
+thing-type.velbus.vmbin.label = VMBIN
+thing-type.velbus.vmbin.description = 1-channel input module
+thing-type.velbus.vmbkp.label = VMBKP
+thing-type.velbus.vmbkp.description = Keypad interface module
 thing-type.velbus.vmbmeteo.label = VMBMETEO
 thing-type.velbus.vmbmeteo.description = Weather station with thermometer, anemometer, rain sensor and light sensor
 thing-type.velbus.vmbpirc.label = VMBPIRC
@@ -435,6 +441,8 @@ channel-group-type.velbus.4channelCounterModule.label = Counters
 channel-group-type.velbus.4channelCounterModule.description = This is a generic module with 4 counter channels.
 channel-group-type.velbus.4channelFeedbackModule.label = Feedback
 channel-group-type.velbus.4channelFeedbackModule.description = This is a generic module with 4 feedback channels.
+channel-group-type.velbus.5SubchannelButtonModule.label = Button
+channel-group-type.velbus.5SubchannelButtonModule.description = This is a generic module with 5 button channels. Starting at channel 4.
 channel-group-type.velbus.6channelButtonModule.label = Button
 channel-group-type.velbus.6channelButtonModule.description = This is a generic module with 6 button channels.
 channel-group-type.velbus.6channelFeedbackModule.label = Feedback
index b5fc04634510d7e768a37a36d5598b8c822f0a1b..a4633a69f9aed3d0c72b8d6ba699e46c307380da 100644 (file)
                <config-description-ref uri="thing-type:velbus:8channelDevice"/>
        </thing-type>
 
+       <thing-type id="vmbkp">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bridge"/>
+                       <bridge-type-ref id="networkbridge"/>
+               </supported-bridge-type-refs>
+
+               <label>VMBKP</label>
+               <description>Keypad interface module</description>
+               <channel-groups>
+                       <channel-group id="input" typeId="8channelInputModule"/>
+                       <channel-group id="button" typeId="5SubchannelButtonModule"/>
+                       <channel-group id="clockAlarm" typeId="clockAlarm"/>
+               </channel-groups>
+
+               <config-description-ref uri="thing-type:velbus:8channelDevice"/>
+       </thing-type>
+
+       <thing-type id="vmbin">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bridge"/>
+                       <bridge-type-ref id="networkbridge"/>
+               </supported-bridge-type-refs>
+
+               <label>VMBIN</label>
+               <description>1-channel input module</description>
+               <channel-groups>
+                       <channel-group id="input" typeId="8channelInputModule"/>
+                       <channel-group id="button" typeId="8channelButtonModule"/>
+                       <channel-group id="clockAlarm" typeId="clockAlarm"/>
+               </channel-groups>
+
+               <config-description-ref uri="thing-type:velbus:8channelDevice"/>
+       </thing-type>
+
+       <thing-type id="vmb4pb">
+               <supported-bridge-type-refs>
+                       <bridge-type-ref id="bridge"/>
+                       <bridge-type-ref id="networkbridge"/>
+               </supported-bridge-type-refs>
+
+               <label>VMB4PB</label>
+               <description>4 button interface module</description>
+               <channel-groups>
+                       <channel-group id="input" typeId="8channelInputModule"/>
+                       <channel-group id="button" typeId="8channelButtonModule"/>
+                       <channel-group id="feedback" typeId="4channelFeedbackModule"/>
+                       <channel-group id="clockAlarm" typeId="clockAlarm"/>
+               </channel-groups>
+
+               <config-description-ref uri="thing-type:velbus:8channelDevice"/>
+       </thing-type>
+
        <channel-type id="heatingOperatingMode">
                <item-type>String</item-type>
                <label>Operating Mode</label>
                        <channel id="CH2" typeId="button-channel"/>
                </channels>
        </channel-group-type>
+       <channel-group-type id="5SubchannelButtonModule">
+               <label>Button</label>
+               <description>
+                       This is a generic module with 5 button channels. Starting at channel 4.
+               </description>
+               <channels>
+                       <channel id="CH4" typeId="button-channel"/>
+                       <channel id="CH5" typeId="button-channel"/>
+                       <channel id="CH6" typeId="button-channel"/>
+                       <channel id="CH7" typeId="button-channel"/>
+                       <channel id="CH8" typeId="button-channel"/>
+               </channels>
+       </channel-group-type>
        <channel-group-type id="6channelButtonModule">
                <label>Button</label>
                <description>