From 01fbb66323e51b70b40c3efce723e68533323937 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 27 Sep 2023 23:39:02 +0200 Subject: [PATCH 01/28] [velbus] New functionnality & Bug fix New functionnality : - Add output channel for modules : VMBEL1, VMBEL2, VMBEL4, VMBELO, VMBELPIR. (#14179) - Add module VMBDALI. (#14654) Fix bug : - No access to sub-address modules when adding manually the modules : VMBELO,VMBGPO, VMBGPOD, VMBGPOD-2 (#12702) - Thermostat event wrongly fired when using push button on sub-address for modules VMBELO, VMBGPO, VMBGPOD, VMBGPOD_2. - Wrong typeId for bridge alarms management. Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 97 ++- .../internal/VelbusBindingConstants.java | 90 ++- .../velbus/internal/VelbusColorChannel.java | 233 ++++++ .../velbus/internal/VelbusHandlerFactory.java | 4 + .../velbus/internal/VelbusModuleAddress.java | 41 +- .../internal/VelbusVirtualColorChannel.java | 131 ++++ .../VelbusThingDiscoveryService.java | 40 +- .../internal/handler/VelbusBlindsHandler.java | 20 + .../internal/handler/VelbusBridgeHandler.java | 59 +- .../internal/handler/VelbusDimmerHandler.java | 14 + .../internal/handler/VelbusRelayHandler.java | 20 + .../handler/VelbusRelayWithInputHandler.java | 20 + .../internal/handler/VelbusSensorHandler.java | 39 +- .../VelbusSensorWithAlarmClockHandler.java | 132 ++-- .../VelbusTemperatureSensorHandler.java | 10 + .../handler/VelbusThermostatHandler.java | 118 ++- .../internal/handler/VelbusThingHandler.java | 9 +- .../internal/handler/VelbusVMB4ANHandler.java | 10 + .../internal/handler/VelbusVMB7INHandler.java | 10 + .../handler/VelbusVMBDALIHandler.java | 393 ++++++++++ .../internal/handler/VelbusVMBELHandler.java | 81 ++- .../internal/handler/VelbusVMBELOHandler.java | 81 ++- .../internal/handler/VelbusVMBGPOHandler.java | 20 + .../handler/VelbusVMBMeteoHandler.java | 20 + .../handler/VelbusVMBPIROHandler.java | 20 + .../packets/VelbusDaliRequestPacket.java | 53 ++ .../internal/packets/VelbusRelayPacket.java | 10 + .../packets/VelbusSetColorPacket.java | 60 ++ .../internal/packets/VelbusSetDimPacket.java | 43 ++ .../packets/VelbusSetScenePacket.java | 42 ++ .../main/resources/OH-INF/config/config.xml | 683 ++++++++++++++++++ .../resources/OH-INF/i18n/velbus.properties | 451 ++++++++++++ .../resources/OH-INF/thing/thing-types.xml | 606 +++++++++++++++- 33 files changed, 3446 insertions(+), 214 deletions(-) create mode 100644 bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java create mode 100644 bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java create mode 100644 bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java create mode 100644 bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDaliRequestPacket.java create mode 100644 bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetColorPacket.java create mode 100644 bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetDimPacket.java create mode 100644 bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetScenePacket.java diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 2fc0d9fb1b507..3fc534365d8be 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -17,7 +17,7 @@ A Velbus configuration module (e.g. VMBRSUSB) or a network server (e.g. [VelServ The supported Velbus devices are: ```text -vmb1bl, vmb1bls, vmb1dm, vmb1led, vmb1ry, vmb1ryno, vmb1rynos, vmb1rys, vmb1ts, vmb2bl, vmb2ble, vmb2pbn, vmb4an, vmb4dc, vmb4ry, vmb4ryld, vmb4ryno, vmb6in, vmb6pbn, vmb7in, vmb8ir, vmb8pb, vmb8pbu, vmbdme, vmbdmi, vmbdmir, vmbel1, vmbel2, vmbel4, vmbelo, vmbelpir, vmbgp1, vmbgp2, vmbgp4, vmbgp4pir, vmbgpo, vmbgpod, vmbmeteo, vmbpirc, vmbpirm, vmbpiro, vmbvp1 +vmb1bl, vmb1bls, vmb1dm, vmb1led, vmb1ry, vmb1ryno, vmb1rynos, vmb1rys, vmb1ts, vmb2bl, vmb2ble, vmb2pbn, vmb4an, vmb4dc, vmb4ry, vmb4ryld, vmb4ryno, vmb6in, vmb6pbn, vmb7in, vmb8ir, vmb8pb, vmb8pbu, vmbdme, vmbdmi, vmbdmir, vmbel1, vmbel2, vmbel4, vmbelo, vmbelpir, vmbgp1, vmbgp1-2, vmbgp2, vmbgp2-2, vmbgp4, vmbgp4-2, vmbgp4pir, vmbgp4pir-2, vmbgpo, vmbgpod, vmbgpod-2, vmbmeteo, vmbpirc, vmbpirm, vmbpiro, vmbvp1, vmbdali ``` The type of a specific device can be found in the configuration section for things in the UI. @@ -96,7 +96,7 @@ or nested in the bridge configuration: The following thing types are valid for configuration: ```text -vmb1bl, vmb1bls, vmb1dm, vmb1led, vmb1ry, vmb1ryno, vmb1rynos, vmb1rys, vmb1ts, vmb2bl, vmb2ble, vmb2pbn, vmb4an, vmb4dc, vmb4ry, vmb4ryld, vmb4ryno, vmb6in, vmb6pbn, vmb7in, vmb8ir, vmb8pb, vmb8pbu, vmbdme, vmbdmi, vmbdmir, vmbel1, vmbel2, vmbel4, vmbelo, vmbelpir, vmbgp1, vmbgp2, vmbgp4, vmbgp4pir, vmbgpo, vmbgpod, vmbmeteo, vmbpirc, vmbpirm, vmbpiro, vmbvp1 +vmb1bl, vmb1bls, vmb1dm, vmb1led, vmb1ry, vmb1ryno, vmb1rynos, vmb1rys, vmb1ts, vmb2bl, vmb2ble, vmb2pbn, vmb4an, vmb4dc, vmb4ry, vmb4ryld, vmb4ryno, vmb6in, vmb6pbn, vmb7in, vmb8ir, vmb8pb, vmb8pbu, vmbdme, vmbdmi, vmbdmir, vmbel1, vmbel2, vmbel4, vmbelo, vmbelpir, vmbgp1, vmbgp1-2, vmbgp2, vmbgp2-2, vmbgp4, vmbgp4-2, vmbgp4pir, vmbgp4pir-2, vmbgpo, vmbgpod, vmbgpod-2, vmbmeteo, vmbpirc, vmbpirm, vmbpiro, vmbvp1, vmbdali ``` `thingId` is the hexadecimal Velbus address of the thing. @@ -107,6 +107,25 @@ vmb1bl, vmb1bls, vmb1dm, vmb1led, vmb1ry, vmb1ryno, vmb1rynos, vmb1rys, vmb1ts, `[CHx="..."]` is optional, and represents the name of channel x, e.g. CH1 specifies the name of channel 1. + +The `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbel1`, `vmbgp1`, `vmbgp1-2`, `vmbgp2`, `vmbgp2-2`, `vmbgp4`, `vmbgp4-2`, `vmbgp4pir` and `vmbgp4pir-2` thing type also supports 1 subaddress. This subaddress is the Sensor Address. The value "FF" = not configured. + +```java +Thing velbus:vmbel1:: [subaddress1="A1"] +``` + +The `vmbelo`, `vmbgpo`, `vmbgpod` and `vmbgpod-2` thing type also supports 4 subaddresses. The subaddress4 is the Sensor Address. The value "FF" = not configured. + +```java +Thing velbus:vmbelo:: [subaddress1="B1", subaddress2="B2", subaddress3="B3", subaddress4="B4"] +``` + +The `vmbdali` thing also supports 9 subaddresses. The value "FF" = not configured. + +```java +Thing velbus:vmbelo:: [subaddress1="F1", subaddress2="F2", subaddress3="F3", subaddress4="F4", subaddress5="F5", subaddress6="F6", subaddress7="F7", subaddress8="F8", subaddress9="F9"] +``` + For thing types with builtin sensors (e.g. temperature), the interval at which the sensors should be checked can be set by specifying the Refresh Interval, e.g.: ```java @@ -136,8 +155,25 @@ The following thing types support setting the dimspeed: vmb1dm, vmb1led, vmb4dc, vmbdme, vmbdmi, vmbdmir ``` +The `vmbdali` thing has 16 virtual light. A virtual light is created from 3 channels of the DALI module. +This is because an RGB DALI light is configured on the DALI module with 3 channels (Red channel, Green channel, Blue channel). +The configuration is set like this : + +```java +Thing velbus:vmbdali:: [VL1="R,G,B"] +``` + +e.g.: +```java +Thing velbus:vmbdali:: [VL1="CH1,CH2,CH3", VL2="CH6,CH8,CH7"] +``` + +If the light is an RGBW (Red channel, Green channel, Blue channel, White channel), the white channel is managed by the corresponding `brightness` and `color-temperature` channels. + ## Channels +The bridges have a number of channels to set the global alarms: `bridgeClockAlarm#clockAlarm1Enabled`, `bridgeClockAlarm#clockAlarm1WakeupHour`, `bridgeClockAlarm#clockAlarm1WakeupMinute`, `bridgeClockAlarm#clockAlarm1BedtimeHour`, `bridgeClockAlarm#clockAlarm1BedtimeMinute`, `bridgeClockAlarm#clockAlarm2Enabled`, `bridgeClockAlarm#clockAlarm2WakeupHour`, `bridgeClockAlarm#clockAlarm2WakeupMinute`, `bridgeClockAlarm#clockAlarm2BedtimeHour` and `bridgeClockAlarm#clockAlarm2BedtimeMinute`. + For thing types `vmb1bl` and `vmb1bls` the supported channel is `CH1`. UpDown, StopMove and Percent command types are supported. @@ -159,7 +195,7 @@ OnOff command types are supported on channels `CH1` ... `CH5`. Pressed and Long_Pressed command types are supported on channel `CH6`. 1 trigger channel on `CH6t`. -The module `vmb1ts` has a number of channels to set the module's thermostat (`thermostat:currentTemperatureSetpoint`, `thermostat:heatingModeComfortTemperatureSetpoint`, `thermostat:heatingModeDayTemperatureSetpoint`, `thermostat:heatingModeNightTemperatureSetpoint`, `thermostat:heatingModeAntiFrostTemperatureSetpoint`, `thermostat:coolingModeComfortTemperatureSetpoint`, `thermostat:coolingModeDayTemperatureSetpoint`, `thermostat:coolingModeNightTemperatureSetpoint`, `thermostat:coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat:mode`) and thermostat trigger channels: `thermostat:heater`, `thermostat:boost`, `thermostat:pump`, `thermostat:cooler`, `thermostat:alarm1`, `thermostat:alarm2`, `thermostat:alarm3`, `thermostat:alarm4`. +The module `vmb1ts` has a number of channels to set the module's thermostat (`thermostat#currentTemperatureSetpoint`, `thermostat#heatingModeComfortTemperatureSetpoint`, `thermostat#heatingModeDayTemperatureSetpoint`, `thermostat#heatingModeNightTemperatureSetpoint`, `thermostat#heatingModeAntiFrostTemperatureSetpoint`, `thermostat#coolingModeComfortTemperatureSetpoint`, `thermostat#coolingModeDayTemperatureSetpoint`, `thermostat#coolingModeNightTemperatureSetpoint`, `thermostat#coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat#mode`) and thermostat trigger channels: `thermostat#heater`, `thermostat#boost`, `thermostat#pump`, `thermostat#cooler`, `thermostat#alarm1`, `thermostat#alarm2`, `thermostat#alarm3`, `thermostat#alarm4`. For thing types `vmb2bl` and `vmb2ble` the supported channels are `CH1` and `CH2`. UpDown, StopMove and Percent command types are supported. @@ -173,15 +209,15 @@ Pressed and Long_Pressed command types are supported on channels `button#CH1` .. For thing types `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8ir`, `vmb8pb`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` 8 channels are available `CH1` ... `CH8`. Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH8`. -8 trigger channels on channels `input:CH1` ... `input:CH8`. +8 trigger channels on channels `input#CH1` ... `input#CH8`. -Thing types `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8pb`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` also have and 2 channels to steer the button LED feedback (`feedback:CH1` and `feedback:CH2`). -Additionally, the modules `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` have a number of channels to set the module's alarms: `clockAlarm:clockAlarm1Enabled`, `clockAlarm:clockAlarm1Type`, `clockAlarm:clockAlarm1WakeupHour`, `clockAlarm:clockAlarm1WakeupMinute`, `clockAlarm:clockAlarm1BedtimeHour`, `clockAlarm:clockAlarm1BedtimeMinute`, `clockAlarm:clockAlarm2Enabled`, `clockAlarm:clockAlarm2Type`, `clockAlarm:clockAlarm2WakeupHour`, `clockAlarm:clockAlarm2WakeupMinute`, `clockAlarm:clockAlarm2BedtimeHour` and `clockAlarm:clockAlarm2BedtimeMinute`. +Thing types `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8pb`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` also have and 2 channels to steer the button LED feedback (`feedback#CH1` and `feedback#CH2`). +Additionally, the modules `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. -For thing type`vmb4an` 8 trigger channels are avaiable `input:CH1` ... `input:CH8`. +For thing type`vmb4an` 8 trigger channels are avaiable `input#CH1` ... `input#CH8`. These channels will be triggered by the module's alarms. Four pairs of channels are available to retrieve the module's analog inputs. -Each pair has a channel to retrieve the raw analog value (`analogInput:CH9Raw` ... `analogInput:CH12Raw`) and a channel to retrieve the textual analog value (`analogInput:CH9` ... `analogInput:CH12`). +Each pair has a channel to retrieve the raw analog value (`analoginput#CH9Raw` ... `analoginput#CH12Raw`) and a channel to retrieve the textual analog value (`analoginput#CH9` ... `analoginput#CH12`). Four channels are available to set the module's analog outputs `analogOutput:CH13` ... `analogOutput:CH16`. For thing type `vmb4dc` 4 channels are available `CH1` ... `CH4`. @@ -191,29 +227,40 @@ Sending an ON command will switch the dimmer to the value stored when last turni For thing type `vmb4ry` 4 channels are available `CH1` ... `CH4`. OnOff command types are supported. -Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir` and `vmbpiro` have 8 trigger channels `input:CH1` ... `input:CH8` and one temperature channel `input:CH9`. +Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir` and `vmbpiro` have 8 trigger channels `input#CH1` ... `input#CH8` and one temperature channel `input#CH9`. Pressed and Long_Pressed command types are supported on channels `button#CH1` and `button#CH2` for the thing type `vmbelpir`. Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH8` for the thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir` and `vmbpiro`. -The thing types `vmbel1` and `vmbgp1` have one channel to steer the button LED feedback `feedback:CH1`. -The thing types `vmbel2` and `vmbgp2` have two channels to steer the button LED feedback `feedback:CH1` and `feedback:CH2`. -The thing types `vmbel4`, `vmbgp4` and `vmbgp4pir` have four channels to steer the button LED feedback `feedback:CH1` ... `feedback:CH4`. -The thing type `vmbpiro` has a channel `input:LIGHT` indicating the illuminance. -Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4` and `vmbgp4pir` have a number of channels to set the module's alarms: `clockAlarm:clockAlarm1Enabled`, `clockAlarm:clockAlarm1Type`, `clockAlarm:clockAlarm1WakeupHour`, `clockAlarm:clockAlarm1WakeupMinute`, `clockAlarm:clockAlarm1BedtimeHour`, `clockAlarm:clockAlarm1BedtimeMinute`, `clockAlarm:clockAlarm2Enabled`, `clockAlarm:clockAlarm2Type`, `clockAlarm:clockAlarm2WakeupHour`, `clockAlarm:clockAlarm2WakeupMinute`, `clockAlarm:clockAlarm2BedtimeHour` and `clockAlarm:clockAlarm2BedtimeMinute`. -Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4` and `vmbgp4pir` also have a number of channels to set the module's thermostat (`thermostat:currentTemperatureSetpoint`, `thermostat:heatingModeComfortTemperatureSetpoint`, `thermostat:heatingModeDayTemperatureSetpoint`, `thermostat:heatingModeNightTemperatureSetpoint`, `thermostat:heatingModeAntiFrostTemperatureSetpoint`, `thermostat:coolingModeComfortTemperatureSetpoint`, `thermostat:coolingModeDayTemperatureSetpoint`, `thermostat:coolingModeNightTemperatureSetpoint`, `thermostat:coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat:mode`) and thermostat trigger channels: `thermostat:heater`, `thermostat:boost`, `thermostat:pump`, `thermostat:cooler`, `thermostat:alarm1`, `thermostat:alarm2`, `thermostat:alarm3`, `thermostat:alarm4`. - -Thing types `vmbelo`, `vmbgpo` and `vmbgpod` have 32 trigger channels `input:CH1` ... `input:CH32` and one temperature channel `input:CH33`. +The thing types `vmbel1` and `vmbgp1` have one channel to steer the button LED feedback `feedback#CH1`. +The thing types `vmbel2` and `vmbgp2` have two channels to steer the button LED feedback `feedback#CH1` and `feedback#CH2`. +The thing types `vmbel4`, `vmbgp4` and `vmbgp4pir` have four channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH4`. +The thing type `vmbpiro` has a channel `input#LIGHT` indicating the illuminance. +The thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir` have one output channel `output#output`. +Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4` and `vmbgp4pir` have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. +Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4` and `vmbgp4pir` also have a number of channels to set the module's thermostat (`thermostat#currentTemperatureSetpoint`, `thermostat#heatingModeComfortTemperatureSetpoint`, `thermostat#heatingModeDayTemperatureSetpoint`, `thermostat#heatingModeNightTemperatureSetpoint`, `thermostat#heatingModeAntiFrostTemperatureSetpoint`, `thermostat#coolingModeComfortTemperatureSetpoint`, `thermostat#coolingModeDayTemperatureSetpoint`, `thermostat#coolingModeNightTemperatureSetpoint`, `thermostat#coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat#mode`) and thermostat trigger channels: `thermostat#heater`, `thermostat#boost`, `thermostat#pump`, `thermostat#cooler`, `thermostat#alarm1`, `thermostat#alarm2`, `thermostat#alarm3`, `thermostat#alarm4`. + +Thing types `vmbelo`, `vmbgpo`, `vmbgpod` and `vmbgpod-2` have 32 trigger channels `input#CH1` ... `input#CH32` and one temperature channel `input#CH33`. Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH32`. -They have have 32 channels to steer the button LED feedback `feedback:CH1` ... `feedback:CH32`. -They have a number of channels to set the module's alarms: `clockAlarm:clockAlarm1Enabled`, `clockAlarm:clockAlarm1Type`, `clockAlarm:clockAlarm1WakeupHour`, `clockAlarm:clockAlarm1WakeupMinute`, `clockAlarm:clockAlarm1BedtimeHour`, `clockAlarm:clockAlarm1BedtimeMinute`, `clockAlarm:clockAlarm2Enabled`, `clockAlarm:clockAlarm2Type`, `clockAlarm:clockAlarm2WakeupHour`, `clockAlarm:clockAlarm2WakeupMinute`, `clockAlarm:clockAlarm2BedtimeHour` and `clockAlarm:clockAlarm2BedtimeMinute`. -They have a number of channels to set the module's thermostat thermostat (`thermostat:currentTemperatureSetpoint`, `thermostat:heatingModeComfortTemperatureSetpoint`, `thermostat:heatingModeDayTemperatureSetpoint`, `thermostat:heatingModeNightTemperatureSetpoint`, `thermostat:heatingModeAntiFrostTemperatureSetpoint`, `thermostat:coolingModeComfortTemperatureSetpoint`, `thermostat:coolingModeDayTemperatureSetpoint`, `thermostat:coolingModeNightTemperatureSetpoint`, `thermostat:coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat:mode`) and thermostat trigger channels: `thermostat:heater`, `thermostat:boost`, `thermostat:pump`, `thermostat:cooler`, `thermostat:alarm1`, `thermostat:alarm2`, `thermostat:alarm3`, `thermostat:alarm4`. +They have have 32 channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH32`. +The thing type `vmbelo` has one output channel `output#output`. +They have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. +They have a number of channels to set the module's thermostat thermostat (`thermostat#currentTemperatureSetpoint`, `thermostat#heatingModeComfortTemperatureSetpoint`, `thermostat#heatingModeDayTemperatureSetpoint`, `thermostat#heatingModeNightTemperatureSetpoint`, `thermostat#heatingModeAntiFrostTemperatureSetpoint`, `thermostat#coolingModeComfortTemperatureSetpoint`, `thermostat#coolingModeDayTemperatureSetpoint`, `thermostat#coolingModeNightTemperatureSetpoint`, `thermostat#coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat#mode`) and thermostat trigger channels: `thermostat#heater`, `thermostat#boost`, `thermostat#pump`, `thermostat#cooler`, `thermostat#alarm1`, `thermostat#alarm2`, `thermostat#alarm3`, `thermostat#alarm4`. They also have two channels to control the module's display `oledDisplay:MEMO` and `oledDisplay:SCREENSAVER`. -Thing type `vmbmeteo`has 8 trigger channels (`input:CH1` ... `input:CH8`). These channels will be triggered by the module's alarms. -It has a number of channels to set the module's alarms: `clockAlarm:clockAlarm1Enabled`, `clockAlarm:clockAlarm1Type`, `clockAlarm:clockAlarm1WakeupHour`, `clockAlarm:clockAlarm1WakeupMinute`, `clockAlarm:clockAlarm1BedtimeHour`, `clockAlarm:clockAlarm1BedtimeMinute`, `clockAlarm:clockAlarm2Enabled`, `clockAlarm:clockAlarm2Type`, `clockAlarm:clockAlarm2WakeupHour`, `clockAlarm:clockAlarm2WakeupMinute`, `clockAlarm:clockAlarm2BedtimeHour` and `clockAlarm:clockAlarm2BedtimeMinute`. +Thing type `vmbmeteo`has 8 trigger channels (`input#CH1` ... `input#CH8`). These channels will be triggered by the module's alarms. +It has a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. It also has a number of channels to read out the weather station's sensors: `weatherStation:temperature`, `weatherStation:rainfall`, `weatherStation:illuminance` and `weatherStation:windspeed`. -Thing types `vmbpirc` and `vmbpirm` have 7 trigger channels `input:CH1` ... `input:CH7`. -Additionally, these modules have a number of channels to set the module's alarms: `clockAlarm:clockAlarm1Enabled`, `clockAlarm:clockAlarm1Type`, `clockAlarm:clockAlarm1WakeupHour`, `clockAlarm:clockAlarm1WakeupMinute`, `clockAlarm:clockAlarm1BedtimeHour`, `clockAlarm:clockAlarm1BedtimeMinute`, `clockAlarm:clockAlarm2Enabled`, `clockAlarm:clockAlarm2Type`, `clockAlarm:clockAlarm2WakeupHour`, `clockAlarm:clockAlarm2WakeupMinute`, `clockAlarm:clockAlarm2BedtimeHour` and `clockAlarm:clockAlarm2BedtimeMinute`. +Thing types `vmbpirc` and `vmbpirm` have 7 trigger channels `input#CH1` ... `input#CH7`. +Additionally, these modules have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. + +Thing type `vmbdali` has 81 trigger channels `input#CH1` ... `input#CH81`. +It has 81 channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH81`. +hsbColor command type is supported on channels `color#CH1` ... `color#CH64` (A1 ... A64), `color#CH65` ... `color#CH80` (G1 ... G16) and `color#CH81` (broadcast). This is to set the color on the channels. +Percent command type is supported on channels `brightness#CH1` ... `brightness#CH64` (A1 ... A64), `brightness#CH65` ... `brightness#CH80` (G1 ... G16) and `brightness#CH81` (broadcast). This is to set the brightness on the channels. +Percent command type is supported on channels `color-temperature#CH1` ... `color-temperature#CH64` (A1 ... A64), `color-temperature#CH65` ... `color-temperature#CH80` (G1 ... G16) and `color-temperature#CH81` (broadcast). This is to set the white temperature on the channels. +Values 1 to 15 are supported on channels `scene#CH1` ... `scene#CH64` (A1 ... A64), `scene#CH65` ... `scene#CH80` (G1 ... G16) and `scene#CH81` (broadcast). This is to set the scene on the channels. +hsbColor command type is supported on channels `virtual-light#VL1` ... `virtual-light#VL16`. This is to set the color on the virtual light. +It has a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. The trigger channels can be used as a trigger to rules. The event message can be `PRESSED`, `RELEASED`or `LONG_PRESSED`. @@ -276,7 +323,7 @@ Example trigger rule: ```java rule "example trigger rule" when - Channel 'velbus:vmb7in:1:05:CH5' triggered PRESSED + Channel 'velbus:vmb7in:1:05:input#CH5' triggered PRESSED then var message = receivedEvent.getEvent() logInfo("velbusTriggerExample", "Message: {}", message) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java index 7c975d992f4ec..6ca4cd6dbeea9 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java @@ -84,6 +84,7 @@ public class VelbusBindingConstants { 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"); + public static final ThingTypeUID THING_TYPE_VMBDALI = new ThingTypeUID(BINDING_ID, "vmbdali"); // thing type sets public static final Set BRIDGE_THING_TYPES_UIDS = Set.of(BRIDGE_THING_TYPE, @@ -98,7 +99,7 @@ public class VelbusBindingConstants { 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); + THING_TYPE_VMBVP1, THING_TYPE_VMBKP, THING_TYPE_VMBIN, THING_TYPE_VMB4PB, THING_TYPE_VMBDALI); // Velbus module types public static final byte MODULE_TYPE_VMB8PB = 0x01; @@ -114,6 +115,7 @@ public class VelbusBindingConstants { public static final byte MODULE_TYPE_VMB4RYLD = 0x10; public static final byte MODULE_TYPE_VMB4RYNO = 0x11; public static final byte MODULE_TYPE_VMB4DC = 0x12; + public static final byte MODULE_TYPE_VMBLCDWB = 0x13; public static final byte MODULE_TYPE_VMBDME = 0x14; public static final byte MODULE_TYPE_VMBDMI = 0x15; public static final byte MODULE_TYPE_VMB8PBU = 0x16; @@ -152,6 +154,7 @@ public class VelbusBindingConstants { public static final byte MODULE_TYPE_VMBKP = 0x42; public static final byte MODULE_TYPE_VMBIN = 0x43; public static final byte MODULE_TYPE_VMB4PB = 0x44; + public static final byte MODULE_TYPE_VMBDALI = 0x45; // Velbus commands public static final byte COMMAND_PUSH_BUTTON_STATUS = 0x00; @@ -161,11 +164,18 @@ public class VelbusBindingConstants { public static final byte COMMAND_BLIND_UP = 0x05; public static final byte COMMAND_BLIND_DOWN = 0x06; public static final byte COMMAND_SET_VALUE = 0x07; + public static final byte COMMAND_SET_DIMVALUE = 0x07; public static final byte COMMAND_SLIDER_STATUS = 0x0F; public static final byte COMMAND_RESTORE_LAST_DIMVALUE = 0x11; public static final byte COMMAND_BLIND_POS = 0x1C; + public static final byte COMMAND_SET_DIMSCENE = (byte) 0x1D; + public static final byte COMMAND_SET_COLOR = (byte) 0x1E; + public static final byte COMMAND_DIMVALUE_STATUS = (byte) 0xA5; + public static final byte COMMAND_SUBTYPE_3 = (byte) 0xA6; + public static final byte COMMAND_SUBTYPE_2 = (byte) 0xA7; public static final byte COMMAND_SENSOR_RAW_DATA = (byte) 0xA9; public static final byte COMMAND_LIGHT_VALUE_REQUEST = (byte) 0xAA; + public static final byte COMMAND_POWER_UP = (byte) 0xAB; public static final byte COMMAND_TEXT = (byte) 0xAC; public static final byte COMMAND_DAYLIGHT_SAVING_STATUS = (byte) 0xAF; public static final byte COMMAND_SUBTYPE = (byte) 0xB0; @@ -210,7 +220,14 @@ public class VelbusBindingConstants { public static final byte COMMAND_READ_DATA_FROM_MEMORY = (byte) 0xFD; public static final byte COMMAND_MEMORY_DATA = (byte) 0xFE; public static final byte COMMAND_MODULE_TYPE = (byte) 0xFF; + + // Usefull values public static final byte ALL_CHANNELS = (byte) 0xFF; + public static final byte ALL_DALI_CHANNELS = (byte) 0x51; + public static final byte SUB_ADDRESS_DISABLED = (byte) 0xFF; + public static final byte VALUE_UNCHANGED = (byte) 0xFF; + public static final byte DALI_SETTING_ACTUAL_LEVEL = (byte) 0x1A; + public static final byte DALI_MAX_VALUE = (byte) 0xFE; // Module properties public static final String PORT = "port"; @@ -226,32 +243,59 @@ public class VelbusBindingConstants { public static final String MODULE_MEMORY_MAP_VERSION = "memory map version"; public static final String MODULE_BUILD = "build"; public static final String CHANNEL = "CH"; + public static final String VIRTUAL_LIGHT = "VL"; public static final String SUB_ADDRESS = "subaddress"; public static final String DIMSPEED = "dimspeed"; + // Channels group ids + public static final String CHANNEL_GROUP_BRIDGE_CLOCK_ALARM = "bridgeClockAlarm"; + public static final String CHANNEL_GROUP_MODULE_CLOCK_ALARM = "clockAlarm"; + public static final String CHANNEL_GROUP_INPUT = "input"; + public static final String CHANNEL_GROUP_FEEDBACK = "feedback"; + public static final String CHANNEL_GROUP_BUTTON = "button"; + public static final String CHANNEL_GROUP_OUTPUT = "output"; + public static final String CHANNEL_GROUP_THERMOSTAT = "thermostat"; + public static final String CHANNEL_GROUP_COLOR = "color"; + public static final String CHANNEL_GROUP_BRIGHTNESS = "brightness"; + public static final String CHANNEL_GROUP_COLOR_TEMPERATURE = "color-temperature"; + public static final String CHANNEL_GROUP_SCENE = "scene"; + public static final String CHANNEL_GROUP_VIRTUAL_LIGHT = "virtual-light"; + // Channels ids - public static final String CHANNEL_BRIDGE_CLOCK_ALARM1_ENABLED = "bridgeClockAlarm#clockAlarm1Enabled"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM1_WAKEUP_HOUR = "bridgeClockAlarm#clockAlarm1WakeupHour"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM1_WAKEUP_MINUTE = "bridgeClockAlarm#clockAlarm1WakeupMinute"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM1_BEDTIME_HOUR = "bridgeClockAlarm#clockAlarm1BedtimeHour"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM1_BEDTIME_MINUTE = "bridgeClockAlarm#clockAlarm1BedtimeMinute"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM2_ENABLED = "bridgeClockAlarm#clockAlarm2Enabled"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM2_WAKEUP_HOUR = "bridgeClockAlarm#clockAlarm2WakeupHour"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM2_WAKEUP_MINUTE = "bridgeClockAlarm#clockAlarm2WakeupMinute"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM2_BEDTIME_HOUR = "bridgeClockAlarm#clockAlarm2BedtimeHour"; - public static final String CHANNEL_BRIDGE_CLOCK_ALARM2_BEDTIME_MINUTE = "bridgeClockAlarm#clockAlarm2BedtimeMinute"; - public static final String CHANNEL_MODULE_CLOCK_ALARM1_ENABLED = "clockAlarm#clockAlarm1Enabled"; - public static final String CHANNEL_MODULE_CLOCK_ALARM1_TYPE = "clockAlarm#clockAlarm1Type"; - public static final String CHANNEL_MODULE_CLOCK_ALARM1_WAKEUP_HOUR = "clockAlarm#clockAlarm1WakeupHour"; - public static final String CHANNEL_MODULE_CLOCK_ALARM1_WAKEUP_MINUTE = "clockAlarm#clockAlarm1WakeupMinute"; - public static final String CHANNEL_MODULE_CLOCK_ALARM1_BEDTIME_HOUR = "clockAlarm#clockAlarm1BedtimeHour"; - public static final String CHANNEL_MODULE_CLOCK_ALARM1_BEDTIME_MINUTE = "clockAlarm#clockAlarm1BedtimeMinute"; - public static final String CHANNEL_MODULE_CLOCK_ALARM2_ENABLED = "clockAlarm#clockAlarm2Enabled"; - public static final String CHANNEL_MODULE_CLOCK_ALARM2_TYPE = "clockAlarm#clockAlarm2Type"; - public static final String CHANNEL_MODULE_CLOCK_ALARM2_WAKEUP_HOUR = "clockAlarm#clockAlarm2WakeupHour"; - public static final String CHANNEL_MODULE_CLOCK_ALARM2_WAKEUP_MINUTE = "clockAlarm#clockAlarm2WakeupMinute"; - public static final String CHANNEL_MODULE_CLOCK_ALARM2_BEDTIME_HOUR = "clockAlarm#clockAlarm2BedtimeHour"; - public static final String CHANNEL_MODULE_CLOCK_ALARM2_BEDTIME_MINUTE = "clockAlarm#clockAlarm2BedtimeMinute"; + public static final String CHANNEL_CLOCK_ALARM1_TYPE = "clockAlarm1Type"; + public static final String CHANNEL_CLOCK_ALARM1_ENABLED = "clockAlarm1Enabled"; + public static final String CHANNEL_CLOCK_ALARM1_WAKEUP_HOUR = "clockAlarm1WakeupHour"; + public static final String CHANNEL_CLOCK_ALARM1_WAKEUP_MINUTE = "clockAlarm1WakeupMinute"; + public static final String CHANNEL_CLOCK_ALARM1_BEDTIME_HOUR = "clockAlarm1BedtimeHour"; + public static final String CHANNEL_CLOCK_ALARM1_BEDTIME_MINUTE = "clockAlarm1BedtimeMinute"; + public static final String CHANNEL_CLOCK_ALARM2_TYPE = "clockAlarm2Type"; + public static final String CHANNEL_CLOCK_ALARM2_ENABLED = "clockAlarm2Enabled"; + public static final String CHANNEL_CLOCK_ALARM2_WAKEUP_HOUR = "clockAlarm2WakeupHour"; + public static final String CHANNEL_CLOCK_ALARM2_WAKEUP_MINUTE = "clockAlarm2WakeupMinute"; + public static final String CHANNEL_CLOCK_ALARM2_BEDTIME_HOUR = "clockAlarm2BedtimeHour"; + public static final String CHANNEL_CLOCK_ALARM2_BEDTIME_MINUTE = "clockAlarm2BedtimeMinute"; + + public static final String CHANNEL_THERMOSTAT_CURRENT_TEMPERATURE = "currentTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_HEATING_COMFORT = "heatingModeComfortTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_HEATING_DAY = "heatingModeDayTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_HEATING_NIGHT = "heatingModeNightTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_HEATING_ANTI_FROST = "heatingModeAntiFrostTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_COOLING_COMFORT = "coolingModeComfortTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_COOLING_DAY = "coolingModeDayTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_COOLING_NIGHT = "coolingModeNightTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_COOLING_SAFE = "coolingModeSafeTemperatureSetpoint"; + public static final String CHANNEL_THERMOSTAT_OPERATING_MODE = "operatingMode"; + public static final String CHANNEL_THERMOSTAT_MODE = "mode"; + public static final String CHANNEL_THERMOSTAT_HEATER = "heater"; + public static final String CHANNEL_THERMOSTAT_BOOST = "boost"; + public static final String CHANNEL_THERMOSTAT_PUMP = "pump"; + public static final String CHANNEL_THERMOSTAT_COOLER = "cooler"; + public static final String CHANNEL_THERMOSTAT_ALARM1 = "alarm1"; + public static final String CHANNEL_THERMOSTAT_ALARM2 = "alarm2"; + public static final String CHANNEL_THERMOSTAT_ALARM3 = "alarm3"; + public static final String CHANNEL_THERMOSTAT_ALARM4 = "alarm4"; + + public static final String CHANNEL_OUTPUT = "output"; // Delay public static final Integer DELAY_SEND_CLOCK_ALARM_UPDATE = 10000; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java new file mode 100644 index 0000000000000..b95b8fa4762d0 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java @@ -0,0 +1,233 @@ +/** + * Copyright (c) 2010-2023 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.velbus.internal; + +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.core.library.types.HSBType; +import org.openhab.core.library.types.PercentType; +import org.openhab.core.util.ColorUtil; + +/** + * The {@link VelbusDALIConverter} represents a class with properties that manage DALI color channel. + * + * @author Daniel Rosengarten - Initial contribution + */ +@NonNullByDefault +public class VelbusColorChannel { + protected final int BRIGHTNESS_MIN_VALUE = 0; + protected final int BRIGHTNESS_MAX_VALUE = 100; + + protected final int COLOR_MIN_VALUE = 0; + protected final int COLOR_MAX_VALUE = 255; + + protected final int WHITE_MIN_VALUE = 0; + protected final int WHITE_MAX_VALUE = 100; + + private int brightness = 100; + private int[] color = { 255, 255, 255 }; + private int white = 100; + + /** + * @param brightness the brightness to set + */ + public void setBrightness(int brightness) { + this.brightness = (brightness < BRIGHTNESS_MIN_VALUE) ? BRIGHTNESS_MIN_VALUE : brightness; + this.brightness = (brightness > BRIGHTNESS_MAX_VALUE) ? BRIGHTNESS_MAX_VALUE : brightness; + } + + /** + * @param brightnessState the brightness to set + */ + public void setBrightness(PercentType brightnessState) { + this.brightness = brightnessState.intValue(); + } + + /** + * @param brightnessState the brightness to set + */ + public void setBrightness(HSBType brightnessState) { + setBrightness(brightnessState.getBrightness()); + } + + /** + * @param brightness the brightness to set from velbus packet + */ + public void setBrightness(byte brightness) { + if (brightness != VALUE_UNCHANGED) { + this.brightness = (Byte.toUnsignedInt(brightness) * BRIGHTNESS_MAX_VALUE) + / Byte.toUnsignedInt(DALI_MAX_VALUE); + } + } + + /** + * @return the brightness + */ + public int getBrightness() { + return this.brightness; + } + + /** + * @return the brightness in PercentType format + */ + public PercentType getBrightnessPercent() { + return new PercentType(getBrightness()); + } + + /** + * @return the brightness for velbus packet + */ + public byte getBrightnessVelbus() { + return (this.brightness == BRIGHTNESS_MAX_VALUE) ? DALI_MAX_VALUE + : Integer.valueOf((this.brightness * Byte.toUnsignedInt(DALI_MAX_VALUE)) / BRIGHTNESS_MAX_VALUE) + .byteValue(); + } + + /** + * @param rgb the color to set in RGB + */ + public void setColor(int[] rgb) { + if (rgb.length == 3) { + this.color[0] = (rgb[0] < COLOR_MIN_VALUE) ? COLOR_MIN_VALUE : rgb[0]; + this.color[0] = (rgb[0] > COLOR_MAX_VALUE) ? COLOR_MAX_VALUE : rgb[0]; + this.color[1] = (rgb[1] < COLOR_MIN_VALUE) ? COLOR_MIN_VALUE : rgb[1]; + this.color[1] = (rgb[1] > COLOR_MAX_VALUE) ? COLOR_MAX_VALUE : rgb[1]; + this.color[2] = (rgb[2] < COLOR_MIN_VALUE) ? COLOR_MIN_VALUE : rgb[2]; + this.color[2] = (rgb[2] > COLOR_MAX_VALUE) ? COLOR_MAX_VALUE : rgb[2]; + } + } + + /** + * @param hsbState the color to set in HSB + */ + public void setColor(HSBType hsbState) { + this.color = ColorUtil.hsbToRgb(hsbState); + } + + /** + * @param rgb the color to set in RGB from velbus packet + */ + public void setColor(byte[] rgb) { + if (rgb.length == 3) { + if (rgb[0] != VALUE_UNCHANGED) { + this.color[0] = (rgb[0] == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(rgb[0]); + } + if (rgb[1] != VALUE_UNCHANGED) { + this.color[1] = (rgb[1] == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(rgb[1]); + } + if (rgb[2] != VALUE_UNCHANGED) { + this.color[2] = (rgb[2] == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(rgb[2]); + } + } + } + + /** + * @param red the red value to set from velbus packet + */ + public void setRedColor(byte red) { + if (red != VALUE_UNCHANGED) { + this.color[0] = (red == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(red); + } + } + + /** + * @param green the green value to set from velbus packet + */ + public void setGreenColor(byte green) { + if (green != VALUE_UNCHANGED) { + this.color[1] = (green == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(green); + } + } + + /** + * @param blue the blue value to set from velbus packet + */ + public void setBlueColor(byte blue) { + if (blue != VALUE_UNCHANGED) { + this.color[2] = (blue == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(blue); + } + } + + /** + * @return the color in RGB + */ + public int[] getColor() { + return this.color; + } + + /** + * @return the color in HSBType format + */ + public HSBType getColorHSB() { + return ColorUtil.rgbToHsb(this.color); + } + + /** + * @return the color for velbus packet + */ + public byte[] getColorVelbus() { + byte[] rgb = { VALUE_UNCHANGED, VALUE_UNCHANGED, VALUE_UNCHANGED }; + + rgb[0] = (this.color[0] == COLOR_MAX_VALUE) ? DALI_MAX_VALUE : Integer.valueOf(this.color[0]).byteValue(); + rgb[1] = (this.color[1] == COLOR_MAX_VALUE) ? DALI_MAX_VALUE : Integer.valueOf(this.color[1]).byteValue(); + rgb[2] = (this.color[2] == COLOR_MAX_VALUE) ? DALI_MAX_VALUE : Integer.valueOf(this.color[2]).byteValue(); + return rgb; + } + + /** + * @param white the white to set + */ + public void setWhite(int white) { + this.white = (white < WHITE_MIN_VALUE) ? WHITE_MIN_VALUE : white; + this.white = (white < WHITE_MAX_VALUE) ? WHITE_MAX_VALUE : white; + } + + /** + * @param whiteState the white to set + */ + public void setWhite(PercentType whiteState) { + this.white = whiteState.intValue(); + } + + /** + * @param white the white to set from velbus packet + */ + public void setWhite(byte white) { + if (white != VALUE_UNCHANGED) { + this.white = (Byte.toUnsignedInt(white) * WHITE_MAX_VALUE) / Byte.toUnsignedInt(DALI_MAX_VALUE); + } + } + + /** + * @return the white + */ + public int getWhite() { + return this.white; + } + + /** + * @return the white in PercentType format + */ + public PercentType getWhitePercent() { + return new PercentType(this.white); + } + + /** + * @return the white value for velbus packet + */ + public byte getWhiteVelbus() { + return (this.white == WHITE_MAX_VALUE) ? DALI_MAX_VALUE + : Integer.valueOf((this.white * Byte.toUnsignedInt(DALI_MAX_VALUE)) / WHITE_MAX_VALUE).byteValue(); + } +} diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java index 51eb60de05351..3f9d9e8cc4e1b 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java @@ -28,6 +28,7 @@ import org.openhab.binding.velbus.internal.handler.VelbusVMB1TSHandler; import org.openhab.binding.velbus.internal.handler.VelbusVMB4ANHandler; import org.openhab.binding.velbus.internal.handler.VelbusVMB7INHandler; +import org.openhab.binding.velbus.internal.handler.VelbusVMBDALIHandler; import org.openhab.binding.velbus.internal.handler.VelbusVMBELHandler; import org.openhab.binding.velbus.internal.handler.VelbusVMBELOHandler; import org.openhab.binding.velbus.internal.handler.VelbusVMBGPHandler; @@ -50,6 +51,7 @@ * handlers. * * @author Cedric Boon - Initial contribution + * @author Daniel Rosengarten - Add VMB1RYS, VMBDALI */ @NonNullByDefault @Component(service = ThingHandlerFactory.class, configurationPid = "binding.velbus") @@ -106,6 +108,8 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { thingHandler = new VelbusVMB4ANHandler(thing); } else if (VelbusVMB1TSHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { thingHandler = new VelbusVMB1TSHandler(thing); + } else if (VelbusVMBDALIHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { + thingHandler = new VelbusVMBDALIHandler(thing); } return thingHandler; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModuleAddress.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModuleAddress.java index ab86ba2fb89a7..b5209351dff53 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModuleAddress.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModuleAddress.java @@ -12,6 +12,8 @@ */ package org.openhab.binding.velbus.internal; +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; + import java.util.ArrayList; import java.util.List; @@ -22,6 +24,7 @@ * The {@link VelbusModuleAddress} represents the address and possible subaddresses of a Velbus module. * * @author Cedric Boon - Initial contribution + * @author Daniel Rosengarten - Review sub-addresses management */ @NonNullByDefault public class VelbusModuleAddress { @@ -45,6 +48,18 @@ public void setSubAddresses(byte[] subAddresses) { this.subAddresses = subAddresses; } + public void setSubAddresses(byte[] subAddresses, int subTypeNumber) { + int srcLength = subAddresses.length; + int destPos = srcLength * (subTypeNumber - 1); + int copyLength = srcLength - ((4 * subTypeNumber) - this.subAddresses.length); + + if (copyLength > srcLength) { + copyLength = srcLength; + } + + System.arraycopy(subAddresses, 0, this.subAddresses, destPos, copyLength); + } + public byte[] getSubAddresses() { return subAddresses; } @@ -68,6 +83,23 @@ public byte[] getActiveAddresses() { return result; } + public byte[] getAllAddresses() { + List activeAddresses = new ArrayList<>(); + activeAddresses.add(address); + + for (int i = 0; i < subAddresses.length; i++) { + activeAddresses.add(subAddresses[i]); + } + + byte[] result = new byte[activeAddresses.size()]; + + for (int i = 0; i < activeAddresses.size(); i++) { + result[i] = activeAddresses.get(i); + } + + return result; + } + public VelbusChannelIdentifier getChannelIdentifier(ChannelUID channelUID) { int channelIndex = getChannelIndex(channelUID); @@ -83,7 +115,7 @@ public int getChannelIndex(ChannelUID channelUID) { } public String getChannelId(VelbusChannelIdentifier velbusChannelIdentifier) { - return "CH" + getChannelNumber(velbusChannelIdentifier); + return CHANNEL + getChannelNumber(velbusChannelIdentifier); } public int getChannelIndex(VelbusChannelIdentifier velbusChannelIdentifier) { @@ -91,10 +123,11 @@ public int getChannelIndex(VelbusChannelIdentifier velbusChannelIdentifier) { } public int getChannelNumber(VelbusChannelIdentifier velbusChannelIdentifier) { - byte[] activeAddresses = getActiveAddresses(); + byte[] allAddresses = getAllAddresses(); - for (int i = 0; i < activeAddresses.length; i++) { - if (velbusChannelIdentifier.getAddress() == activeAddresses[i]) { + for (int i = 0; i < allAddresses.length; i++) { + if ((allAddresses[i] != SUB_ADDRESS_DISABLED) + && (velbusChannelIdentifier.getAddress() == allAddresses[i])) { return (i * 8) + velbusChannelIdentifier.getChannelNumberFromBitNumber(); } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java new file mode 100644 index 0000000000000..6280f1db12987 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) 2010-2023 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.velbus.internal; + +import java.util.InvalidPropertiesFormatException; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link VelbusVirtualColorChannel} represents a class with properties that manage DALI virtual color channel. + * + * @author Daniel Rosengarten - Initial contribution + */ +@NonNullByDefault +public class VelbusVirtualColorChannel extends VelbusColorChannel { + private final byte NOT_CONFIGURED = (byte) 0x00; + + private byte redChannel; + private byte greenChannel; + private byte blueChannel; + + public VelbusVirtualColorChannel() { + redChannel = NOT_CONFIGURED; + greenChannel = NOT_CONFIGURED; + blueChannel = NOT_CONFIGURED; + } + + public VelbusVirtualColorChannel(int r, int g, int b, int w) { + redChannel = getByteValue(r); + greenChannel = getByteValue(g); + blueChannel = getByteValue(b); + } + + public VelbusVirtualColorChannel(String r, String g, String b, String w) throws NumberFormatException { + redChannel = getByteValue(r); + greenChannel = getByteValue(g); + blueChannel = getByteValue(b); + } + + public VelbusVirtualColorChannel(String rgbw) throws InvalidPropertiesFormatException, NumberFormatException { + String virtualChannels[] = rgbw.split("\\s*,\\s*"); + if (virtualChannels.length != 3) { + throw new InvalidPropertiesFormatException("Wrong format"); + } + + redChannel = getByteValue(virtualChannels[0]); + greenChannel = getByteValue(virtualChannels[1]); + blueChannel = getByteValue(virtualChannels[2]); + } + + private byte getByteValue(String channel) { + return Integer.valueOf(channel.substring(2)).byteValue(); + } + + private byte getByteValue(int channel) { + return Integer.valueOf(channel).byteValue(); + } + + public byte getRedChannel() { + return redChannel; + } + + public byte getGreenChannel() { + return greenChannel; + } + + public byte getBlueChannel() { + return blueChannel; + } + + public boolean isVirtualColorChannel(int channel) { + byte c = getByteValue(channel); + + if (c == redChannel || c == greenChannel || c == blueChannel) { + return true; + } + return false; + } + + public boolean isRGBConfigured() { + if (redChannel != NOT_CONFIGURED && greenChannel != NOT_CONFIGURED && blueChannel != NOT_CONFIGURED) { + return true; + } + return false; + } + + public int getRedColor() { + return super.getColor()[0]; + } + + public int getGreenColor() { + return super.getColor()[1]; + } + + public int getBlueColor() { + return super.getColor()[2]; + } + + public byte getRedColorVelbus() { + return super.getColorVelbus()[0]; + } + + public byte getGreenColorVelbus() { + return super.getColorVelbus()[1]; + } + + public byte getBlueColorVelbus() { + return super.getColorVelbus()[2]; + } + + public void setColor(byte color, int channel) { + byte c = getByteValue(channel); + if (c == redChannel) { + setRedColor(color); + } else if (c == greenChannel) { + setGreenColor(color); + } else if (c == blueChannel) { + setBlueColor(color); + } + } +} diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java index 0ea2bac0ebfb3..d028741dbfb74 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java @@ -44,6 +44,7 @@ * is used to return Velbus Modules as things to the framework. * * @author Cedric Boon - Initial contribution + * @author Daniel Rosengarten - Review sub-addresses management, add VMB1RYS, VMBDALI */ @NonNullByDefault public class VelbusThingDiscoveryService extends AbstractDiscoveryService @@ -99,7 +100,11 @@ public void onPacketReceived(byte[] packet) { } else if (command == COMMAND_MODULE_NAME_PART3 && packet.length >= 4 + length) { handleChannelNameCommand(packet, address, length, 3); } else if (command == COMMAND_SUBTYPE && packet.length >= 4 + length) { - handleModuleSubtypeCommand(packet, address); + handleModuleSubtypeCommand(packet, address, 1); + } else if (command == COMMAND_SUBTYPE_2 && packet.length >= 4 + length) { + handleModuleSubtypeCommand(packet, address, 2); + } else if (command == COMMAND_SUBTYPE_3 && packet.length >= 4 + length) { + handleModuleSubtypeCommand(packet, address, 3); } else { logger.debug("Unknown command '{}' to address '{}'.", String.format("%02X", command), String.format("%02X", address)); @@ -224,15 +229,15 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBDMIR, 1); break; case MODULE_TYPE_VMBEL1: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL1, 9); break; case MODULE_TYPE_VMBEL2: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL2, 9); break; case MODULE_TYPE_VMBEL4: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL4, 9); break; case MODULE_TYPE_VMBELO: @@ -240,39 +245,39 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBELO, 33); break; case MODULE_TYPE_VMBELPIR: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBELPIR, 9); break; case MODULE_TYPE_VMBGP1: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP1, 9); break; case MODULE_TYPE_VMBGP1_2: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP1_2, 9); break; case MODULE_TYPE_VMBGP2: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP2, 9); break; case MODULE_TYPE_VMBGP2_2: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP2_2, 9); break; case MODULE_TYPE_VMBGP4: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4, 9); break; case MODULE_TYPE_VMBGP4_2: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4_2, 9); break; case MODULE_TYPE_VMBGP4PIR: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4PIR, 9); break; case MODULE_TYPE_VMBGP4PIR_2: - velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4PIR_2, 9); break; case MODULE_TYPE_VMBGPO: @@ -323,6 +328,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB4PB, 8); break; + case MODULE_TYPE_VMBDALI: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 9), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBDALI, 81); + break; } if (velbusModule != null) { @@ -330,14 +339,15 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { } } - private void handleModuleSubtypeCommand(byte[] packet, byte address) { + private void handleModuleSubtypeCommand(byte[] packet, byte address, int subTypeNumber) { if (velbusModules.containsKey(address)) { VelbusModule velbusModule = velbusModules.get(address); byte[] subAddresses = new byte[4]; System.arraycopy(packet, 8, subAddresses, 0, 4); - velbusModule.getModuleAddress().setSubAddresses(subAddresses); + // velbusModule.getModuleAddress().setSubAddresses(subAddresses); + velbusModule.getModuleAddress().setSubAddresses(subAddresses, subTypeNumber); for (int i = 0; i < subAddresses.length; i++) { if (subAddresses[i] != (byte) 0xFF) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java index d6cf637141a93..e8ef923049e23 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java @@ -51,10 +51,26 @@ public class VelbusBlindsHandler extends VelbusThingHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(THING_TYPE_VMB1BL, THING_TYPE_VMB1BLS, THING_TYPE_VMB2BL, THING_TYPE_VMB2BLE)); + private volatile boolean disposed = true; + public VelbusBlindsHandler(Thing thing) { super(thing, 0); } + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); @@ -129,6 +145,10 @@ private Boolean isFirstGenerationDevice() { @Override public void onPacketReceived(byte[] packet) { + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java index 7d7fa266eff1d..6d0a5e2e0584a 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java @@ -161,41 +161,41 @@ public void handleCommand(ChannelUID channelUID, Command command) { alarmClock.setLocal(false); - switch (channelUID.getId()) { - case CHANNEL_BRIDGE_CLOCK_ALARM1_ENABLED: - case CHANNEL_BRIDGE_CLOCK_ALARM2_ENABLED: { + switch (channelUID.getIdWithoutGroup()) { + case CHANNEL_CLOCK_ALARM1_ENABLED: + case CHANNEL_CLOCK_ALARM2_ENABLED: { if (command instanceof OnOffType) { boolean enabled = command == OnOffType.ON; alarmClock.setEnabled(enabled); } break; } - case CHANNEL_BRIDGE_CLOCK_ALARM1_WAKEUP_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM2_WAKEUP_HOUR: { + case CHANNEL_CLOCK_ALARM1_WAKEUP_HOUR: + case CHANNEL_CLOCK_ALARM2_WAKEUP_HOUR: { if (command instanceof DecimalType decimalCommand) { byte wakeupHour = decimalCommand.byteValue(); alarmClock.setWakeupHour(wakeupHour); } break; } - case CHANNEL_BRIDGE_CLOCK_ALARM1_WAKEUP_MINUTE: - case CHANNEL_BRIDGE_CLOCK_ALARM2_WAKEUP_MINUTE: { + case CHANNEL_CLOCK_ALARM1_WAKEUP_MINUTE: + case CHANNEL_CLOCK_ALARM2_WAKEUP_MINUTE: { if (command instanceof DecimalType decimalCommand) { byte wakeupMinute = decimalCommand.byteValue(); alarmClock.setWakeupMinute(wakeupMinute); } break; } - case CHANNEL_BRIDGE_CLOCK_ALARM1_BEDTIME_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM2_BEDTIME_HOUR: { + case CHANNEL_CLOCK_ALARM1_BEDTIME_HOUR: + case CHANNEL_CLOCK_ALARM2_BEDTIME_HOUR: { if (command instanceof DecimalType decimalCommand) { byte bedTimeHour = decimalCommand.byteValue(); alarmClock.setBedtimeHour(bedTimeHour); } break; } - case CHANNEL_BRIDGE_CLOCK_ALARM1_BEDTIME_MINUTE: - case CHANNEL_BRIDGE_CLOCK_ALARM2_BEDTIME_MINUTE: { + case CHANNEL_CLOCK_ALARM1_BEDTIME_MINUTE: + case CHANNEL_CLOCK_ALARM2_BEDTIME_MINUTE: { if (command instanceof DecimalType decimalCommand) { byte bedTimeMinute = decimalCommand.byteValue(); alarmClock.setBedtimeMinute(bedTimeMinute); @@ -381,35 +381,22 @@ public void unregisterRelayStatusListener(byte address) { } protected boolean isAlarmClockChannel(ChannelUID channelUID) { - switch (channelUID.getId()) { - case CHANNEL_BRIDGE_CLOCK_ALARM1_ENABLED: - case CHANNEL_BRIDGE_CLOCK_ALARM1_WAKEUP_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM1_WAKEUP_MINUTE: - case CHANNEL_BRIDGE_CLOCK_ALARM1_BEDTIME_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM1_BEDTIME_MINUTE: - case CHANNEL_BRIDGE_CLOCK_ALARM2_ENABLED: - case CHANNEL_BRIDGE_CLOCK_ALARM2_WAKEUP_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM2_WAKEUP_MINUTE: - case CHANNEL_BRIDGE_CLOCK_ALARM2_BEDTIME_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM2_BEDTIME_MINUTE: - return true; - } - return false; + return CHANNEL_GROUP_BRIDGE_CLOCK_ALARM.equals(channelUID.getGroupId()); } protected byte determineAlarmNumber(ChannelUID channelUID) { - switch (channelUID.getId()) { - case CHANNEL_BRIDGE_CLOCK_ALARM1_ENABLED: - case CHANNEL_BRIDGE_CLOCK_ALARM1_WAKEUP_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM1_WAKEUP_MINUTE: - case CHANNEL_BRIDGE_CLOCK_ALARM1_BEDTIME_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM1_BEDTIME_MINUTE: + switch (channelUID.getIdWithoutGroup()) { + case CHANNEL_CLOCK_ALARM1_ENABLED: + case CHANNEL_CLOCK_ALARM1_WAKEUP_HOUR: + case CHANNEL_CLOCK_ALARM1_WAKEUP_MINUTE: + case CHANNEL_CLOCK_ALARM1_BEDTIME_HOUR: + case CHANNEL_CLOCK_ALARM1_BEDTIME_MINUTE: return 1; - case CHANNEL_BRIDGE_CLOCK_ALARM2_ENABLED: - case CHANNEL_BRIDGE_CLOCK_ALARM2_WAKEUP_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM2_WAKEUP_MINUTE: - case CHANNEL_BRIDGE_CLOCK_ALARM2_BEDTIME_HOUR: - case CHANNEL_BRIDGE_CLOCK_ALARM2_BEDTIME_MINUTE: + case CHANNEL_CLOCK_ALARM2_ENABLED: + case CHANNEL_CLOCK_ALARM2_WAKEUP_HOUR: + case CHANNEL_CLOCK_ALARM2_WAKEUP_MINUTE: + case CHANNEL_CLOCK_ALARM2_BEDTIME_HOUR: + case CHANNEL_CLOCK_ALARM2_BEDTIME_MINUTE: return 2; } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java index 5042378cc0c33..5b72fb64d0bb8 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java @@ -45,6 +45,8 @@ public class VelbusDimmerHandler extends VelbusThingHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB1DM, THING_TYPE_VMB1LED, THING_TYPE_VMB4DC, THING_TYPE_VMBDME, THING_TYPE_VMBDMI, THING_TYPE_VMBDMIR)); + private volatile boolean disposed = true; + private @NonNullByDefault({}) VelbusDimmerConfig dimmerConfig; public VelbusDimmerHandler(Thing thing) { @@ -56,6 +58,14 @@ public void initialize() { this.dimmerConfig = getConfigAs(VelbusDimmerConfig.class); super.initialize(); + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; } @Override @@ -105,6 +115,10 @@ private Boolean isFirstGenerationDevice() { @Override public void onPacketReceived(byte[] packet) { + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java index 13931d71c7483..0dc73980cfccc 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java @@ -43,10 +43,26 @@ public class VelbusRelayHandler extends VelbusThingHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB1RY, THING_TYPE_VMB1RYNO, THING_TYPE_VMB1RYNOS, THING_TYPE_VMB4RY, THING_TYPE_VMB4RYLD, THING_TYPE_VMB4RYNO)); + private volatile boolean disposed = true; + public VelbusRelayHandler(Thing thing) { super(thing, 0); } + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); @@ -80,6 +96,10 @@ private byte determineCommandByte(OnOffType command) { @Override public void onPacketReceived(byte[] packet) { + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayWithInputHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayWithInputHandler.java index a543bae88b192..dadeaa0c4e484 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayWithInputHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayWithInputHandler.java @@ -44,10 +44,26 @@ public class VelbusRelayWithInputHandler extends VelbusRelayHandler { private static final StringType PRESSED = new StringType("PRESSED"); private static final StringType LONG_PRESSED = new StringType("LONG_PRESSED"); + private volatile boolean disposed = true; + public VelbusRelayWithInputHandler(Thing thing) { super(thing); } + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -96,6 +112,10 @@ private boolean isTriggerChannel(byte address, byte channel) { public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java index 72a3a54c82ee4..5c7337e900d81 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java @@ -44,6 +44,8 @@ public class VelbusSensorHandler extends VelbusThingHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(THING_TYPE_VMB6IN, THING_TYPE_VMB8IR, THING_TYPE_VMB8PB)); + private volatile boolean disposed = true; + private static final StringType SET_LED = new StringType("SET_LED"); private static final StringType SLOW_BLINK_LED = new StringType("SLOW_BLINK_LED"); private static final StringType FAST_BLINK_LED = new StringType("FAST_BLINK_LED"); @@ -61,6 +63,20 @@ public VelbusSensorHandler(Thing thing, int numberOfSubAddresses) { super(thing, numberOfSubAddresses); } + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); @@ -99,19 +115,19 @@ public void handleCommand(ChannelUID channelUID, Command command) { packet.Pressed(); velbusBridgeHandler.sendPacket(packet.getBytes()); - triggerChannel("input#CH" + getModuleAddress().getChannelNumber(channelUID), + triggerChannel(CHANNEL_GROUP_INPUT + "#CH" + getModuleAddress().getChannelNumber(channelUID), CommonTriggerEvents.PRESSED); if (stringCommand.equals(LONG_PRESSED)) { packet.LongPressed(); velbusBridgeHandler.sendPacket(packet.getBytes()); - triggerChannel("input#CH" + getModuleAddress().getChannelNumber(channelUID), + triggerChannel(CHANNEL_GROUP_INPUT + "#CH" + getModuleAddress().getChannelNumber(channelUID), CommonTriggerEvents.LONG_PRESSED); } packet.Released(); velbusBridgeHandler.sendPacket(packet.getBytes()); - triggerChannel("input#CH" + getModuleAddress().getChannelNumber(channelUID), + triggerChannel(CHANNEL_GROUP_INPUT + "#CH" + getModuleAddress().getChannelNumber(channelUID), CommonTriggerEvents.RELEASED); } else { throw new UnsupportedOperationException( @@ -121,15 +137,19 @@ public void handleCommand(ChannelUID channelUID, Command command) { } private boolean isFeedbackChannel(ChannelUID channelUID) { - return "feedback".equals(channelUID.getGroupId()); + return CHANNEL_GROUP_FEEDBACK.equals(channelUID.getGroupId()); } private boolean isButtonChannel(ChannelUID channelUID) { - return "button".equals(channelUID.getGroupId()); + return CHANNEL_GROUP_BUTTON.equals(channelUID.getGroupId()); } @Override public void onPacketReceived(byte[] packet) { + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { @@ -144,7 +164,8 @@ public void onPacketReceived(byte[] packet) { if (channelJustPressed != 0) { VelbusChannelIdentifier velbusChannelIdentifier = new VelbusChannelIdentifier(address, channelJustPressed); - triggerChannel("input#" + getModuleAddress().getChannelId(velbusChannelIdentifier), + triggerChannel( + CHANNEL_GROUP_INPUT + "#" + getModuleAddress().getChannelId(velbusChannelIdentifier), CommonTriggerEvents.PRESSED); } @@ -152,7 +173,8 @@ public void onPacketReceived(byte[] packet) { if (channelJustReleased != 0) { VelbusChannelIdentifier velbusChannelIdentifier = new VelbusChannelIdentifier(address, channelJustReleased); - triggerChannel("input#" + getModuleAddress().getChannelId(velbusChannelIdentifier), + triggerChannel( + CHANNEL_GROUP_INPUT + "#" + getModuleAddress().getChannelId(velbusChannelIdentifier), CommonTriggerEvents.RELEASED); } @@ -160,7 +182,8 @@ public void onPacketReceived(byte[] packet) { if (channelLongPressed != 0) { VelbusChannelIdentifier velbusChannelIdentifier = new VelbusChannelIdentifier(address, channelLongPressed); - triggerChannel("input#" + getModuleAddress().getChannelId(velbusChannelIdentifier), + triggerChannel( + CHANNEL_GROUP_INPUT + "#" + getModuleAddress().getChannelId(velbusChannelIdentifier), CommonTriggerEvents.LONG_PRESSED); } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java index 364411c1d725b..4fcd67244d90b 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java @@ -82,6 +82,7 @@ public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler { 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); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBDALI, 0x0513); } private static final byte ALARM_CONFIGURATION_MEMORY_SIZE = 0x09; @@ -93,30 +94,36 @@ public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler { private static final StringType ALARM_TYPE_LOCAL = new StringType("LOCAL"); private static final StringType ALARM_TYPE_GLOBAL = new StringType("GLOBAL"); - private final ChannelUID clockAlarm1Enabled = new ChannelUID(thing.getUID(), "clockAlarm", "clockAlarm1Enabled"); - private final ChannelUID clockAlarm1Type = new ChannelUID(thing.getUID(), "clockAlarm", "clockAlarm1Type"); - private final ChannelUID clockAlarm1WakeupHour = new ChannelUID(thing.getUID(), "clockAlarm", - "clockAlarm1WakeupHour"); - private final ChannelUID clockAlarm1WakeupMinute = new ChannelUID(thing.getUID(), "clockAlarm", - "clockAlarm1WakeupMinute"); - private final ChannelUID clockAlarm1BedtimeHour = new ChannelUID(thing.getUID(), "clockAlarm", - "clockAlarm1BedtimeHour"); - private final ChannelUID clockAlarm1BedtimeMinute = new ChannelUID(thing.getUID(), "clockAlarm", - "clockAlarm1BedtimeMinute"); - private final ChannelUID clockAlarm2Enabled = new ChannelUID(thing.getUID(), "clockAlarm", "clockAlarm2Enabled"); - private final ChannelUID clockAlarm2Type = new ChannelUID(thing.getUID(), "clockAlarm", "clockAlarm2Type"); - private final ChannelUID clockAlarm2WakeupHour = new ChannelUID(thing.getUID(), "clockAlarm", - "clockAlarm2WakeupHour"); - private final ChannelUID clockAlarm2WakeupMinute = new ChannelUID(thing.getUID(), "clockAlarm", - "clockAlarm2WakeupMinute"); - private final ChannelUID clockAlarm2BedtimeHour = new ChannelUID(thing.getUID(), "clockAlarm", - "clockAlarm2BedtimeHour"); - private final ChannelUID clockAlarm2BedtimeMinute = new ChannelUID(thing.getUID(), "clockAlarm", - "clockAlarm2BedtimeMinute"); + private final ChannelUID clockAlarm1Enabled = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM1_ENABLED); + private final ChannelUID clockAlarm1Type = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM1_TYPE); + private final ChannelUID clockAlarm1WakeupHour = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM1_WAKEUP_HOUR); + private final ChannelUID clockAlarm1WakeupMinute = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM1_WAKEUP_MINUTE); + private final ChannelUID clockAlarm1BedtimeHour = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM1_BEDTIME_HOUR); + private final ChannelUID clockAlarm1BedtimeMinute = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM1_BEDTIME_MINUTE); + private final ChannelUID clockAlarm2Enabled = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM2_ENABLED); + private final ChannelUID clockAlarm2Type = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM2_TYPE); + private final ChannelUID clockAlarm2WakeupHour = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM2_WAKEUP_HOUR); + private final ChannelUID clockAlarm2WakeupMinute = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM2_WAKEUP_MINUTE); + private final ChannelUID clockAlarm2BedtimeHour = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM2_BEDTIME_HOUR); + private final ChannelUID clockAlarm2BedtimeMinute = new ChannelUID(thing.getUID(), CHANNEL_GROUP_MODULE_CLOCK_ALARM, + CHANNEL_CLOCK_ALARM2_BEDTIME_MINUTE); private int clockAlarmConfigurationMemoryAddress; private VelbusClockAlarmConfiguration alarmClockConfiguration = new VelbusClockAlarmConfiguration(); + private volatile boolean disposed = true; + private long lastUpdateAlarm1TimeMillis; private long lastUpdateAlarm2TimeMillis; @@ -136,6 +143,14 @@ public void initialize() { this.clockAlarmConfigurationMemoryAddress = ALARM_CONFIGURATION_MEMORY_ADDRESSES .get(thing.getThingTypeUID()); } + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; } @Override @@ -158,52 +173,52 @@ public void handleCommand(ChannelUID channelUID, Command command) { alarmClock.setLocal(true); - switch (channelUID.getId()) { - case CHANNEL_MODULE_CLOCK_ALARM1_TYPE: - case CHANNEL_MODULE_CLOCK_ALARM2_TYPE: { + switch (channelUID.getIdWithoutGroup()) { + case CHANNEL_CLOCK_ALARM1_TYPE: + case CHANNEL_CLOCK_ALARM2_TYPE: { if (command instanceof OnOffType) { // If AlarmType is not read only, it's an old implementation of the module, warn user and // discard the command logger.warn( - "Old implementation of thing '{}', still works, but it's better to remove and recreate the thing.", + "Old implementation of thing '{}'. Only local alarm on module, global alarm only on bridge. To avoid problem, remove and recreate the thing.", getThing().getUID()); } return; } - case CHANNEL_MODULE_CLOCK_ALARM1_ENABLED: - case CHANNEL_MODULE_CLOCK_ALARM2_ENABLED: { + case CHANNEL_CLOCK_ALARM1_ENABLED: + case CHANNEL_CLOCK_ALARM2_ENABLED: { if (command instanceof OnOffType) { boolean enabled = command == OnOffType.ON; alarmClock.setEnabled(enabled); } break; } - case CHANNEL_MODULE_CLOCK_ALARM1_WAKEUP_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM2_WAKEUP_HOUR: { + case CHANNEL_CLOCK_ALARM1_WAKEUP_HOUR: + case CHANNEL_CLOCK_ALARM2_WAKEUP_HOUR: { if (command instanceof DecimalType decimalCommand) { byte wakeupHour = decimalCommand.byteValue(); alarmClock.setWakeupHour(wakeupHour); } break; } - case CHANNEL_MODULE_CLOCK_ALARM1_WAKEUP_MINUTE: - case CHANNEL_MODULE_CLOCK_ALARM2_WAKEUP_MINUTE: { + case CHANNEL_CLOCK_ALARM1_WAKEUP_MINUTE: + case CHANNEL_CLOCK_ALARM2_WAKEUP_MINUTE: { if (command instanceof DecimalType decimalCommand) { byte wakeupMinute = decimalCommand.byteValue(); alarmClock.setWakeupMinute(wakeupMinute); } break; } - case CHANNEL_MODULE_CLOCK_ALARM1_BEDTIME_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM2_BEDTIME_HOUR: { + case CHANNEL_CLOCK_ALARM1_BEDTIME_HOUR: + case CHANNEL_CLOCK_ALARM2_BEDTIME_HOUR: { if (command instanceof DecimalType decimalCommand) { byte bedTimeHour = decimalCommand.byteValue(); alarmClock.setBedtimeHour(bedTimeHour); } break; } - case CHANNEL_MODULE_CLOCK_ALARM1_BEDTIME_MINUTE: - case CHANNEL_MODULE_CLOCK_ALARM2_BEDTIME_MINUTE: { + case CHANNEL_CLOCK_ALARM1_BEDTIME_MINUTE: + case CHANNEL_CLOCK_ALARM2_BEDTIME_MINUTE: { if (command instanceof DecimalType decimalCommand) { byte bedTimeMinute = decimalCommand.byteValue(); alarmClock.setBedtimeMinute(bedTimeMinute); @@ -259,6 +274,10 @@ public synchronized void sendAlarmPacket(int alarmNumber, byte[] packetBytes) { public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { @@ -368,43 +387,28 @@ public void setClockAlarmConfigurationByte(int memoryAddress, byte data) { } protected boolean isAlarmClockChannel(ChannelUID channelUID) { - switch (channelUID.getId()) { - case CHANNEL_MODULE_CLOCK_ALARM1_ENABLED: - case CHANNEL_MODULE_CLOCK_ALARM1_TYPE: - case CHANNEL_MODULE_CLOCK_ALARM1_WAKEUP_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM1_WAKEUP_MINUTE: - case CHANNEL_MODULE_CLOCK_ALARM1_BEDTIME_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM1_BEDTIME_MINUTE: - case CHANNEL_MODULE_CLOCK_ALARM2_ENABLED: - case CHANNEL_MODULE_CLOCK_ALARM2_TYPE: - case CHANNEL_MODULE_CLOCK_ALARM2_WAKEUP_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM2_WAKEUP_MINUTE: - case CHANNEL_MODULE_CLOCK_ALARM2_BEDTIME_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM2_BEDTIME_MINUTE: - return true; - } - return false; + return CHANNEL_GROUP_MODULE_CLOCK_ALARM.equals(channelUID.getGroupId()); } protected byte determineAlarmNumber(ChannelUID channelUID) { - switch (channelUID.getId()) { - case CHANNEL_MODULE_CLOCK_ALARM1_ENABLED: - case CHANNEL_MODULE_CLOCK_ALARM1_TYPE: - case CHANNEL_MODULE_CLOCK_ALARM1_WAKEUP_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM1_WAKEUP_MINUTE: - case CHANNEL_MODULE_CLOCK_ALARM1_BEDTIME_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM1_BEDTIME_MINUTE: + switch (channelUID.getIdWithoutGroup()) { + case CHANNEL_CLOCK_ALARM1_ENABLED: + case CHANNEL_CLOCK_ALARM1_TYPE: + case CHANNEL_CLOCK_ALARM1_WAKEUP_HOUR: + case CHANNEL_CLOCK_ALARM1_WAKEUP_MINUTE: + case CHANNEL_CLOCK_ALARM1_BEDTIME_HOUR: + case CHANNEL_CLOCK_ALARM1_BEDTIME_MINUTE: return 1; - case CHANNEL_MODULE_CLOCK_ALARM2_ENABLED: - case CHANNEL_MODULE_CLOCK_ALARM2_TYPE: - case CHANNEL_MODULE_CLOCK_ALARM2_WAKEUP_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM2_WAKEUP_MINUTE: - case CHANNEL_MODULE_CLOCK_ALARM2_BEDTIME_HOUR: - case CHANNEL_MODULE_CLOCK_ALARM2_BEDTIME_MINUTE: + case CHANNEL_CLOCK_ALARM2_ENABLED: + case CHANNEL_CLOCK_ALARM2_TYPE: + case CHANNEL_CLOCK_ALARM2_WAKEUP_HOUR: + case CHANNEL_CLOCK_ALARM2_WAKEUP_MINUTE: + case CHANNEL_CLOCK_ALARM2_BEDTIME_HOUR: + case CHANNEL_CLOCK_ALARM2_BEDTIME_MINUTE: return 2; } - throw new IllegalArgumentException("The given channelUID is not an alarm clock channel: " + channelUID); + throw new IllegalArgumentException("The given channelUID is not a module alarm clock channel: " + channelUID); } protected int getClockAlarmAndProgramSelectionIndexInModuleStatus() { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java index 198854cb78fa9..f6f8fb18d06aa 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java @@ -41,6 +41,8 @@ */ @NonNullByDefault public abstract class VelbusTemperatureSensorHandler extends VelbusSensorWithAlarmClockHandler { + private volatile boolean disposed = true; + private @Nullable ScheduledFuture refreshJob; private @NonNullByDefault({}) VelbusSensorConfig sensorConfig; private ChannelUID temperatureChannel; @@ -58,6 +60,7 @@ public void initialize() { super.initialize(); initializeAutomaticRefresh(); + disposed = false; } private void initializeAutomaticRefresh() { @@ -74,6 +77,9 @@ public void dispose() { if (refreshJob != null) { refreshJob.cancel(true); } + super.dispose(); + + disposed = true; } private void startAutomaticRefresh(int refreshInterval) { @@ -117,6 +123,10 @@ protected void sendSensorReadoutRequest(VelbusBridgeHandler velbusBridgeHandler) public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java index 281d22c0a3852..9eeb733a685ad 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java @@ -29,6 +29,7 @@ import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; import org.openhab.core.thing.ThingStatusDetail; +import org.openhab.core.thing.ThingTypeUID; import org.openhab.core.types.Command; import org.openhab.core.types.RefreshType; @@ -40,6 +41,8 @@ */ @NonNullByDefault public abstract class VelbusThermostatHandler extends VelbusTemperatureSensorHandler { + private volatile boolean disposed = true; + private static final double THERMOSTAT_TEMPERATURE_SETPOINT_RESOLUTION = 0.5; private static final StringType OPERATING_MODE_HEATING = new StringType("HEATING"); @@ -58,39 +61,63 @@ public abstract class VelbusThermostatHandler extends VelbusTemperatureSensorHan private static final byte DAY_MODE_MASK = (byte) 0x20; private static final byte NIGHT_MODE_MASK = (byte) 0x10; - private final ChannelUID currentTemperatureSetpointChannel = new ChannelUID(thing.getUID(), "thermostat", - "currentTemperatureSetpoint"); - private final ChannelUID heatingModeComfortTemperatureSetpointChannel = new ChannelUID(thing.getUID(), "thermostat", - "heatingModeComfortTemperatureSetpoint"); - private final ChannelUID heatingModeDayTemperatureSetpointChannel = new ChannelUID(thing.getUID(), "thermostat", - "heatingModeDayTemperatureSetpoint"); - private final ChannelUID heatingModeNightTemperatureSetpointChannel = new ChannelUID(thing.getUID(), "thermostat", - "heatingModeNightTemperatureSetpoint"); + private final ChannelUID currentTemperatureSetpointChannel = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_CURRENT_TEMPERATURE); + private final ChannelUID heatingModeComfortTemperatureSetpointChannel = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_HEATING_COMFORT); + private final ChannelUID heatingModeDayTemperatureSetpointChannel = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_HEATING_DAY); + private final ChannelUID heatingModeNightTemperatureSetpointChannel = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_HEATING_NIGHT); private final ChannelUID heatingModeAntifrostTemperatureSetpointChannel = new ChannelUID(thing.getUID(), - "thermostat", "heatingModeAntiFrostTemperatureSetpoint"); - private final ChannelUID coolingModeComfortTemperatureSetpointChannel = new ChannelUID(thing.getUID(), "thermostat", - "coolingModeComfortTemperatureSetpoint"); - private final ChannelUID coolingModeDayTemperatureSetpointChannel = new ChannelUID(thing.getUID(), "thermostat", - "coolingModeDayTemperatureSetpoint"); - private final ChannelUID coolingModeNightTemperatureSetpointChannel = new ChannelUID(thing.getUID(), "thermostat", - "coolingModeNightTemperatureSetpoint"); - private final ChannelUID coolingModeSafeTemperatureSetpointChannel = new ChannelUID(thing.getUID(), "thermostat", - "coolingModeSafeTemperatureSetpoint"); - private final ChannelUID operatingModeChannel = new ChannelUID(thing.getUID(), "thermostat", "operatingMode"); - private final ChannelUID modeChannel = new ChannelUID(thing.getUID(), "thermostat", "mode"); - private final ChannelUID heaterChannel = new ChannelUID(thing.getUID(), "thermostat", "heater"); - private final ChannelUID boostChannel = new ChannelUID(thing.getUID(), "thermostat", "boost"); - private final ChannelUID pumpChannel = new ChannelUID(thing.getUID(), "thermostat", "pump"); - private final ChannelUID coolerChannel = new ChannelUID(thing.getUID(), "thermostat", "cooler"); - private final ChannelUID alarm1Channel = new ChannelUID(thing.getUID(), "thermostat", "alarm1"); - private final ChannelUID alarm2Channel = new ChannelUID(thing.getUID(), "thermostat", "alarm2"); - private final ChannelUID alarm3Channel = new ChannelUID(thing.getUID(), "thermostat", "alarm3"); - private final ChannelUID alarm4Channel = new ChannelUID(thing.getUID(), "thermostat", "alarm4"); + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_HEATING_ANTI_FROST); + private final ChannelUID coolingModeComfortTemperatureSetpointChannel = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_COOLING_COMFORT); + private final ChannelUID coolingModeDayTemperatureSetpointChannel = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_COOLING_DAY); + private final ChannelUID coolingModeNightTemperatureSetpointChannel = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_COOLING_NIGHT); + private final ChannelUID coolingModeSafeTemperatureSetpointChannel = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_THERMOSTAT, CHANNEL_THERMOSTAT_COOLING_SAFE); + private final ChannelUID operatingModeChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_OPERATING_MODE); + private final ChannelUID modeChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_MODE); + private final ChannelUID heaterChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_HEATER); + private final ChannelUID boostChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_BOOST); + private final ChannelUID pumpChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_PUMP); + private final ChannelUID coolerChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_COOLER); + private final ChannelUID alarm1Channel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_ALARM1); + private final ChannelUID alarm2Channel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_ALARM2); + private final ChannelUID alarm3Channel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_ALARM3); + private final ChannelUID alarm4Channel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_THERMOSTAT, + CHANNEL_THERMOSTAT_ALARM4); public VelbusThermostatHandler(Thing thing, int numberOfSubAddresses, ChannelUID temperatureChannel) { super(thing, numberOfSubAddresses, temperatureChannel); } + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -157,6 +184,10 @@ public void handleCommand(ChannelUID channelUID, Command command) { public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { @@ -238,12 +269,35 @@ public void onPacketReceived(byte[] packet) { THERMOSTAT_TEMPERATURE_SETPOINT_RESOLUTION); updateState(currentTemperatureSetpointChannel, new QuantityType<>(targetTemperatureValue, SIUnits.CELSIUS)); - } else if (address != this.getModuleAddress().getAddress() && command == COMMAND_PUSH_BUTTON_STATUS) { - byte outputChannelsJustActivated = packet[5]; - byte outputChannelsJustDeactivated = packet[6]; + } else if (command == COMMAND_PUSH_BUTTON_STATUS) { + ThingTypeUID thingTypeUID = this.thing.getThingTypeUID(); + if (thingTypeUID.equals(THING_TYPE_VMBELO) || thingTypeUID.equals(THING_TYPE_VMBGPO) + || thingTypeUID.equals(THING_TYPE_VMBGPOD) || thingTypeUID.equals(THING_TYPE_VMBGPOD_2)) { + // modules VMBELO, VMBGPO, VMBGPOD, VMBGPOD_2 use sub-address 4 for sensor + if (address == this.getModuleAddress().getSubAddresses()[3]) { + byte outputChannelsJustActivated = packet[5]; + byte outputChannelsJustDeactivated = packet[6]; + + triggerThermostatChannels(outputChannelsJustActivated, CommonTriggerEvents.PRESSED); + triggerThermostatChannels(outputChannelsJustDeactivated, CommonTriggerEvents.RELEASED); + } + // modules VMBEL1, VMBEL2, VMBEL4, VMBELPIR, VMBGP1, VMBGP1-2, VMBGP2, VMBGP2-2, VMBGP4, VMBGP4-2, + // VMBGP4PIR, VMBGP4PIR-2 use sub-address 1 for sensor, wich is not usable as push button + } else if (thingTypeUID.equals(THING_TYPE_VMBEL1) || thingTypeUID.equals(THING_TYPE_VMBEL2) + || thingTypeUID.equals(THING_TYPE_VMBEL4) || thingTypeUID.equals(THING_TYPE_VMBELPIR) + || thingTypeUID.equals(THING_TYPE_VMBGP1) || thingTypeUID.equals(THING_TYPE_VMBGP1_2) + || thingTypeUID.equals(THING_TYPE_VMBGP2) || thingTypeUID.equals(THING_TYPE_VMBGP2_2) + || thingTypeUID.equals(THING_TYPE_VMBGP4) || thingTypeUID.equals(THING_TYPE_VMBGP4_2) + || thingTypeUID.equals(THING_TYPE_VMBGP4PIR) || thingTypeUID.equals(THING_TYPE_VMBGP4PIR_2)) { + if (address != this.getModuleAddress().getAddress()) { + byte outputChannelsJustActivated = packet[5]; + byte outputChannelsJustDeactivated = packet[6]; + + triggerThermostatChannels(outputChannelsJustActivated, CommonTriggerEvents.PRESSED); + triggerThermostatChannels(outputChannelsJustDeactivated, CommonTriggerEvents.RELEASED); + } + } - triggerThermostatChannels(outputChannelsJustActivated, CommonTriggerEvents.PRESSED); - triggerThermostatChannels(outputChannelsJustDeactivated, CommonTriggerEvents.RELEASED); } } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java index 2f2acabd32247..8e64a2fbac0c2 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java @@ -152,7 +152,14 @@ private void initializeThing(ThingStatus bridgeStatus) { if (subAddress != null) { subAddresses[i] = hexToByte(subAddress); } else { - subAddresses[i] = (byte) 0xFF; + if (getConfig().get(propertyKey) != null) { + subAddress = getConfig().get(propertyKey).toString(); + if (subAddress != null) { + subAddresses[i] = hexToByte(subAddress); + } + } else { + subAddresses[i] = (byte) 0xFF; + } } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java index 482c96d3ba78b..f29a717196afb 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java @@ -51,6 +51,8 @@ public class VelbusVMB4ANHandler extends VelbusSensorWithAlarmClockHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB4AN)); + private volatile boolean disposed = true; + private static final String ALARM_GROUP = "alarm"; private static final String ANALOG_INPUT_GROUP = "analogInput"; private static final String ANALOG_OUTPUT_GROUP = "analogOutput"; @@ -77,6 +79,7 @@ public void initialize() { super.initialize(); initializeAutomaticRefresh(); + disposed = false; } private void initializeAutomaticRefresh() { @@ -93,6 +96,9 @@ public void dispose() { if (refreshJob != null) { refreshJob.cancel(true); } + super.dispose(); + + disposed = true; } private void startAutomaticRefresh(int refreshInterval) { @@ -146,6 +152,10 @@ protected void sendSensorReadoutRequest(VelbusBridgeHandler velbusBridgeHandler, public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB7INHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB7INHandler.java index ff170087b858d..c526ee819d6f9 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB7INHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB7INHandler.java @@ -45,6 +45,8 @@ public class VelbusVMB7INHandler extends VelbusSensorWithAlarmClockHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB7IN)); + private volatile boolean disposed = true; + private final ChannelUID counter1Channel = new ChannelUID(thing.getUID(), "counter", "counter1"); private final ChannelUID counter1ChannelCurrent = new ChannelUID(thing.getUID(), "counter", "counter1Current"); private final ChannelUID counter2Channel = new ChannelUID(thing.getUID(), "counter", "counter2"); @@ -69,6 +71,7 @@ public void initialize() { super.initialize(); initializeAutomaticRefresh(); + disposed = false; } private void initializeAutomaticRefresh() { @@ -85,6 +88,9 @@ public void dispose() { if (refreshJob != null) { refreshJob.cancel(true); } + super.dispose(); + + disposed = true; } private void startAutomaticRefresh(int refreshInterval) { @@ -134,6 +140,10 @@ protected void sendCounterStatusRequest(VelbusBridgeHandler velbusBridgeHandler, public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java new file mode 100644 index 0000000000000..44e97f34dfa02 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -0,0 +1,393 @@ +/** + * Copyright (c) 2010-2023 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.velbus.internal.handler; + +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.velbus.internal.VelbusColorChannel; +import org.openhab.binding.velbus.internal.VelbusVirtualColorChannel; +import org.openhab.binding.velbus.internal.config.VelbusSensorConfig; +import org.openhab.binding.velbus.internal.packets.VelbusDaliRequestPacket; +import org.openhab.binding.velbus.internal.packets.VelbusPacket; +import org.openhab.binding.velbus.internal.packets.VelbusSetColorPacket; +import org.openhab.binding.velbus.internal.packets.VelbusSetDimPacket; +import org.openhab.binding.velbus.internal.packets.VelbusSetScenePacket; +import org.openhab.core.library.types.DecimalType; +import org.openhab.core.library.types.HSBType; +import org.openhab.core.library.types.PercentType; +import org.openhab.core.thing.ChannelUID; +import org.openhab.core.thing.Thing; +import org.openhab.core.thing.ThingStatus; +import org.openhab.core.thing.ThingStatusDetail; +import org.openhab.core.thing.ThingTypeUID; +import org.openhab.core.types.Command; +import org.openhab.core.types.RefreshType; + +/** + * The {@link VelbusVMBDALIHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Daniel Rosengarten - Initial contribution + */ +@NonNullByDefault +public class VelbusVMBDALIHandler extends VelbusSensorWithAlarmClockHandler { + public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBDALI)); + private @Nullable ScheduledFuture refreshJob; + private @NonNullByDefault({}) VelbusSensorConfig sensorConfig; + private volatile boolean disposed = true; + + private VelbusColorChannel[] colorChannels; + private VelbusVirtualColorChannel[] virtualColorChannels; + + public VelbusVMBDALIHandler(Thing thing) { + super(thing, 9); + + colorChannels = new VelbusColorChannel[81]; + virtualColorChannels = new VelbusVirtualColorChannel[16]; + } + + @Override + public void initialize() { + this.sensorConfig = getConfigAs(VelbusSensorConfig.class); + + super.initialize(); + + initializeAutomaticRefresh(); + initializeColorChannel(); + initializeVirtualLight(); + disposed = false; + initializeChannelStates(); + } + + private void initializeAutomaticRefresh() { + int refreshInterval = this.sensorConfig.refresh; + + if (refreshInterval > 0) { + startAutomaticRefresh(refreshInterval); + } + } + + private void initializeColorChannel() { + for (int i = 0; i <= 80; i++) { + colorChannels[i] = new VelbusColorChannel(); + } + } + + private void initializeVirtualLight() { + String virtualLight; + + for (int i = 1; i <= 16; i++) { + if (getConfig().containsKey(VIRTUAL_LIGHT + i)) { + virtualLight = getConfig().get(VIRTUAL_LIGHT + i).toString(); + if (virtualLight.length() > 0) { + try { + virtualColorChannels[i - 1] = new VelbusVirtualColorChannel(virtualLight); + } catch (Exception e) { + logger.error("VMBDALI on address {} : Virtual Light {} has wrong channel format '{}' ", + getModuleAddress().getAddress(), i, virtualLight); + } + } + } + if (virtualColorChannels[i - 1] == null) { + virtualColorChannels[i - 1] = new VelbusVirtualColorChannel(); + } + } + } + + private void initializeChannelStates() { + VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); + if (velbusBridgeHandler == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + return; + } + + sendDaliReadoutRequest(velbusBridgeHandler, ALL_DALI_CHANNELS); + } + + @Override + public void dispose() { + final ScheduledFuture refreshJob = this.refreshJob; + if (refreshJob != null) { + refreshJob.cancel(true); + } + disposed = true; + } + + private void startAutomaticRefresh(int refreshInterval) { + VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); + if (velbusBridgeHandler == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + return; + } + + refreshJob = scheduler.scheduleWithFixedDelay(() -> { + sendDaliReadoutRequest(velbusBridgeHandler, ALL_DALI_CHANNELS); + }, 0, refreshInterval, TimeUnit.SECONDS); + } + + protected void sendDaliReadoutRequest(VelbusBridgeHandler velbusBridgeHandler, byte channel) { + VelbusDaliRequestPacket packet = new VelbusDaliRequestPacket(getModuleAddress().getAddress(), channel); + + byte[] packetBytes = packet.getBytes(); + velbusBridgeHandler.sendPacket(packetBytes); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + super.handleCommand(channelUID, command); + + VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); + if (velbusBridgeHandler == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + return; + } + + byte address = getModuleAddress().getChannelIdentifier(channelUID).getAddress(); + byte channel = Integer.valueOf(getModuleAddress().getChannelNumber(channelUID)).byteValue(); + + if (command instanceof RefreshType) { + if (isColorGroupChannel(channelUID) || isBrightnessGroupChannel(channelUID) + || isColorTemperatureGroupChannel(channelUID)) { + sendDaliReadoutRequest(velbusBridgeHandler, channel); + } + } else if (isSceneGroupChannel(channelUID)) { + if (command instanceof DecimalType decimalCommand) { + byte scene = decimalCommand.byteValue(); + + VelbusSetScenePacket packet = new VelbusSetScenePacket(address, channel, scene); + velbusBridgeHandler.sendPacket(packet.getBytes()); + } else { + throw new UnsupportedOperationException( + "The command '" + command + "' is not supported on channel '" + channelUID + "'."); + } + } else if (isColorGroupChannel(channelUID) || isBrightnessGroupChannel(channelUID) + || isColorTemperatureGroupChannel(channelUID) || isVirtualLightChannel(channelUID)) { + VelbusColorChannel colorChannel = colorChannels[Byte.toUnsignedInt(channel) - 1]; + + if (isBrightnessGroupChannel(channelUID)) { + if (command instanceof PercentType percentCommand) { + colorChannel.setBrightness(percentCommand); + + VelbusSetDimPacket packet = new VelbusSetDimPacket(address, channel); + packet.setDim(colorChannel.getBrightnessVelbus()); + velbusBridgeHandler.sendPacket(packet.getBytes()); + } else { + throw new UnsupportedOperationException( + "The command '" + command + "' is not supported on channel '" + channelUID + "'."); + } + } else if (isColorGroupChannel(channelUID)) { + if (command instanceof HSBType hsbCommand) { + colorChannel.setBrightness(hsbCommand); + colorChannel.setColor(hsbCommand); + + VelbusSetColorPacket packet = new VelbusSetColorPacket(address, channel); + packet.setBrightness(colorChannel.getBrightnessVelbus()); + packet.setColor(colorChannel.getColorVelbus()); + velbusBridgeHandler.sendPacket(packet.getBytes()); + } else { + throw new UnsupportedOperationException( + "The command '" + command + "' is not supported on channel '" + channelUID + "'."); + } + } else if (isColorTemperatureGroupChannel(channelUID)) { + if (command instanceof PercentType percentCommand) { + colorChannel.setWhite(percentCommand); + + VelbusSetColorPacket packet = new VelbusSetColorPacket(address, channel); + packet.setWhite(colorChannel.getWhiteVelbus()); + velbusBridgeHandler.sendPacket(packet.getBytes()); + } else { + throw new UnsupportedOperationException( + "The command '" + command + "' is not supported on channel '" + channelUID + "'."); + } + } else if (isVirtualLightChannel(channelUID)) { + int virtualChannel = getModuleAddress().getChannelNumber(channelUID) - 1; + VelbusVirtualColorChannel virtualColorChannel = virtualColorChannels[virtualChannel]; + + if (command instanceof HSBType hsbCommand && virtualColorChannel.isRGBConfigured()) { + virtualColorChannel.setBrightness(hsbCommand); + virtualColorChannel.setColor(hsbCommand); + + VelbusSetDimPacket packet = new VelbusSetDimPacket(address, virtualColorChannel.getRedChannel()); + packet.setDim(virtualColorChannel.getRedColorVelbus()); + velbusBridgeHandler.sendPacket(packet.getBytes()); + + packet = new VelbusSetDimPacket(address, virtualColorChannel.getGreenChannel()); + packet.setDim(virtualColorChannel.getGreenColorVelbus()); + velbusBridgeHandler.sendPacket(packet.getBytes()); + + packet = new VelbusSetDimPacket(address, virtualColorChannel.getBlueChannel()); + packet.setDim(virtualColorChannel.getBlueColorVelbus()); + velbusBridgeHandler.sendPacket(packet.getBytes()); + } else { + throw new UnsupportedOperationException( + "The command '" + command + "' is not supported on channel '" + channelUID + "'."); + } + } + } + } + + private boolean isColorGroupChannel(ChannelUID channelUID) { + return CHANNEL_GROUP_COLOR.equals(channelUID.getGroupId()); + } + + private boolean isBrightnessGroupChannel(ChannelUID channelUID) { + return CHANNEL_GROUP_BRIGHTNESS.equals(channelUID.getGroupId()); + } + + private boolean isColorTemperatureGroupChannel(ChannelUID channelUID) { + return CHANNEL_GROUP_COLOR_TEMPERATURE.equals(channelUID.getGroupId()); + } + + private boolean isSceneGroupChannel(ChannelUID channelUID) { + return CHANNEL_GROUP_SCENE.equals(channelUID.getGroupId()); + } + + private boolean isVirtualLightChannel(ChannelUID channelUID) { + return CHANNEL_GROUP_VIRTUAL_LIGHT.equals(channelUID.getGroupId()); + } + + @Override + public void onPacketReceived(byte[] packet) { + super.onPacketReceived(packet); + + if (disposed) { + return; + } + + if (packet[0] == VelbusPacket.STX && packet.length >= 7) { + byte command = packet[4]; + byte setting = packet[6]; + + if (command == COMMAND_TEMP_SENSOR_SETTINGS_PART1 && setting == DALI_SETTING_ACTUAL_LEVEL) { + int channel = Byte.toUnsignedInt(packet[5]); + + if (channel >= 1 && channel <= 80) { + VelbusColorChannel colorChannel = colorChannels[channel - 1]; + + if (packet.length >= 8 && packet.length < 12) { + ChannelUID brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, + CHANNEL + channel); + colorChannel.setBrightness(packet[7]); + updateState(brightness, colorChannel.getBrightnessPercent()); + + for (int i = 0; i < 16; i++) { + if (virtualColorChannels[i].isVirtualColorChannel(channel)) { + virtualColorChannels[i].setColor(packet[7], channel); + + ChannelUID virtualLight = new ChannelUID(thing.getUID(), CHANNEL_GROUP_VIRTUAL_LIGHT, + VIRTUAL_LIGHT + (i + 1)); + updateState(virtualLight, virtualColorChannels[i].getColorHSB()); + } + } + } else if (packet.length >= 12) { + ChannelUID brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, + CHANNEL + channel); + colorChannel.setBrightness(packet[7]); + updateState(brightness, colorChannel.getBrightnessPercent()); + + ChannelUID color = new ChannelUID(thing.getUID(), CHANNEL_GROUP_COLOR, CHANNEL + channel); + colorChannel.setColor(new byte[] { packet[8], packet[9], packet[10] }); + updateState(color, colorChannel.getColorHSB()); + + ChannelUID temperature = new ChannelUID(thing.getUID(), CHANNEL_GROUP_COLOR_TEMPERATURE, + CHANNEL + channel); + colorChannel.setWhite(packet[11]); + updateState(temperature, colorChannel.getWhitePercent()); + } + } else if (channel == 81) { // Broadcast + if (packet.length >= 8 && packet.length < 12) { + VelbusColorChannel colorChannel; + ChannelUID brightness; + + for (int i = 1; i <= 80; i++) { + colorChannel = colorChannels[i - 1]; + brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, CHANNEL + i); + colorChannel.setBrightness(packet[7]); + updateState(brightness, colorChannel.getBrightnessPercent()); + + for (int j = 0; j < 16; j++) { + if (virtualColorChannels[j].isVirtualColorChannel(i)) { + virtualColorChannels[j].setColor(packet[6], i); + + ChannelUID virtualLight = new ChannelUID(thing.getUID(), + CHANNEL_GROUP_VIRTUAL_LIGHT, VIRTUAL_LIGHT + (j + 1)); + updateState(virtualLight, virtualColorChannels[j].getColorHSB()); + } + } + } + } else if (packet.length >= 12) { + VelbusColorChannel colorChannel; + ChannelUID brightness; + ChannelUID color; + ChannelUID temperature; + byte[] rgb = new byte[] { packet[8], packet[9], packet[10] }; + + for (int i = 1; i <= 80; i++) { + colorChannel = colorChannels[i - 1]; + + brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, CHANNEL + i); + colorChannel.setBrightness(packet[7]); + updateState(brightness, colorChannel.getBrightnessPercent()); + + color = new ChannelUID(thing.getUID(), CHANNEL_GROUP_COLOR, CHANNEL + i); + colorChannel.setColor(rgb); + updateState(color, colorChannel.getColorHSB()); + + temperature = new ChannelUID(thing.getUID(), CHANNEL_GROUP_COLOR_TEMPERATURE, CHANNEL + i); + colorChannel.setWhite(packet[11]); + updateState(temperature, colorChannel.getWhitePercent()); + } + } + } + } else if (command == COMMAND_DIMVALUE_STATUS && packet.length >= 8) { + int channel = Byte.toUnsignedInt(packet[5]); + + if (channel >= 1 && channel <= 80) { + VelbusColorChannel colorChannel = colorChannels[channel - 1]; + + ChannelUID brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, CHANNEL + channel); + colorChannel.setBrightness(packet[6]); + updateState(brightness, colorChannel.getBrightnessPercent()); + } else if (channel == 81) { // Broadcast + VelbusColorChannel colorChannel; + ChannelUID brightness; + + for (int i = 1; i <= 80; i++) { + colorChannel = colorChannels[i - 1]; + brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, CHANNEL + i); + colorChannel.setBrightness(packet[6]); + updateState(brightness, colorChannel.getBrightnessPercent()); + + for (int j = 0; j < 16; j++) { + if (virtualColorChannels[j].isVirtualColorChannel(i)) { + virtualColorChannels[j].setColor(packet[6], i); + + ChannelUID virtualLight = new ChannelUID(thing.getUID(), CHANNEL_GROUP_VIRTUAL_LIGHT, + VIRTUAL_LIGHT + (j + 1)); + updateState(virtualLight, virtualColorChannels[j].getColorHSB()); + } + } + } + } + } + } + } +} diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java index 0bb72cb483d0f..1b4ad489a63db 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java @@ -19,23 +19,100 @@ import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.velbus.internal.packets.VelbusPacket; +import org.openhab.binding.velbus.internal.packets.VelbusRelayPacket; +import org.openhab.binding.velbus.internal.packets.VelbusStatusRequestPacket; +import org.openhab.core.library.types.OnOffType; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; +import org.openhab.core.thing.ThingStatus; +import org.openhab.core.thing.ThingStatusDetail; import org.openhab.core.thing.ThingTypeUID; +import org.openhab.core.types.Command; +import org.openhab.core.types.RefreshType; /** * The {@link VelbusVMBELHandler} is responsible for handling commands, which are * sent to one of the channels. * * @author Cedric Boon - Initial contribution - * @author Daniel Rosengarten - Add VMBELPIR support + * @author Daniel Rosengarten - Add VMBELPIR support, add output support */ @NonNullByDefault public class VelbusVMBELHandler extends VelbusThermostatHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(THING_TYPE_VMBEL1, THING_TYPE_VMBEL2, THING_TYPE_VMBEL4, THING_TYPE_VMBELPIR)); + private volatile boolean disposed = true; + + private final ChannelUID outputChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_OUTPUT, CHANNEL_OUTPUT); + public VelbusVMBELHandler(Thing thing) { - super(thing, 4, new ChannelUID(thing.getUID(), "input", "CH9")); + super(thing, 4, new ChannelUID(thing.getUID(), CHANNEL_GROUP_INPUT, "CH9")); + } + + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + super.handleCommand(channelUID, command); + + VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); + if (velbusBridgeHandler == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + return; + } + + if (command instanceof RefreshType) { + VelbusStatusRequestPacket packet = new VelbusStatusRequestPacket(getModuleAddress().getAddress()); + + byte[] packetBytes = packet.getBytes(); + velbusBridgeHandler.sendPacket(packetBytes); + } else if (command instanceof OnOffType) { + byte commandByte = determineCommandByte((OnOffType) command); + + VelbusRelayPacket packet = new VelbusRelayPacket(getModuleAddress(), commandByte); + + byte[] packetBytes = packet.getBytes(); + velbusBridgeHandler.sendPacket(packetBytes); + } else { + logger.debug("The command '{}' is not supported by this handler.", command.getClass()); + } + } + + private byte determineCommandByte(OnOffType command) { + return (command == OnOffType.ON) ? COMMAND_SWITCH_RELAY_ON : COMMAND_SWITCH_RELAY_OFF; + } + + @Override + public void onPacketReceived(byte[] packet) { + super.onPacketReceived(packet); + + if (disposed) { + return; + } + + if (packet[0] == VelbusPacket.STX && packet.length >= 5) { + byte command = packet[4]; + + if (command == COMMAND_MODULE_STATUS && packet.length >= 7) { + boolean on = (packet[7] & (byte) 0x80) == (byte) 0x80; + + OnOffType state = on ? OnOffType.ON : OnOffType.OFF; + updateState(outputChannel, state); + } + } } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java index d95cd5976a241..b51c881216b48 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java @@ -12,27 +12,106 @@ */ package org.openhab.binding.velbus.internal.handler; -import static org.openhab.binding.velbus.internal.VelbusBindingConstants.THING_TYPE_VMBELO; +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.velbus.internal.packets.VelbusPacket; +import org.openhab.binding.velbus.internal.packets.VelbusRelayPacket; +import org.openhab.binding.velbus.internal.packets.VelbusStatusRequestPacket; +import org.openhab.core.library.types.OnOffType; +import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; +import org.openhab.core.thing.ThingStatus; +import org.openhab.core.thing.ThingStatusDetail; import org.openhab.core.thing.ThingTypeUID; +import org.openhab.core.types.Command; +import org.openhab.core.types.RefreshType; /** * The {@link VelbusVMBELOHandler} is responsible for handling commands, which are * sent to one of the channels. * * @author Cedric Boon - Initial contribution + * @author Daniel Rosengarten - Add output support */ @NonNullByDefault public class VelbusVMBELOHandler extends VelbusMemoHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBELO)); + private volatile boolean disposed = true; + + private final ChannelUID outputChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_OUTPUT, CHANNEL_OUTPUT); + public VelbusVMBELOHandler(Thing thing) { super(thing); } + + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + super.handleCommand(channelUID, command); + + VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); + if (velbusBridgeHandler == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + return; + } + + if (command instanceof RefreshType) { + VelbusStatusRequestPacket packet = new VelbusStatusRequestPacket(getModuleAddress().getAddress()); + + byte[] packetBytes = packet.getBytes(); + velbusBridgeHandler.sendPacket(packetBytes); + } else if (command instanceof OnOffType) { + byte commandByte = determineCommandByte((OnOffType) command); + + VelbusRelayPacket packet = new VelbusRelayPacket(getModuleAddress(), commandByte); + + byte[] packetBytes = packet.getBytes(); + velbusBridgeHandler.sendPacket(packetBytes); + } else { + logger.debug("The command '{}' is not supported by this handler.", command.getClass()); + } + } + + private byte determineCommandByte(OnOffType command) { + return (command == OnOffType.ON) ? COMMAND_SWITCH_RELAY_ON : COMMAND_SWITCH_RELAY_OFF; + } + + @Override + public void onPacketReceived(byte[] packet) { + super.onPacketReceived(packet); + + if (disposed) { + return; + } + + if (packet[0] == VelbusPacket.STX && packet.length >= 5) { + byte command = packet[4]; + + if (command == COMMAND_MODULE_STATUS && packet.length >= 7) { + boolean on = (packet[7] & (byte) 0x80) == (byte) 0x80; + + OnOffType state = on ? OnOffType.ON : OnOffType.OFF; + updateState(outputChannel, state); + } + } + } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java index 46942aca0cfbe..cabda4902db4a 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java @@ -40,6 +40,8 @@ public class VelbusVMBGPOHandler extends VelbusMemoHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(THING_TYPE_VMBGPO, THING_TYPE_VMBGPOD, THING_TYPE_VMBGPOD_2)); + private volatile boolean disposed = true; + public static final int MODULESETTINGS_MEMORY_ADDRESS = 0x02F0; public static final int LAST_MEMORY_LOCATION_ADDRESS = 0x1A03; @@ -51,6 +53,20 @@ public VelbusVMBGPOHandler(Thing thing) { super(thing); } + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -77,6 +93,10 @@ public void handleCommand(ChannelUID channelUID, Command command) { public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBMeteoHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBMeteoHandler.java index 8305cd977d06c..857e851de1491 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBMeteoHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBMeteoHandler.java @@ -45,6 +45,8 @@ public class VelbusVMBMeteoHandler extends VelbusTemperatureSensorHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBMETEO)); + private volatile boolean disposed = true; + private static final byte RAIN_SENSOR_CHANNEL = 0x02; private static final byte LIGHT_SENSOR_CHANNEL = 0x04; private static final byte WIND_SENSOR_CHANNEL = 0x08; @@ -62,6 +64,20 @@ public VelbusVMBMeteoHandler(Thing thing) { this.windspeedChannel = new ChannelUID(thing.getUID(), "weatherStation", "CH13"); } + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -107,6 +123,10 @@ protected int getClockAlarmAndProgramSelectionIndexInModuleStatus() { public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java index 9e8c4633d2b82..e126f843f6014 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java @@ -43,6 +43,8 @@ public class VelbusVMBPIROHandler extends VelbusTemperatureSensorHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBPIRO)); + private volatile boolean disposed = true; + private ChannelUID illuminanceChannel; public VelbusVMBPIROHandler(Thing thing) { @@ -51,6 +53,20 @@ public VelbusVMBPIROHandler(Thing thing) { this.illuminanceChannel = new ChannelUID(thing.getUID(), "input", "LIGHT"); } + @Override + public void initialize() { + super.initialize(); + + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -76,6 +92,10 @@ public void handleCommand(ChannelUID channelUID, Command command) { public void onPacketReceived(byte[] packet) { super.onPacketReceived(packet); + if (disposed) { + return; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDaliRequestPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDaliRequestPacket.java new file mode 100644 index 0000000000000..2e976b258af08 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDaliRequestPacket.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2010-2023 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.velbus.internal.packets; + +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.velbus.internal.VelbusChannelIdentifier; + +/** + * The {@link VelbusDaliRequestPacket} represents a Velbus packet that can be used to + * request the values of the DALI channel(s) of the given Velbus module. + * + * @author Daniel Rosengarten - Initial contribution + */ +@NonNullByDefault +public class VelbusDaliRequestPacket extends VelbusPacket { + private final byte GATEWAY_CONFIG = (byte) 0x01; + + private byte channel = ALL_DALI_CHANNELS; + + public VelbusDaliRequestPacket(byte address, byte channel) { + super(address, PRIO_LOW); + + this.channel = (channel == ALL_CHANNELS) ? ALL_DALI_CHANNELS : channel; + } + + public VelbusDaliRequestPacket(VelbusChannelIdentifier velbusChannelIdentifier) { + super(velbusChannelIdentifier.getAddress(), PRIO_LOW); + + this.channel = velbusChannelIdentifier.getChannelByte(); + } + + @Override + protected byte[] getDataBytes() { + if (this.channel == ALL_DALI_CHANNELS) { + return new byte[] { COMMAND_TEMP_SENSOR_SETTINGS_REQUEST, this.channel, GATEWAY_CONFIG }; + } else { + return new byte[] { COMMAND_TEMP_SENSOR_SETTINGS_REQUEST, this.channel, GATEWAY_CONFIG, + DALI_SETTING_ACTUAL_LEVEL }; + } + } +} diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusRelayPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusRelayPacket.java index c0885b8e4b90f..60b8c778abea1 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusRelayPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusRelayPacket.java @@ -12,8 +12,11 @@ */ package org.openhab.binding.velbus.internal.packets; +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.velbus.internal.VelbusChannelIdentifier; +import org.openhab.binding.velbus.internal.VelbusModuleAddress; /** * The {@link VelbusRelayPacket} represents a Velbus packet that can be used to @@ -33,6 +36,13 @@ public VelbusRelayPacket(VelbusChannelIdentifier velbusChannelIdentifier, byte c this.command = command; } + public VelbusRelayPacket(VelbusModuleAddress velbusModuleAddress, byte command) { + super(velbusModuleAddress.getAddress(), PRIO_HI); + + this.channel = ALL_CHANNELS; + this.command = command; + } + @Override protected byte[] getDataBytes() { return new byte[] { command, channel }; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetColorPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetColorPacket.java new file mode 100644 index 0000000000000..a87c3e0d31647 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetColorPacket.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2010-2023 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.velbus.internal.packets; + +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link VelbusSetColorPacket} represents a Velbus packet that can be used to + * set the color of a channel on the DALI module. + * + * @author Daniel Rosengarten - Initial contribution + */ +@NonNullByDefault +public class VelbusSetColorPacket extends VelbusPacket { + private byte[] data; + + public VelbusSetColorPacket(byte address, byte channel) { + super(address, PRIO_HI, false); + + this.data = new byte[] { COMMAND_SET_COLOR, channel, VALUE_UNCHANGED, VALUE_UNCHANGED, VALUE_UNCHANGED, + VALUE_UNCHANGED, VALUE_UNCHANGED }; + } + + public void setBrightness(byte brightness) { + data[2] = brightness; + } + + public void setColor(byte r, byte g, byte b) { + data[3] = r; + data[4] = g; + data[5] = b; + } + + public void setColor(byte rgb[]) { + data[3] = rgb[0]; + data[4] = rgb[1]; + data[5] = rgb[2]; + } + + public void setWhite(byte white) { + data[6] = white; + } + + @Override + protected byte[] getDataBytes() { + return data; + } +} diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetDimPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetDimPacket.java new file mode 100644 index 0000000000000..5ff1b9ff62129 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetDimPacket.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2010-2023 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.velbus.internal.packets; + +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link VelbusSetDimPacket} represents a Velbus packet that can be used to + * set the color of a channel on the DALI module. + * + * @author Daniel Rosengarten - Initial contribution + */ +@NonNullByDefault +public class VelbusSetDimPacket extends VelbusPacket { + private byte[] data; + + public VelbusSetDimPacket(byte address, byte channel) { + super(address, PRIO_HI, false); + + this.data = new byte[] { COMMAND_SET_DIMVALUE, channel, VALUE_UNCHANGED, VALUE_UNCHANGED, VALUE_UNCHANGED }; + } + + public void setDim(byte dim) { + data[2] = dim; + } + + @Override + protected byte[] getDataBytes() { + return data; + } +} diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetScenePacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetScenePacket.java new file mode 100644 index 0000000000000..13e2c851bbefb --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetScenePacket.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2010-2023 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.velbus.internal.packets; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.velbus.internal.VelbusBindingConstants; + +/** + * The {@link VelbusSetScenePacket} represents a Velbus packet that can be used to + * set the scene of a channel on the DALI module. + * + * @author Daniel Rosengarten - Initial contribution + */ +@NonNullByDefault +public class VelbusSetScenePacket extends VelbusPacket { + private byte[] data; + + public VelbusSetScenePacket(byte address, byte channel, byte sceneNumber) { + super(address, PRIO_HI, false); + + this.data = new byte[] { VelbusBindingConstants.COMMAND_SET_DIMSCENE, channel, sceneNumber }; + } + + public void GoToScene(byte sceneNumber) { + data[2] = sceneNumber; + } + + @Override + protected byte[] getDataBytes() { + return data; + } +} diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml index 24eab60c4db61..2e5f187108643 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml @@ -530,6 +530,11 @@ The velbus address of the device + + + The velbus sub-address of the device (FF = disabled) + FF + Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no @@ -690,6 +695,26 @@ The velbus address of the device + + + The velbus sub-address 1 of the device (FF = disabled) + FF + + + + The velbus sub-address 2 of the device (FF = disabled) + FF + + + + The velbus sub-address 3 of the device (FF = disabled) + FF + + + + The velbus sub-address 4 of the device (FF = disabled) + FF + Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no @@ -896,4 +921,662 @@ true + + + + + The velbus address of the device + + + + The velbus sub-address 1 of the device (FF = disabled) + FF + + + + The velbus sub-address 2 of the device (FF = disabled) + FF + + + + The velbus sub-address 3 of the device (FF = disabled) + FF + + + + The velbus sub-address 4 of the device (FF = disabled) + FF + + + + The velbus sub-address 5 of the device (FF = disabled) + FF + + + + The velbus sub-address 6 of the device (FF = disabled) + FF + + + + The velbus sub-address 7 of the device (FF = disabled) + FF + + + + The velbus sub-address 8 of the device (FF = disabled) + FF + + + + The velbus sub-address 9 of the device (FF = disabled) + FF + + + + Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no + refresh will be scheduled. + 300 + true + + + + The name of CH1. + A0 + true + + + + The name of CH2. + A1 + true + + + + The name of CH3. + A2 + true + + + + The name of CH4. + CH4 + true + + + + The name of CH5. + A4 + true + + + + The name of CH6. + A5 + true + + + + The name of CH7. + A6 + true + + + + The name of CH8. + A7 + true + + + + The name of CH9. + A8 + true + + + + The name of CH10. + A9 + true + + + + The name of CH11. + A10 + true + + + + The name of CH12. + A11 + true + + + + The name of CH13. + A12 + true + + + + The name of CH14. + A13 + true + + + + The name of CH15. + A14 + true + + + + The name of CH16. + A15 + true + + + + The name of CH17. + A16 + true + + + + The name of CH18. + A17 + true + + + + The name of CH19. + A18 + true + + + + The name of CH20. + A19 + true + + + + The name of CH21. + A20 + true + + + + The name of CH22. + A21 + true + + + + The name of CH23. + A22 + true + + + + The name of CH24. + A23 + true + + + + The name of CH25. + A24 + true + + + + The name of CH26. + A25 + true + + + + The name of CH27. + A26 + true + + + + The name of CH28. + A27 + true + + + + The name of CH29. + A28 + true + + + + The name of CH30. + A29 + true + + + + The name of CH31. + A30 + true + + + + The name of CH32. + A31 + true + + + + The name of CH33. + A32 + true + + + + The name of CH34. + A33 + true + + + + The name of CH35. + A34 + true + + + + The name of CH36. + A35 + true + + + + The name of CH37. + A36 + true + + + + The name of CH38. + A37 + true + + + + The name of CH39. + A38 + true + + + + The name of CH40. + A39 + true + + + + The name of CH41. + A40 + true + + + + The name of CH42. + A41 + true + + + + The name of CH43. + A42 + true + + + + The name of CH44. + A43 + true + + + + The name of CH45. + A44 + true + + + + The name of CH46. + A45 + true + + + + The name of CH47. + A46 + true + + + + The name of CH48. + A47 + true + + + + The name of CH49. + A48 + true + + + + The name of CH50. + A39 + true + + + + The name of CH51. + A50 + true + + + + The name of CH52. + A51 + true + + + + The name of CH53. + A52 + true + + + + The name of CH54. + A53 + true + + + + The name of CH55. + A54 + true + + + + The name of CH56. + A55 + true + + + + The name of CH57. + A56 + true + + + + The name of CH58. + A57 + true + + + + The name of CH59. + A58 + true + + + + The name of CH60. + A59 + true + + + + The name of CH61. + A60 + true + + + + The name of CH62. + A61 + true + + + + The name of CH63. + A62 + true + + + + The name of CH64. + A63 + true + + + + The name of CH65. + G0 + true + + + + The name of CH66. + G1 + true + + + + The name of CH67. + G2 + true + + + + The name of CH68. + G3 + true + + + + The name of CH69. + G4 + true + + + + The name of CH70. + G5 + true + + + + The name of CH71. + G6 + true + + + + The name of CH72. + G7 + true + + + + The name of CH73. + G8 + true + + + + The name of CH74. + G9 + true + + + + The name of CH75. + G10 + true + + + + The name of CH76. + G11 + true + + + + The name of CH77. + G12 + true + + + + The name of CH78. + G13 + true + + + + The name of CH79. + G14 + true + + + + The name of CH80. + G15 + true + + + + The name of CH81. + Broadcast + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH1,CH2,CH3) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH5,CH6,CH7) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH9,CH10,CH11) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH13,CH14,CH15) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH17,CH18,CH19) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH21,CH22,CH23) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH25,CH26,CH27) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH29,CH30,CH31) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH33,CH34,CH35) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH37,CH38,CH39) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH41,CH42,CH43) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH45,CH46,CH47) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH49,CH50,CH510) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH53,CH54,CH55) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH57,CH58,CH59) + true + + + + Create a virtual color light from 3 channels. Format: + Red_channel,Green_channel,Blue_channel. From CH1 to + CH64. (e.g. CH61,CH62,CH63) + true + + + diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties index 5fb7cab2e160e..d1eae6db7f50c 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties @@ -57,6 +57,8 @@ thing-type.velbus.vmb8pb.label = VMB8PB thing-type.velbus.vmb8pb.description = 8-Channel Push Button module thing-type.velbus.vmb8pbu.label = VMB8PBU thing-type.velbus.vmb8pbu.description = Push-button interface with 8 channels for universal mounting +thing-type.velbus.vmbdali.label = VMBDALI +thing-type.velbus.vmbdali.description = DALI gateway module thing-type.velbus.vmbdme.label = VMBDME thing-type.velbus.vmbdme.description = Dimmer for electronic/resistive load thing-type.velbus.vmbdmi.label = VMBDMI @@ -244,6 +246,14 @@ thing-type.config.velbus.33channelDeviceWithTemperatureSensor.address.label = Ad thing-type.config.velbus.33channelDeviceWithTemperatureSensor.address.description = The velbus address of the device thing-type.config.velbus.33channelDeviceWithTemperatureSensor.refresh.label = Refresh Interval thing-type.config.velbus.33channelDeviceWithTemperatureSensor.refresh.description = Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress1.label = Page 3-4 Address +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress1.description = The velbus sub-address 1 of the device (FF = disabled) +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress2.label = Page 5-6 Address +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress2.description = The velbus sub-address 2 of the device (FF = disabled) +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress3.label = Page 7-8 Address +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress3.description = The velbus sub-address 3 of the device (FF = disabled) +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress4.label = Sensor Address +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress4.description = The velbus sub-address 4 of the device (FF = disabled) thing-type.config.velbus.4channelDevice.CH1.label = CH1 Name thing-type.config.velbus.4channelDevice.CH1.description = The name of CH1. thing-type.config.velbus.4channelDevice.CH2.label = CH2 Name @@ -372,6 +382,222 @@ thing-type.config.velbus.7channelDeviceWithTemperatureSensor.address.label = Add thing-type.config.velbus.7channelDeviceWithTemperatureSensor.address.description = The velbus address of the device thing-type.config.velbus.7channelDeviceWithTemperatureSensor.refresh.label = Refresh Interval thing-type.config.velbus.7channelDeviceWithTemperatureSensor.refresh.description = Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. +thing-type.config.velbus.81channelDevice.CH1.label = CH1 Name +thing-type.config.velbus.81channelDevice.CH1.description = The name of CH1. +thing-type.config.velbus.81channelDevice.CH10.label = CH10 Name +thing-type.config.velbus.81channelDevice.CH10.description = The name of CH10. +thing-type.config.velbus.81channelDevice.CH11.label = CH11 Name +thing-type.config.velbus.81channelDevice.CH11.description = The name of CH11. +thing-type.config.velbus.81channelDevice.CH12.label = CH12 Name +thing-type.config.velbus.81channelDevice.CH12.description = The name of CH12. +thing-type.config.velbus.81channelDevice.CH13.label = CH13 Name +thing-type.config.velbus.81channelDevice.CH13.description = The name of CH13. +thing-type.config.velbus.81channelDevice.CH14.label = CH14 Name +thing-type.config.velbus.81channelDevice.CH14.description = The name of CH14. +thing-type.config.velbus.81channelDevice.CH15.label = CH15 Name +thing-type.config.velbus.81channelDevice.CH15.description = The name of CH15. +thing-type.config.velbus.81channelDevice.CH16.label = CH16 Name +thing-type.config.velbus.81channelDevice.CH16.description = The name of CH16. +thing-type.config.velbus.81channelDevice.CH17.label = CH17 Name +thing-type.config.velbus.81channelDevice.CH17.description = The name of CH17. +thing-type.config.velbus.81channelDevice.CH18.label = CH18 Name +thing-type.config.velbus.81channelDevice.CH18.description = The name of CH18. +thing-type.config.velbus.81channelDevice.CH19.label = CH19 Name +thing-type.config.velbus.81channelDevice.CH19.description = The name of CH19. +thing-type.config.velbus.81channelDevice.CH2.label = CH2 Name +thing-type.config.velbus.81channelDevice.CH2.description = The name of CH2. +thing-type.config.velbus.81channelDevice.CH20.label = CH20 Name +thing-type.config.velbus.81channelDevice.CH20.description = The name of CH20. +thing-type.config.velbus.81channelDevice.CH21.label = CH21 Name +thing-type.config.velbus.81channelDevice.CH21.description = The name of CH21. +thing-type.config.velbus.81channelDevice.CH22.label = CH22 Name +thing-type.config.velbus.81channelDevice.CH22.description = The name of CH22. +thing-type.config.velbus.81channelDevice.CH23.label = CH23 Name +thing-type.config.velbus.81channelDevice.CH23.description = The name of CH23. +thing-type.config.velbus.81channelDevice.CH24.label = CH24 Name +thing-type.config.velbus.81channelDevice.CH24.description = The name of CH24. +thing-type.config.velbus.81channelDevice.CH25.label = CH25 Name +thing-type.config.velbus.81channelDevice.CH25.description = The name of CH25. +thing-type.config.velbus.81channelDevice.CH26.label = CH26 Name +thing-type.config.velbus.81channelDevice.CH26.description = The name of CH26. +thing-type.config.velbus.81channelDevice.CH27.label = CH27 Name +thing-type.config.velbus.81channelDevice.CH27.description = The name of CH27. +thing-type.config.velbus.81channelDevice.CH28.label = CH28 Name +thing-type.config.velbus.81channelDevice.CH28.description = The name of CH28. +thing-type.config.velbus.81channelDevice.CH29.label = CH29 Name +thing-type.config.velbus.81channelDevice.CH29.description = The name of CH29. +thing-type.config.velbus.81channelDevice.CH3.label = CH3 Name +thing-type.config.velbus.81channelDevice.CH3.description = The name of CH3. +thing-type.config.velbus.81channelDevice.CH30.label = CH30 Name +thing-type.config.velbus.81channelDevice.CH30.description = The name of CH30. +thing-type.config.velbus.81channelDevice.CH31.label = CH31 Name +thing-type.config.velbus.81channelDevice.CH31.description = The name of CH31. +thing-type.config.velbus.81channelDevice.CH32.label = CH32 Name +thing-type.config.velbus.81channelDevice.CH32.description = The name of CH32. +thing-type.config.velbus.81channelDevice.CH33.label = CH33 Name +thing-type.config.velbus.81channelDevice.CH33.description = The name of CH33. +thing-type.config.velbus.81channelDevice.CH34.label = CH34 Name +thing-type.config.velbus.81channelDevice.CH34.description = The name of CH34. +thing-type.config.velbus.81channelDevice.CH35.label = CH35 Name +thing-type.config.velbus.81channelDevice.CH35.description = The name of CH35. +thing-type.config.velbus.81channelDevice.CH36.label = CH36 Name +thing-type.config.velbus.81channelDevice.CH36.description = The name of CH36. +thing-type.config.velbus.81channelDevice.CH37.label = CH37 Name +thing-type.config.velbus.81channelDevice.CH37.description = The name of CH37. +thing-type.config.velbus.81channelDevice.CH38.label = CH38 Name +thing-type.config.velbus.81channelDevice.CH38.description = The name of CH38. +thing-type.config.velbus.81channelDevice.CH39.label = CH39 Name +thing-type.config.velbus.81channelDevice.CH39.description = The name of CH39. +thing-type.config.velbus.81channelDevice.CH4.label = A3 Name +thing-type.config.velbus.81channelDevice.CH4.description = The name of CH4. +thing-type.config.velbus.81channelDevice.CH40.label = CH40 Name +thing-type.config.velbus.81channelDevice.CH40.description = The name of CH40. +thing-type.config.velbus.81channelDevice.CH41.label = CH41 Name +thing-type.config.velbus.81channelDevice.CH41.description = The name of CH41. +thing-type.config.velbus.81channelDevice.CH42.label = CH42 Name +thing-type.config.velbus.81channelDevice.CH42.description = The name of CH42. +thing-type.config.velbus.81channelDevice.CH43.label = CH43 Name +thing-type.config.velbus.81channelDevice.CH43.description = The name of CH43. +thing-type.config.velbus.81channelDevice.CH44.label = CH44 Name +thing-type.config.velbus.81channelDevice.CH44.description = The name of CH44. +thing-type.config.velbus.81channelDevice.CH45.label = CH45 Name +thing-type.config.velbus.81channelDevice.CH45.description = The name of CH45. +thing-type.config.velbus.81channelDevice.CH46.label = CH46 Name +thing-type.config.velbus.81channelDevice.CH46.description = The name of CH46. +thing-type.config.velbus.81channelDevice.CH47.label = CH47 Name +thing-type.config.velbus.81channelDevice.CH47.description = The name of CH47. +thing-type.config.velbus.81channelDevice.CH48.label = CH48 Name +thing-type.config.velbus.81channelDevice.CH48.description = The name of CH48. +thing-type.config.velbus.81channelDevice.CH49.label = CH49 Name +thing-type.config.velbus.81channelDevice.CH49.description = The name of CH49. +thing-type.config.velbus.81channelDevice.CH5.label = CH5 Name +thing-type.config.velbus.81channelDevice.CH5.description = The name of CH5. +thing-type.config.velbus.81channelDevice.CH50.label = CH50 Name +thing-type.config.velbus.81channelDevice.CH50.description = The name of CH50. +thing-type.config.velbus.81channelDevice.CH51.label = CH51 Name +thing-type.config.velbus.81channelDevice.CH51.description = The name of CH51. +thing-type.config.velbus.81channelDevice.CH52.label = CH52 Name +thing-type.config.velbus.81channelDevice.CH52.description = The name of CH52. +thing-type.config.velbus.81channelDevice.CH53.label = CH53 Name +thing-type.config.velbus.81channelDevice.CH53.description = The name of CH53. +thing-type.config.velbus.81channelDevice.CH54.label = CH54 Name +thing-type.config.velbus.81channelDevice.CH54.description = The name of CH54. +thing-type.config.velbus.81channelDevice.CH55.label = CH55 Name +thing-type.config.velbus.81channelDevice.CH55.description = The name of CH55. +thing-type.config.velbus.81channelDevice.CH56.label = CH56 Name +thing-type.config.velbus.81channelDevice.CH56.description = The name of CH56. +thing-type.config.velbus.81channelDevice.CH57.label = CH57 Name +thing-type.config.velbus.81channelDevice.CH57.description = The name of CH57. +thing-type.config.velbus.81channelDevice.CH58.label = CH58 Name +thing-type.config.velbus.81channelDevice.CH58.description = The name of CH58. +thing-type.config.velbus.81channelDevice.CH59.label = CH59 Name +thing-type.config.velbus.81channelDevice.CH59.description = The name of CH59. +thing-type.config.velbus.81channelDevice.CH6.label = CH6 Name +thing-type.config.velbus.81channelDevice.CH6.description = The name of CH6. +thing-type.config.velbus.81channelDevice.CH60.label = CH60 Name +thing-type.config.velbus.81channelDevice.CH60.description = The name of CH60. +thing-type.config.velbus.81channelDevice.CH61.label = CH61 Name +thing-type.config.velbus.81channelDevice.CH61.description = The name of CH61. +thing-type.config.velbus.81channelDevice.CH62.label = CH62 Name +thing-type.config.velbus.81channelDevice.CH62.description = The name of CH62. +thing-type.config.velbus.81channelDevice.CH63.label = CH63 Name +thing-type.config.velbus.81channelDevice.CH63.description = The name of CH63. +thing-type.config.velbus.81channelDevice.CH64.label = CH64 Name +thing-type.config.velbus.81channelDevice.CH64.description = The name of CH64. +thing-type.config.velbus.81channelDevice.CH65.label = CH65 Name +thing-type.config.velbus.81channelDevice.CH65.description = The name of CH65. +thing-type.config.velbus.81channelDevice.CH66.label = CH66 Name +thing-type.config.velbus.81channelDevice.CH66.description = The name of CH66. +thing-type.config.velbus.81channelDevice.CH67.label = CH67 Name +thing-type.config.velbus.81channelDevice.CH67.description = The name of CH67. +thing-type.config.velbus.81channelDevice.CH68.label = CH68 Name +thing-type.config.velbus.81channelDevice.CH68.description = The name of CH68. +thing-type.config.velbus.81channelDevice.CH69.label = CH69 Name +thing-type.config.velbus.81channelDevice.CH69.description = The name of CH69. +thing-type.config.velbus.81channelDevice.CH7.label = CH7 Name +thing-type.config.velbus.81channelDevice.CH7.description = The name of CH7. +thing-type.config.velbus.81channelDevice.CH70.label = CH70 Name +thing-type.config.velbus.81channelDevice.CH70.description = The name of CH70. +thing-type.config.velbus.81channelDevice.CH71.label = CH71 Name +thing-type.config.velbus.81channelDevice.CH71.description = The name of CH71. +thing-type.config.velbus.81channelDevice.CH72.label = CH72 Name +thing-type.config.velbus.81channelDevice.CH72.description = The name of CH72. +thing-type.config.velbus.81channelDevice.CH73.label = CH73 Name +thing-type.config.velbus.81channelDevice.CH73.description = The name of CH73. +thing-type.config.velbus.81channelDevice.CH74.label = CH74 Name +thing-type.config.velbus.81channelDevice.CH74.description = The name of CH74. +thing-type.config.velbus.81channelDevice.CH75.label = CH75 Name +thing-type.config.velbus.81channelDevice.CH75.description = The name of CH75. +thing-type.config.velbus.81channelDevice.CH76.label = CH76 Name +thing-type.config.velbus.81channelDevice.CH76.description = The name of CH76. +thing-type.config.velbus.81channelDevice.CH77.label = CH77 Name +thing-type.config.velbus.81channelDevice.CH77.description = The name of CH77. +thing-type.config.velbus.81channelDevice.CH78.label = CH78 Name +thing-type.config.velbus.81channelDevice.CH78.description = The name of CH78. +thing-type.config.velbus.81channelDevice.CH79.label = CH79 Name +thing-type.config.velbus.81channelDevice.CH79.description = The name of CH79. +thing-type.config.velbus.81channelDevice.CH8.label = CH8 Name +thing-type.config.velbus.81channelDevice.CH8.description = The name of CH8. +thing-type.config.velbus.81channelDevice.CH80.label = CH80 Name +thing-type.config.velbus.81channelDevice.CH80.description = The name of CH80. +thing-type.config.velbus.81channelDevice.CH81.label = CH81 Name +thing-type.config.velbus.81channelDevice.CH81.description = The name of CH81. +thing-type.config.velbus.81channelDevice.CH9.label = CH9 Name +thing-type.config.velbus.81channelDevice.CH9.description = The name of CH9. +thing-type.config.velbus.81channelDevice.VL1.label = Virtual Light 1 +thing-type.config.velbus.81channelDevice.VL1.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH1,CH2,CH3) +thing-type.config.velbus.81channelDevice.VL10.label = Virtual Light 10 +thing-type.config.velbus.81channelDevice.VL10.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH37,CH38,CH39) +thing-type.config.velbus.81channelDevice.VL11.label = Virtual Light 11 +thing-type.config.velbus.81channelDevice.VL11.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH41,CH42,CH43) +thing-type.config.velbus.81channelDevice.VL12.label = Virtual Light 12 +thing-type.config.velbus.81channelDevice.VL12.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH45,CH46,CH47) +thing-type.config.velbus.81channelDevice.VL13.label = Virtual Light 13 +thing-type.config.velbus.81channelDevice.VL13.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH49,CH50,CH510) +thing-type.config.velbus.81channelDevice.VL14.label = Virtual Light 14 +thing-type.config.velbus.81channelDevice.VL14.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH53,CH54,CH55) +thing-type.config.velbus.81channelDevice.VL15.label = Virtual Light 15 +thing-type.config.velbus.81channelDevice.VL15.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH57,CH58,CH59) +thing-type.config.velbus.81channelDevice.VL16.label = Virtual Light 16 +thing-type.config.velbus.81channelDevice.VL16.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH61,CH62,CH63) +thing-type.config.velbus.81channelDevice.VL2.label = Virtual Light 2 +thing-type.config.velbus.81channelDevice.VL2.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH5,CH6,CH7) +thing-type.config.velbus.81channelDevice.VL3.label = Virtual Light 3 +thing-type.config.velbus.81channelDevice.VL3.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH9,CH10,CH11) +thing-type.config.velbus.81channelDevice.VL4.label = Virtual Light 4 +thing-type.config.velbus.81channelDevice.VL4.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH13,CH14,CH15) +thing-type.config.velbus.81channelDevice.VL5.label = Virtual Light 5 +thing-type.config.velbus.81channelDevice.VL5.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH17,CH18,CH19) +thing-type.config.velbus.81channelDevice.VL6.label = Virtual Light 6 +thing-type.config.velbus.81channelDevice.VL6.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH21,CH22,CH23) +thing-type.config.velbus.81channelDevice.VL7.label = Virtual Light 7 +thing-type.config.velbus.81channelDevice.VL7.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH25,CH26,CH27) +thing-type.config.velbus.81channelDevice.VL8.label = Virtual Light 8 +thing-type.config.velbus.81channelDevice.VL8.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH29,CH30,CH31) +thing-type.config.velbus.81channelDevice.VL9.label = Virtual Light 9 +thing-type.config.velbus.81channelDevice.VL9.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH33,CH34,CH35) +thing-type.config.velbus.81channelDevice.address.label = Address (Channel A0...7) +thing-type.config.velbus.81channelDevice.address.description = The velbus address of the device +thing-type.config.velbus.81channelDevice.refresh.label = Refresh Interval +thing-type.config.velbus.81channelDevice.refresh.description = Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. +thing-type.config.velbus.81channelDevice.subaddress1.label = Channel A8...15 +thing-type.config.velbus.81channelDevice.subaddress1.description = The velbus sub-address 1 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress2.label = Channel A16...23 +thing-type.config.velbus.81channelDevice.subaddress2.description = The velbus sub-address 2 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress3.label = Channel A24...31 +thing-type.config.velbus.81channelDevice.subaddress3.description = The velbus sub-address 3 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress4.label = Channel A32...39 +thing-type.config.velbus.81channelDevice.subaddress4.description = The velbus sub-address 4 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress5.label = Channel A40...47 +thing-type.config.velbus.81channelDevice.subaddress5.description = The velbus sub-address 5 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress6.label = Channel A48...55 +thing-type.config.velbus.81channelDevice.subaddress6.description = The velbus sub-address 6 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress7.label = Channel A56...63 +thing-type.config.velbus.81channelDevice.subaddress7.description = The velbus sub-address 7 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress8.label = Group G0...7 +thing-type.config.velbus.81channelDevice.subaddress8.description = The velbus sub-address 8 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress9.label = Group G8...15 +thing-type.config.velbus.81channelDevice.subaddress9.description = The velbus sub-address 9 of the device (FF = disabled) thing-type.config.velbus.8channelDevice.CH1.label = CH1 Name thing-type.config.velbus.8channelDevice.CH1.description = The name of CH1. thing-type.config.velbus.8channelDevice.CH2.label = CH2 Name @@ -412,6 +638,8 @@ thing-type.config.velbus.9channelDeviceWithTemperatureSensor.address.label = Add thing-type.config.velbus.9channelDeviceWithTemperatureSensor.address.description = The velbus address of the device thing-type.config.velbus.9channelDeviceWithTemperatureSensor.refresh.label = Refresh Interval thing-type.config.velbus.9channelDeviceWithTemperatureSensor.refresh.description = Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. +thing-type.config.velbus.9channelDeviceWithTemperatureSensor.subaddress1.label = Sensor Address +thing-type.config.velbus.9channelDeviceWithTemperatureSensor.subaddress1.description = The velbus sub-address of the device (FF = disabled) thing-type.config.velbus.temperatureSensorDevice.address.label = Address thing-type.config.velbus.temperatureSensorDevice.address.description = The velbus address of the device thing-type.config.velbus.temperatureSensorDevice.refresh.label = Refresh Interval @@ -419,10 +647,14 @@ thing-type.config.velbus.temperatureSensorDevice.refresh.description = Refresh i # channel group types +channel-group-type.velbus.16channelVirtualLight.label = Virtual light +channel-group-type.velbus.16channelVirtualLight.description = This is a generic module with 16 virtual light channels. channel-group-type.velbus.1channelFeedbackModule.label = Feedback channel-group-type.velbus.1channelFeedbackModule.description = This is a generic module with 1 feedback channel. channel-group-type.velbus.1channelInputModuleWithTemperatureSensor.label = Input with Temperature Sensor channel-group-type.velbus.1channelInputModuleWithTemperatureSensor.description = This is a generic module with 8 input channels and a temperature sensor. +channel-group-type.velbus.1outputModule.label = Output +channel-group-type.velbus.1outputModule.description = This is a generic module with 1 output. channel-group-type.velbus.2channelButtonModule.label = Button channel-group-type.velbus.2channelButtonModule.description = This is a generic module with 2 button channels. channel-group-type.velbus.2channelFeedbackModule.label = Feedback @@ -451,6 +683,18 @@ channel-group-type.velbus.6channelInputModule.label = Input channel-group-type.velbus.6channelInputModule.description = This is a generic module with 6 input channels. channel-group-type.velbus.7channelInputModule.label = Input channel-group-type.velbus.7channelInputModule.description = This is a generic module with 7 input channels. +channel-group-type.velbus.81channelBrightnessModule.label = Brightness +channel-group-type.velbus.81channelBrightnessModule.description = This is a generic module with 81 brightness channels. +channel-group-type.velbus.81channelColorModule.label = Color +channel-group-type.velbus.81channelColorModule.description = This is a generic module with 81 color channels. +channel-group-type.velbus.81channelColorTemperatureModule.label = Color Temperature +channel-group-type.velbus.81channelColorTemperatureModule.description = This is a generic module with 81 color temperature channels. +channel-group-type.velbus.81channelFeedbackModule.label = Feedback +channel-group-type.velbus.81channelFeedbackModule.description = This is a generic module with 81 feedback channels. +channel-group-type.velbus.81channelInputModule.label = Input +channel-group-type.velbus.81channelInputModule.description = This is a generic module with 81 input channels. +channel-group-type.velbus.81channelSceneModule.label = Scene +channel-group-type.velbus.81channelSceneModule.description = This is a generic module with 81 scene channels. channel-group-type.velbus.8channelButtonModule.label = Button channel-group-type.velbus.8channelButtonModule.description = This is a generic module with 8 button channels. channel-group-type.velbus.8channelFeedbackModule.label = Feedback @@ -546,6 +790,8 @@ channel-type.velbus.ledFeedback.state.option.SET_LED = On channel-type.velbus.ledFeedback.state.option.SLOW_BLINK_LED = Slow blink channel-type.velbus.ledFeedback.state.option.FAST_BLINK_LED = Fast blink channel-type.velbus.ledFeedback.state.option.VERY_FAST_BLINK_LED = Very fast blink +channel-type.velbus.light-scene.label = Scene +channel-type.velbus.light-scene.description = Scene options for DALI network channel-type.velbus.minute.label = Minute channel-type.velbus.percentage.label = Percentage channel-type.velbus.percentage.description = Current percentage @@ -567,3 +813,208 @@ channel-type.velbus.voltage.label = Voltage channel-type.velbus.voltage.description = Currently measured voltage channel-type.velbus.windspeed.label = Wind Speed channel-type.velbus.windspeed.description = Currently measured wind speed + +# thing types config + +thing-type.config.velbus.80channelDevice.CH1.label = CH1 Name +thing-type.config.velbus.80channelDevice.CH1.description = The name of CH1. +thing-type.config.velbus.80channelDevice.CH10.label = CH10 Name +thing-type.config.velbus.80channelDevice.CH10.description = The name of CH10. +thing-type.config.velbus.80channelDevice.CH11.label = CH11 Name +thing-type.config.velbus.80channelDevice.CH11.description = The name of CH11. +thing-type.config.velbus.80channelDevice.CH12.label = CH12 Name +thing-type.config.velbus.80channelDevice.CH12.description = The name of CH12. +thing-type.config.velbus.80channelDevice.CH13.label = CH13 Name +thing-type.config.velbus.80channelDevice.CH13.description = The name of CH13. +thing-type.config.velbus.80channelDevice.CH14.label = CH14 Name +thing-type.config.velbus.80channelDevice.CH14.description = The name of CH14. +thing-type.config.velbus.80channelDevice.CH15.label = CH15 Name +thing-type.config.velbus.80channelDevice.CH15.description = The name of CH15. +thing-type.config.velbus.80channelDevice.CH16.label = CH16 Name +thing-type.config.velbus.80channelDevice.CH16.description = The name of CH16. +thing-type.config.velbus.80channelDevice.CH17.label = CH17 Name +thing-type.config.velbus.80channelDevice.CH17.description = The name of CH17. +thing-type.config.velbus.80channelDevice.CH18.label = CH18 Name +thing-type.config.velbus.80channelDevice.CH18.description = The name of CH18. +thing-type.config.velbus.80channelDevice.CH19.label = CH19 Name +thing-type.config.velbus.80channelDevice.CH19.description = The name of CH19. +thing-type.config.velbus.80channelDevice.CH2.label = CH2 Name +thing-type.config.velbus.80channelDevice.CH2.description = The name of CH2. +thing-type.config.velbus.80channelDevice.CH20.label = CH20 Name +thing-type.config.velbus.80channelDevice.CH20.description = The name of CH20. +thing-type.config.velbus.80channelDevice.CH21.label = CH21 Name +thing-type.config.velbus.80channelDevice.CH21.description = The name of CH21. +thing-type.config.velbus.80channelDevice.CH22.label = CH22 Name +thing-type.config.velbus.80channelDevice.CH22.description = The name of CH22. +thing-type.config.velbus.80channelDevice.CH23.label = CH23 Name +thing-type.config.velbus.80channelDevice.CH23.description = The name of CH23. +thing-type.config.velbus.80channelDevice.CH24.label = CH24 Name +thing-type.config.velbus.80channelDevice.CH24.description = The name of CH24. +thing-type.config.velbus.80channelDevice.CH25.label = CH25 Name +thing-type.config.velbus.80channelDevice.CH25.description = The name of CH25. +thing-type.config.velbus.80channelDevice.CH26.label = CH26 Name +thing-type.config.velbus.80channelDevice.CH26.description = The name of CH26. +thing-type.config.velbus.80channelDevice.CH27.label = CH27 Name +thing-type.config.velbus.80channelDevice.CH27.description = The name of CH27. +thing-type.config.velbus.80channelDevice.CH28.label = CH28 Name +thing-type.config.velbus.80channelDevice.CH28.description = The name of CH28. +thing-type.config.velbus.80channelDevice.CH29.label = CH29 Name +thing-type.config.velbus.80channelDevice.CH29.description = The name of CH29. +thing-type.config.velbus.80channelDevice.CH3.label = CH3 Name +thing-type.config.velbus.80channelDevice.CH3.description = The name of CH3. +thing-type.config.velbus.80channelDevice.CH30.label = CH30 Name +thing-type.config.velbus.80channelDevice.CH30.description = The name of CH30. +thing-type.config.velbus.80channelDevice.CH31.label = CH31 Name +thing-type.config.velbus.80channelDevice.CH31.description = The name of CH31. +thing-type.config.velbus.80channelDevice.CH32.label = CH32 Name +thing-type.config.velbus.80channelDevice.CH32.description = The name of CH32. +thing-type.config.velbus.80channelDevice.CH33.label = CH33 Name +thing-type.config.velbus.80channelDevice.CH33.description = The name of CH33. +thing-type.config.velbus.80channelDevice.CH34.label = CH34 Name +thing-type.config.velbus.80channelDevice.CH34.description = The name of CH34. +thing-type.config.velbus.80channelDevice.CH35.label = CH35 Name +thing-type.config.velbus.80channelDevice.CH35.description = The name of CH35. +thing-type.config.velbus.80channelDevice.CH36.label = CH36 Name +thing-type.config.velbus.80channelDevice.CH36.description = The name of CH36. +thing-type.config.velbus.80channelDevice.CH37.label = CH37 Name +thing-type.config.velbus.80channelDevice.CH37.description = The name of CH37. +thing-type.config.velbus.80channelDevice.CH38.label = CH38 Name +thing-type.config.velbus.80channelDevice.CH38.description = The name of CH38. +thing-type.config.velbus.80channelDevice.CH39.label = CH39 Name +thing-type.config.velbus.80channelDevice.CH39.description = The name of CH39. +thing-type.config.velbus.80channelDevice.CH4.label = A3 Name +thing-type.config.velbus.80channelDevice.CH4.description = The name of CH4. +thing-type.config.velbus.80channelDevice.CH40.label = CH40 Name +thing-type.config.velbus.80channelDevice.CH40.description = The name of CH40. +thing-type.config.velbus.80channelDevice.CH41.label = CH41 Name +thing-type.config.velbus.80channelDevice.CH41.description = The name of CH41. +thing-type.config.velbus.80channelDevice.CH42.label = CH42 Name +thing-type.config.velbus.80channelDevice.CH42.description = The name of CH42. +thing-type.config.velbus.80channelDevice.CH43.label = CH43 Name +thing-type.config.velbus.80channelDevice.CH43.description = The name of CH43. +thing-type.config.velbus.80channelDevice.CH44.label = CH44 Name +thing-type.config.velbus.80channelDevice.CH44.description = The name of CH44. +thing-type.config.velbus.80channelDevice.CH45.label = CH45 Name +thing-type.config.velbus.80channelDevice.CH45.description = The name of CH45. +thing-type.config.velbus.80channelDevice.CH46.label = CH46 Name +thing-type.config.velbus.80channelDevice.CH46.description = The name of CH46. +thing-type.config.velbus.80channelDevice.CH47.label = CH47 Name +thing-type.config.velbus.80channelDevice.CH47.description = The name of CH47. +thing-type.config.velbus.80channelDevice.CH48.label = CH48 Name +thing-type.config.velbus.80channelDevice.CH48.description = The name of CH48. +thing-type.config.velbus.80channelDevice.CH49.label = CH49 Name +thing-type.config.velbus.80channelDevice.CH49.description = The name of CH49. +thing-type.config.velbus.80channelDevice.CH5.label = CH5 Name +thing-type.config.velbus.80channelDevice.CH5.description = The name of CH5. +thing-type.config.velbus.80channelDevice.CH50.label = CH50 Name +thing-type.config.velbus.80channelDevice.CH50.description = The name of CH50. +thing-type.config.velbus.80channelDevice.CH51.label = CH51 Name +thing-type.config.velbus.80channelDevice.CH51.description = The name of CH51. +thing-type.config.velbus.80channelDevice.CH52.label = CH52 Name +thing-type.config.velbus.80channelDevice.CH52.description = The name of CH52. +thing-type.config.velbus.80channelDevice.CH53.label = CH53 Name +thing-type.config.velbus.80channelDevice.CH53.description = The name of CH53. +thing-type.config.velbus.80channelDevice.CH54.label = CH54 Name +thing-type.config.velbus.80channelDevice.CH54.description = The name of CH54. +thing-type.config.velbus.80channelDevice.CH55.label = CH55 Name +thing-type.config.velbus.80channelDevice.CH55.description = The name of CH55. +thing-type.config.velbus.80channelDevice.CH56.label = CH56 Name +thing-type.config.velbus.80channelDevice.CH56.description = The name of CH56. +thing-type.config.velbus.80channelDevice.CH57.label = CH57 Name +thing-type.config.velbus.80channelDevice.CH57.description = The name of CH57. +thing-type.config.velbus.80channelDevice.CH58.label = CH58 Name +thing-type.config.velbus.80channelDevice.CH58.description = The name of CH58. +thing-type.config.velbus.80channelDevice.CH59.label = CH59 Name +thing-type.config.velbus.80channelDevice.CH59.description = The name of CH59. +thing-type.config.velbus.80channelDevice.CH6.label = CH6 Name +thing-type.config.velbus.80channelDevice.CH6.description = The name of CH6. +thing-type.config.velbus.80channelDevice.CH60.label = CH60 Name +thing-type.config.velbus.80channelDevice.CH60.description = The name of CH60. +thing-type.config.velbus.80channelDevice.CH61.label = CH61 Name +thing-type.config.velbus.80channelDevice.CH61.description = The name of CH61. +thing-type.config.velbus.80channelDevice.CH62.label = CH62 Name +thing-type.config.velbus.80channelDevice.CH62.description = The name of CH62. +thing-type.config.velbus.80channelDevice.CH63.label = CH63 Name +thing-type.config.velbus.80channelDevice.CH63.description = The name of CH63. +thing-type.config.velbus.80channelDevice.CH64.label = CH64 Name +thing-type.config.velbus.80channelDevice.CH64.description = The name of CH64. +thing-type.config.velbus.80channelDevice.CH65.label = CH65 Name +thing-type.config.velbus.80channelDevice.CH65.description = The name of CH65. +thing-type.config.velbus.80channelDevice.CH66.label = CH66 Name +thing-type.config.velbus.80channelDevice.CH66.description = The name of CH66. +thing-type.config.velbus.80channelDevice.CH67.label = CH67 Name +thing-type.config.velbus.80channelDevice.CH67.description = The name of CH67. +thing-type.config.velbus.80channelDevice.CH68.label = CH68 Name +thing-type.config.velbus.80channelDevice.CH68.description = The name of CH68. +thing-type.config.velbus.80channelDevice.CH69.label = CH69 Name +thing-type.config.velbus.80channelDevice.CH69.description = The name of CH69. +thing-type.config.velbus.80channelDevice.CH7.label = CH7 Name +thing-type.config.velbus.80channelDevice.CH7.description = The name of CH7. +thing-type.config.velbus.80channelDevice.CH70.label = CH70 Name +thing-type.config.velbus.80channelDevice.CH70.description = The name of CH70. +thing-type.config.velbus.80channelDevice.CH71.label = CH71 Name +thing-type.config.velbus.80channelDevice.CH71.description = The name of CH71. +thing-type.config.velbus.80channelDevice.CH72.label = CH72 Name +thing-type.config.velbus.80channelDevice.CH72.description = The name of CH72. +thing-type.config.velbus.80channelDevice.CH73.label = CH73 Name +thing-type.config.velbus.80channelDevice.CH73.description = The name of CH73. +thing-type.config.velbus.80channelDevice.CH74.label = CH74 Name +thing-type.config.velbus.80channelDevice.CH74.description = The name of CH74. +thing-type.config.velbus.80channelDevice.CH75.label = CH75 Name +thing-type.config.velbus.80channelDevice.CH75.description = The name of CH75. +thing-type.config.velbus.80channelDevice.CH76.label = CH76 Name +thing-type.config.velbus.80channelDevice.CH76.description = The name of CH76. +thing-type.config.velbus.80channelDevice.CH77.label = CH77 Name +thing-type.config.velbus.80channelDevice.CH77.description = The name of CH77. +thing-type.config.velbus.80channelDevice.CH78.label = CH78 Name +thing-type.config.velbus.80channelDevice.CH78.description = The name of CH78. +thing-type.config.velbus.80channelDevice.CH79.label = CH79 Name +thing-type.config.velbus.80channelDevice.CH79.description = The name of CH79. +thing-type.config.velbus.80channelDevice.CH8.label = CH8 Name +thing-type.config.velbus.80channelDevice.CH8.description = The name of CH8. +thing-type.config.velbus.80channelDevice.CH80.label = CH80 Name +thing-type.config.velbus.80channelDevice.CH80.description = The name of CH80. +thing-type.config.velbus.80channelDevice.CH9.label = CH9 Name +thing-type.config.velbus.80channelDevice.CH9.description = The name of CH9. +thing-type.config.velbus.80channelDevice.address.label = Address (Channel A0...7) +thing-type.config.velbus.80channelDevice.address.description = The velbus address of the device +thing-type.config.velbus.80channelDevice.refresh.label = Refresh Interval +thing-type.config.velbus.80channelDevice.refresh.description = Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. +thing-type.config.velbus.80channelDevice.subaddress1.label = Channel A8...15 +thing-type.config.velbus.80channelDevice.subaddress1.description = The velbus sub-address 1 of the device (FF = disabled) +thing-type.config.velbus.80channelDevice.subaddress2.label = Channel A16...23 +thing-type.config.velbus.80channelDevice.subaddress2.description = The velbus sub-address 2 of the device (FF = disabled) +thing-type.config.velbus.80channelDevice.subaddress3.label = Channel A24...31 +thing-type.config.velbus.80channelDevice.subaddress3.description = The velbus sub-address 3 of the device (FF = disabled) +thing-type.config.velbus.80channelDevice.subaddress4.label = Channel A32...39 +thing-type.config.velbus.80channelDevice.subaddress4.description = The velbus sub-address 4 of the device (FF = disabled) +thing-type.config.velbus.80channelDevice.subaddress5.label = Channel A40...47 +thing-type.config.velbus.80channelDevice.subaddress5.description = The velbus sub-address 5 of the device (FF = disabled) +thing-type.config.velbus.80channelDevice.subaddress6.label = Channel A48...55 +thing-type.config.velbus.80channelDevice.subaddress6.description = The velbus sub-address 6 of the device (FF = disabled) +thing-type.config.velbus.80channelDevice.subaddress7.label = Channel A56...63 +thing-type.config.velbus.80channelDevice.subaddress7.description = The velbus sub-address 7 of the device (FF = disabled) +thing-type.config.velbus.80channelDevice.subaddress8.label = Group G0...7 +thing-type.config.velbus.80channelDevice.subaddress8.description = The velbus sub-address 8 of the device (FF = disabled) +thing-type.config.velbus.80channelDevice.subaddress9.label = Group G8...15 +thing-type.config.velbus.80channelDevice.subaddress9.description = The velbus sub-address 9 of the device (FF = disabled) + +# channel group types + +channel-group-type.velbus.80channelBrightnessModule.label = Brightness +channel-group-type.velbus.80channelBrightnessModule.description = This is a generic module with 80 brightness channels. +channel-group-type.velbus.80channelColorModule.label = Color +channel-group-type.velbus.80channelColorModule.description = This is a generic module with 80 color channels. +channel-group-type.velbus.80channelColorTemperatureModule.label = Color Temperature +channel-group-type.velbus.80channelColorTemperatureModule.description = This is a generic module with 80 color temperature channels. +channel-group-type.velbus.80channelFeedbackModule.label = Feedback +channel-group-type.velbus.80channelFeedbackModule.description = This is a generic module with 80 feedback channels. +channel-group-type.velbus.80channelInputModule.label = Input +channel-group-type.velbus.80channelInputModule.description = This is a generic module with 80 input channels. +channel-group-type.velbus.80channelSceneModule.label = Scene +channel-group-type.velbus.80channelSceneModule.description = This is a generic module with 80 scene channels. + +# channel group types + +channel-group-type.velbus.80channelButtonModule.label = Button +channel-group-type.velbus.80channelButtonModule.description = This is a generic module with 80 button channels. diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml index a4633a69f9aed..8468cab49f34e 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml @@ -8,7 +8,7 @@ This bridge represents a Velbus Serial-interface - + @@ -17,7 +17,7 @@ This bridge represents a Velbus connection over TCP/IP - + @@ -473,6 +473,7 @@ + @@ -492,6 +493,7 @@ + @@ -511,6 +513,7 @@ + @@ -530,6 +533,7 @@ + @@ -550,6 +554,7 @@ + @@ -919,6 +924,28 @@ + + + + + + + + DALI gateway module + + + + + + + + + + + + + + String @@ -1085,7 +1112,8 @@ Currently measured wind speed Wind - + + trigger @@ -1108,6 +1136,14 @@ + + Number + + Scene options for DALI network + + + + This is a generic module with 8 input channels and a temperature sensor. @@ -1268,6 +1304,102 @@ + + + This is a generic module with 81 input channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is a generic module with 1 output. + + + + + @@ -1369,6 +1501,95 @@ + + + + This is a generic module with 81 feedback channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1462,6 +1683,385 @@ + + + + This is a generic module with 81 color channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is a generic module with 81 brightness channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is a generic module with 81 color temperature channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is a generic module with 81 scene channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is a generic module with 16 virtual light channels. + + + + + + + + + + + + + + + + + + + + From d25e053148868ff55aa2abae87a18986e1f24bbc Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Thu, 28 Sep 2023 12:13:45 +0200 Subject: [PATCH 02/28] [velbus] VMBDALI white channel Changed the management of VMBDALI white channel. Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 17 +- .../internal/VelbusBindingConstants.java | 2 +- .../internal/VelbusVirtualColorChannel.java | 50 +++++- .../handler/VelbusVMBDALIHandler.java | 104 ++++++----- .../main/resources/OH-INF/config/config.xml | 112 +++++++----- .../resources/OH-INF/i18n/velbus.properties | 41 +++-- .../resources/OH-INF/thing/thing-types.xml | 170 +++++++++--------- 7 files changed, 284 insertions(+), 212 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 3fc534365d8be..c247ca7e7ea0f 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -126,6 +126,8 @@ The `vmbdali` thing also supports 9 subaddresses. The value "FF" = not configure Thing velbus:vmbelo:: [subaddress1="F1", subaddress2="F2", subaddress3="F3", subaddress4="F4", subaddress5="F5", subaddress6="F6", subaddress7="F7", subaddress8="F8", subaddress9="F9"] ``` +In the UI, the subaddress settings are in the advanced configuration of the module. + For thing types with builtin sensors (e.g. temperature), the interval at which the sensors should be checked can be set by specifying the Refresh Interval, e.g.: ```java @@ -155,20 +157,21 @@ The following thing types support setting the dimspeed: vmb1dm, vmb1led, vmb4dc, vmbdme, vmbdmi, vmbdmir ``` -The `vmbdali` thing has 16 virtual light. A virtual light is created from 3 channels of the DALI module. -This is because an RGB DALI light is configured on the DALI module with 3 channels (Red channel, Green channel, Blue channel). +The `vmbdali` thing has 16 virtual light. A virtual light is created from 4 channels of the DALI module. +This is because an RGBW DALI light is configured on the VMBDALI module with 4 channels (Red channel, Green channel, Blue channel, White channel). + The configuration is set like this : ```java -Thing velbus:vmbdali:: [VL1="R,G,B"] +Thing velbus:vmbdali:: [VL1="R,G,B,W"] ``` +The white channel is optionnal. e.g.: ```java -Thing velbus:vmbdali:: [VL1="CH1,CH2,CH3", VL2="CH6,CH8,CH7"] +Thing velbus:vmbdali:: [VL1="CH1,CH2,CH3,CH4", VL2="CH6,CH7,CH5"] ``` - -If the light is an RGBW (Red channel, Green channel, Blue channel, White channel), the white channel is managed by the corresponding `brightness` and `color-temperature` channels. +In the UI, the virtual light settings are in the advanced configuration of the VMBDALI module. ## Channels @@ -257,7 +260,7 @@ Thing type `vmbdali` has 81 trigger channels `input#CH1` ... `input#CH81`. It has 81 channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH81`. hsbColor command type is supported on channels `color#CH1` ... `color#CH64` (A1 ... A64), `color#CH65` ... `color#CH80` (G1 ... G16) and `color#CH81` (broadcast). This is to set the color on the channels. Percent command type is supported on channels `brightness#CH1` ... `brightness#CH64` (A1 ... A64), `brightness#CH65` ... `brightness#CH80` (G1 ... G16) and `brightness#CH81` (broadcast). This is to set the brightness on the channels. -Percent command type is supported on channels `color-temperature#CH1` ... `color-temperature#CH64` (A1 ... A64), `color-temperature#CH65` ... `color-temperature#CH80` (G1 ... G16) and `color-temperature#CH81` (broadcast). This is to set the white temperature on the channels. +Percent command type is supported on channels `white#CH1` ... `white#CH64` (A1 ... A64), `white#CH65` ... `white#CH80` (G1 ... G16) and `white#CH81` (broadcast). This is to set the white on the channels. Values 1 to 15 are supported on channels `scene#CH1` ... `scene#CH64` (A1 ... A64), `scene#CH65` ... `scene#CH80` (G1 ... G16) and `scene#CH81` (broadcast). This is to set the scene on the channels. hsbColor command type is supported on channels `virtual-light#VL1` ... `virtual-light#VL16`. This is to set the color on the virtual light. It has a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java index 6ca4cd6dbeea9..444f1a10dd108 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java @@ -257,7 +257,7 @@ public class VelbusBindingConstants { public static final String CHANNEL_GROUP_THERMOSTAT = "thermostat"; public static final String CHANNEL_GROUP_COLOR = "color"; public static final String CHANNEL_GROUP_BRIGHTNESS = "brightness"; - public static final String CHANNEL_GROUP_COLOR_TEMPERATURE = "color-temperature"; + public static final String CHANNEL_GROUP_WHITE = "white"; public static final String CHANNEL_GROUP_SCENE = "scene"; public static final String CHANNEL_GROUP_VIRTUAL_LIGHT = "virtual-light"; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java index 6280f1db12987..0f1fe133d466a 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java @@ -28,34 +28,43 @@ public class VelbusVirtualColorChannel extends VelbusColorChannel { private byte redChannel; private byte greenChannel; private byte blueChannel; + private byte whiteChannel; public VelbusVirtualColorChannel() { redChannel = NOT_CONFIGURED; greenChannel = NOT_CONFIGURED; blueChannel = NOT_CONFIGURED; + whiteChannel = NOT_CONFIGURED; } public VelbusVirtualColorChannel(int r, int g, int b, int w) { redChannel = getByteValue(r); greenChannel = getByteValue(g); blueChannel = getByteValue(b); + whiteChannel = getByteValue(w); } public VelbusVirtualColorChannel(String r, String g, String b, String w) throws NumberFormatException { redChannel = getByteValue(r); greenChannel = getByteValue(g); blueChannel = getByteValue(b); + whiteChannel = getByteValue(w); } public VelbusVirtualColorChannel(String rgbw) throws InvalidPropertiesFormatException, NumberFormatException { String virtualChannels[] = rgbw.split("\\s*,\\s*"); - if (virtualChannels.length != 3) { + if (virtualChannels.length == 4) { + redChannel = getByteValue(virtualChannels[0]); + greenChannel = getByteValue(virtualChannels[1]); + blueChannel = getByteValue(virtualChannels[2]); + whiteChannel = getByteValue(virtualChannels[3]); + } else if (virtualChannels.length == 3) { + redChannel = getByteValue(virtualChannels[0]); + greenChannel = getByteValue(virtualChannels[1]); + blueChannel = getByteValue(virtualChannels[2]); + } else { throw new InvalidPropertiesFormatException("Wrong format"); } - - redChannel = getByteValue(virtualChannels[0]); - greenChannel = getByteValue(virtualChannels[1]); - blueChannel = getByteValue(virtualChannels[2]); } private byte getByteValue(String channel) { @@ -78,15 +87,37 @@ public byte getBlueChannel() { return blueChannel; } + public byte getWhiteChannel() { + return whiteChannel; + } + public boolean isVirtualColorChannel(int channel) { byte c = getByteValue(channel); + if (c == redChannel || c == greenChannel || c == blueChannel || c == whiteChannel) { + return true; + } + return false; + } + + public boolean isColorChannel(int channel) { + byte c = getByteValue(channel); + if (c == redChannel || c == greenChannel || c == blueChannel) { return true; } return false; } + public boolean isWhiteChannel(int channel) { + byte c = getByteValue(channel); + + if (c == whiteChannel) { + return true; + } + return false; + } + public boolean isRGBConfigured() { if (redChannel != NOT_CONFIGURED && greenChannel != NOT_CONFIGURED && blueChannel != NOT_CONFIGURED) { return true; @@ -94,6 +125,13 @@ public boolean isRGBConfigured() { return false; } + public boolean isWhiteConfigured() { + if (whiteChannel != NOT_CONFIGURED) { + return true; + } + return false; + } + public int getRedColor() { return super.getColor()[0]; } @@ -126,6 +164,8 @@ public void setColor(byte color, int channel) { setGreenColor(color); } else if (c == blueChannel) { setBlueColor(color); + } else if (c == whiteChannel) { + setWhite(color); } } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java index 44e97f34dfa02..dde9e1243a7d8 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -165,7 +165,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { if (command instanceof RefreshType) { if (isColorGroupChannel(channelUID) || isBrightnessGroupChannel(channelUID) - || isColorTemperatureGroupChannel(channelUID)) { + || isWhiteGroupChannel(channelUID)) { sendDaliReadoutRequest(velbusBridgeHandler, channel); } } else if (isSceneGroupChannel(channelUID)) { @@ -179,7 +179,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { "The command '" + command + "' is not supported on channel '" + channelUID + "'."); } } else if (isColorGroupChannel(channelUID) || isBrightnessGroupChannel(channelUID) - || isColorTemperatureGroupChannel(channelUID) || isVirtualLightChannel(channelUID)) { + || isWhiteGroupChannel(channelUID) || isVirtualLightChannel(channelUID)) { VelbusColorChannel colorChannel = colorChannels[Byte.toUnsignedInt(channel) - 1]; if (isBrightnessGroupChannel(channelUID)) { @@ -206,13 +206,28 @@ public void handleCommand(ChannelUID channelUID, Command command) { throw new UnsupportedOperationException( "The command '" + command + "' is not supported on channel '" + channelUID + "'."); } - } else if (isColorTemperatureGroupChannel(channelUID)) { + } else if (isWhiteGroupChannel(channelUID)) { if (command instanceof PercentType percentCommand) { - colorChannel.setWhite(percentCommand); + int channelNumber = getModuleAddress().getChannelNumber(channelUID); + boolean isVirtualLight = false; - VelbusSetColorPacket packet = new VelbusSetColorPacket(address, channel); - packet.setWhite(colorChannel.getWhiteVelbus()); - velbusBridgeHandler.sendPacket(packet.getBytes()); + for (int i = 0; i < 16; i++) { + if (virtualColorChannels[i].isVirtualColorChannel(channelNumber)) { + virtualColorChannels[i].setWhite(percentCommand); + + VelbusSetDimPacket packet = new VelbusSetDimPacket(address, channel); + packet.setDim(virtualColorChannels[i].getWhiteVelbus()); + velbusBridgeHandler.sendPacket(packet.getBytes()); + isVirtualLight = true; + } + } + if (!isVirtualLight) { + colorChannel.setWhite(percentCommand); + + VelbusSetColorPacket packet = new VelbusSetColorPacket(address, channel); + packet.setWhite(colorChannel.getWhiteVelbus()); + velbusBridgeHandler.sendPacket(packet.getBytes()); + } } else { throw new UnsupportedOperationException( "The command '" + command + "' is not supported on channel '" + channelUID + "'."); @@ -252,8 +267,8 @@ private boolean isBrightnessGroupChannel(ChannelUID channelUID) { return CHANNEL_GROUP_BRIGHTNESS.equals(channelUID.getGroupId()); } - private boolean isColorTemperatureGroupChannel(ChannelUID channelUID) { - return CHANNEL_GROUP_COLOR_TEMPERATURE.equals(channelUID.getGroupId()); + private boolean isWhiteGroupChannel(ChannelUID channelUID) { + return CHANNEL_GROUP_WHITE.equals(channelUID.getGroupId()); } private boolean isSceneGroupChannel(ChannelUID channelUID) { @@ -287,16 +302,7 @@ public void onPacketReceived(byte[] packet) { CHANNEL + channel); colorChannel.setBrightness(packet[7]); updateState(brightness, colorChannel.getBrightnessPercent()); - - for (int i = 0; i < 16; i++) { - if (virtualColorChannels[i].isVirtualColorChannel(channel)) { - virtualColorChannels[i].setColor(packet[7], channel); - - ChannelUID virtualLight = new ChannelUID(thing.getUID(), CHANNEL_GROUP_VIRTUAL_LIGHT, - VIRTUAL_LIGHT + (i + 1)); - updateState(virtualLight, virtualColorChannels[i].getColorHSB()); - } - } + updateVirtualLightState(channel, packet[7]); } else if (packet.length >= 12) { ChannelUID brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, CHANNEL + channel); @@ -307,10 +313,9 @@ public void onPacketReceived(byte[] packet) { colorChannel.setColor(new byte[] { packet[8], packet[9], packet[10] }); updateState(color, colorChannel.getColorHSB()); - ChannelUID temperature = new ChannelUID(thing.getUID(), CHANNEL_GROUP_COLOR_TEMPERATURE, - CHANNEL + channel); + ChannelUID white = new ChannelUID(thing.getUID(), CHANNEL_GROUP_WHITE, CHANNEL + channel); colorChannel.setWhite(packet[11]); - updateState(temperature, colorChannel.getWhitePercent()); + updateState(white, colorChannel.getWhitePercent()); } } else if (channel == 81) { // Broadcast if (packet.length >= 8 && packet.length < 12) { @@ -322,22 +327,13 @@ public void onPacketReceived(byte[] packet) { brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, CHANNEL + i); colorChannel.setBrightness(packet[7]); updateState(brightness, colorChannel.getBrightnessPercent()); - - for (int j = 0; j < 16; j++) { - if (virtualColorChannels[j].isVirtualColorChannel(i)) { - virtualColorChannels[j].setColor(packet[6], i); - - ChannelUID virtualLight = new ChannelUID(thing.getUID(), - CHANNEL_GROUP_VIRTUAL_LIGHT, VIRTUAL_LIGHT + (j + 1)); - updateState(virtualLight, virtualColorChannels[j].getColorHSB()); - } - } + updateVirtualLightState(i, packet[7]); } } else if (packet.length >= 12) { VelbusColorChannel colorChannel; ChannelUID brightness; ChannelUID color; - ChannelUID temperature; + ChannelUID white; byte[] rgb = new byte[] { packet[8], packet[9], packet[10] }; for (int i = 1; i <= 80; i++) { @@ -351,9 +347,9 @@ public void onPacketReceived(byte[] packet) { colorChannel.setColor(rgb); updateState(color, colorChannel.getColorHSB()); - temperature = new ChannelUID(thing.getUID(), CHANNEL_GROUP_COLOR_TEMPERATURE, CHANNEL + i); + white = new ChannelUID(thing.getUID(), CHANNEL_GROUP_WHITE, CHANNEL + i); colorChannel.setWhite(packet[11]); - updateState(temperature, colorChannel.getWhitePercent()); + updateState(white, colorChannel.getWhitePercent()); } } } @@ -363,9 +359,13 @@ public void onPacketReceived(byte[] packet) { if (channel >= 1 && channel <= 80) { VelbusColorChannel colorChannel = colorChannels[channel - 1]; - ChannelUID brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, CHANNEL + channel); - colorChannel.setBrightness(packet[6]); - updateState(brightness, colorChannel.getBrightnessPercent()); + for (int i = 0; i < (packet.length - 8); i++) { + ChannelUID brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, + CHANNEL + (channel + i)); + colorChannel.setBrightness(packet[6 + i]); + updateState(brightness, colorChannel.getBrightnessPercent()); + updateVirtualLightState(channel + i, packet[6 + i]); + } } else if (channel == 81) { // Broadcast VelbusColorChannel colorChannel; ChannelUID brightness; @@ -375,19 +375,27 @@ public void onPacketReceived(byte[] packet) { brightness = new ChannelUID(thing.getUID(), CHANNEL_GROUP_BRIGHTNESS, CHANNEL + i); colorChannel.setBrightness(packet[6]); updateState(brightness, colorChannel.getBrightnessPercent()); - - for (int j = 0; j < 16; j++) { - if (virtualColorChannels[j].isVirtualColorChannel(i)) { - virtualColorChannels[j].setColor(packet[6], i); - - ChannelUID virtualLight = new ChannelUID(thing.getUID(), CHANNEL_GROUP_VIRTUAL_LIGHT, - VIRTUAL_LIGHT + (j + 1)); - updateState(virtualLight, virtualColorChannels[j].getColorHSB()); - } - } + updateVirtualLightState(i, packet[6]); } } } } } + + private void updateVirtualLightState(int channel, byte dimVal) { + for (int i = 0; i < 16; i++) { + if (virtualColorChannels[i].isVirtualColorChannel(channel)) { + virtualColorChannels[i].setColor(dimVal, channel); + + if (virtualColorChannels[i].isColorChannel(channel)) { + ChannelUID virtualLight = new ChannelUID(thing.getUID(), CHANNEL_GROUP_VIRTUAL_LIGHT, + VIRTUAL_LIGHT + (i + 1)); + updateState(virtualLight, virtualColorChannels[i].getColorHSB()); + } else if (virtualColorChannels[i].isWhiteChannel(channel)) { + ChannelUID whiteChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_WHITE, CHANNEL + channel); + updateState(whiteChannel, virtualColorChannels[i].getWhitePercent()); + } + } + } + } } diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml index 2e5f187108643..33ee57425591c 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml @@ -1467,114 +1467,130 @@ - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH1,CH2,CH3) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH1,CH2,CH3,CH4) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH5,CH6,CH7) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH5,CH6,CH7,CH8) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH9,CH10,CH11) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH9,CH10,CH11,CH12) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH13,CH14,CH15) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH13,CH14,CH15,CH16) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH17,CH18,CH19) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH17,CH18,CH19,CH20) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH21,CH22,CH23) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH21,CH22,CH23,CH24) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH25,CH26,CH27) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH25,CH26,CH27,CH28) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH29,CH30,CH31) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH29,CH30,CH31,CH32) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH33,CH34,CH35) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH33,CH34,CH35,CH36) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH37,CH38,CH39) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH37,CH38,CH39,CH40) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH41,CH42,CH43) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH41,CH42,CH43,CH44) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH45,CH46,CH47) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH45,CH46,CH47,CH48) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH49,CH50,CH510) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH49,CH50,CH51,CH52) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH53,CH54,CH55) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH53,CH54,CH55,CH56) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH57,CH58,CH59) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH57,CH58,CH59,CH60) true - Create a virtual color light from 3 channels. Format: - Red_channel,Green_channel,Blue_channel. From CH1 to - CH64. (e.g. CH61,CH62,CH63) + Create a virtual color light from 3 or 4 channels. Format: + Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to + CH64. (e.g. + CH61,CH62,CH63,CH64) true diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties index d1eae6db7f50c..70087ab298d5d 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties @@ -545,37 +545,37 @@ thing-type.config.velbus.81channelDevice.CH81.description = The name of CH81. thing-type.config.velbus.81channelDevice.CH9.label = CH9 Name thing-type.config.velbus.81channelDevice.CH9.description = The name of CH9. thing-type.config.velbus.81channelDevice.VL1.label = Virtual Light 1 -thing-type.config.velbus.81channelDevice.VL1.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH1,CH2,CH3) +thing-type.config.velbus.81channelDevice.VL1.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH1,CH2,CH3,CH4) thing-type.config.velbus.81channelDevice.VL10.label = Virtual Light 10 -thing-type.config.velbus.81channelDevice.VL10.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH37,CH38,CH39) +thing-type.config.velbus.81channelDevice.VL10.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH37,CH38,CH39,CH40) thing-type.config.velbus.81channelDevice.VL11.label = Virtual Light 11 -thing-type.config.velbus.81channelDevice.VL11.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH41,CH42,CH43) +thing-type.config.velbus.81channelDevice.VL11.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH41,CH42,CH43,CH44) thing-type.config.velbus.81channelDevice.VL12.label = Virtual Light 12 -thing-type.config.velbus.81channelDevice.VL12.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH45,CH46,CH47) +thing-type.config.velbus.81channelDevice.VL12.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH45,CH46,CH47,CH48) thing-type.config.velbus.81channelDevice.VL13.label = Virtual Light 13 -thing-type.config.velbus.81channelDevice.VL13.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH49,CH50,CH510) +thing-type.config.velbus.81channelDevice.VL13.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH49,CH50,CH51,CH52) thing-type.config.velbus.81channelDevice.VL14.label = Virtual Light 14 -thing-type.config.velbus.81channelDevice.VL14.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH53,CH54,CH55) +thing-type.config.velbus.81channelDevice.VL14.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH53,CH54,CH55,CH56) thing-type.config.velbus.81channelDevice.VL15.label = Virtual Light 15 -thing-type.config.velbus.81channelDevice.VL15.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH57,CH58,CH59) +thing-type.config.velbus.81channelDevice.VL15.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH57,CH58,CH59,CH60) thing-type.config.velbus.81channelDevice.VL16.label = Virtual Light 16 -thing-type.config.velbus.81channelDevice.VL16.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH61,CH62,CH63) +thing-type.config.velbus.81channelDevice.VL16.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH61,CH62,CH63,CH64) thing-type.config.velbus.81channelDevice.VL2.label = Virtual Light 2 -thing-type.config.velbus.81channelDevice.VL2.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH5,CH6,CH7) +thing-type.config.velbus.81channelDevice.VL2.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH5,CH6,CH7,CH8) thing-type.config.velbus.81channelDevice.VL3.label = Virtual Light 3 -thing-type.config.velbus.81channelDevice.VL3.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH9,CH10,CH11) +thing-type.config.velbus.81channelDevice.VL3.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH9,CH10,CH11,CH12) thing-type.config.velbus.81channelDevice.VL4.label = Virtual Light 4 -thing-type.config.velbus.81channelDevice.VL4.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH13,CH14,CH15) +thing-type.config.velbus.81channelDevice.VL4.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH13,CH14,CH15,CH16) thing-type.config.velbus.81channelDevice.VL5.label = Virtual Light 5 -thing-type.config.velbus.81channelDevice.VL5.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH17,CH18,CH19) +thing-type.config.velbus.81channelDevice.VL5.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH17,CH18,CH19,CH20) thing-type.config.velbus.81channelDevice.VL6.label = Virtual Light 6 -thing-type.config.velbus.81channelDevice.VL6.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH21,CH22,CH23) +thing-type.config.velbus.81channelDevice.VL6.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH21,CH22,CH23,CH24) thing-type.config.velbus.81channelDevice.VL7.label = Virtual Light 7 -thing-type.config.velbus.81channelDevice.VL7.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH25,CH26,CH27) +thing-type.config.velbus.81channelDevice.VL7.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH25,CH26,CH27,CH28) thing-type.config.velbus.81channelDevice.VL8.label = Virtual Light 8 -thing-type.config.velbus.81channelDevice.VL8.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH29,CH30,CH31) +thing-type.config.velbus.81channelDevice.VL8.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH29,CH30,CH31,CH32) thing-type.config.velbus.81channelDevice.VL9.label = Virtual Light 9 -thing-type.config.velbus.81channelDevice.VL9.description = Create a virtual color light from 3 channels. Format: Red_channel,Green_channel,Blue_channel. From CH1 to CH64. (e.g. CH33,CH34,CH35) +thing-type.config.velbus.81channelDevice.VL9.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH33,CH34,CH35,CH36) thing-type.config.velbus.81channelDevice.address.label = Address (Channel A0...7) thing-type.config.velbus.81channelDevice.address.description = The velbus address of the device thing-type.config.velbus.81channelDevice.refresh.label = Refresh Interval @@ -687,14 +687,14 @@ channel-group-type.velbus.81channelBrightnessModule.label = Brightness channel-group-type.velbus.81channelBrightnessModule.description = This is a generic module with 81 brightness channels. channel-group-type.velbus.81channelColorModule.label = Color channel-group-type.velbus.81channelColorModule.description = This is a generic module with 81 color channels. -channel-group-type.velbus.81channelColorTemperatureModule.label = Color Temperature -channel-group-type.velbus.81channelColorTemperatureModule.description = This is a generic module with 81 color temperature channels. channel-group-type.velbus.81channelFeedbackModule.label = Feedback channel-group-type.velbus.81channelFeedbackModule.description = This is a generic module with 81 feedback channels. channel-group-type.velbus.81channelInputModule.label = Input channel-group-type.velbus.81channelInputModule.description = This is a generic module with 81 input channels. channel-group-type.velbus.81channelSceneModule.label = Scene channel-group-type.velbus.81channelSceneModule.description = This is a generic module with 81 scene channels. +channel-group-type.velbus.81channelWhiteColorModule.label = White Color +channel-group-type.velbus.81channelWhiteColorModule.description = This is a generic module with 81 white color channels. channel-group-type.velbus.8channelButtonModule.label = Button channel-group-type.velbus.8channelButtonModule.description = This is a generic module with 8 button channels. channel-group-type.velbus.8channelFeedbackModule.label = Feedback @@ -814,6 +814,11 @@ channel-type.velbus.voltage.description = Currently measured voltage channel-type.velbus.windspeed.label = Wind Speed channel-type.velbus.windspeed.description = Currently measured wind speed +# channel group types + +channel-group-type.velbus.81channelColorTemperatureModule.label = Color Temperature +channel-group-type.velbus.81channelColorTemperatureModule.description = This is a generic module with 81 color temperature channels. + # thing types config thing-type.config.velbus.80channelDevice.CH1.label = CH1 Name diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml index 8468cab49f34e..379074f4d3c99 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml @@ -937,7 +937,7 @@ - + @@ -1860,93 +1860,93 @@ - - + + - This is a generic module with 81 color temperature channels. + This is a generic module with 81 white color channels. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f3143c3c5a613d259772da392a00096ae02843b1 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 4 Oct 2023 09:27:17 +0200 Subject: [PATCH 03/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- .../openhab/binding/velbus/internal/VelbusBindingConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java index 444f1a10dd108..c9525e98d7cae 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java @@ -221,7 +221,7 @@ public class VelbusBindingConstants { public static final byte COMMAND_MEMORY_DATA = (byte) 0xFE; public static final byte COMMAND_MODULE_TYPE = (byte) 0xFF; - // Usefull values + // Useful values public static final byte ALL_CHANNELS = (byte) 0xFF; public static final byte ALL_DALI_CHANNELS = (byte) 0x51; public static final byte SUB_ADDRESS_DISABLED = (byte) 0xFF; From 37b72b2fdef0ce0d1f770b6164a0411d3f586104 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 4 Oct 2023 09:28:25 +0200 Subject: [PATCH 04/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- .../openhab/binding/velbus/internal/VelbusBindingConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java index c9525e98d7cae..76766329eea34 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java @@ -247,7 +247,7 @@ public class VelbusBindingConstants { public static final String SUB_ADDRESS = "subaddress"; public static final String DIMSPEED = "dimspeed"; - // Channels group ids + // Channel group ids public static final String CHANNEL_GROUP_BRIDGE_CLOCK_ALARM = "bridgeClockAlarm"; public static final String CHANNEL_GROUP_MODULE_CLOCK_ALARM = "clockAlarm"; public static final String CHANNEL_GROUP_INPUT = "input"; From fb2ee806b4227bbee3fa448b01765825451bc5c4 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 4 Oct 2023 09:33:23 +0200 Subject: [PATCH 05/28] Update bundles/org.openhab.binding.velbus/README.md Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index c247ca7e7ea0f..21d6f81076b36 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -108,7 +108,7 @@ vmb1bl, vmb1bls, vmb1dm, vmb1led, vmb1ry, vmb1ryno, vmb1rynos, vmb1rys, vmb1ts, `[CHx="..."]` is optional, and represents the name of channel x, e.g. CH1 specifies the name of channel 1. -The `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbel1`, `vmbgp1`, `vmbgp1-2`, `vmbgp2`, `vmbgp2-2`, `vmbgp4`, `vmbgp4-2`, `vmbgp4pir` and `vmbgp4pir-2` thing type also supports 1 subaddress. This subaddress is the Sensor Address. The value "FF" = not configured. +The `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbel1`, `vmbgp1`, `vmbgp1-2`, `vmbgp2`, `vmbgp2-2`, `vmbgp4`, `vmbgp4-2`, `vmbgp4pir` and `vmbgp4pir-2` thing types require `subaddress1` to be configured in order to access full functionality (such as the thermostat or sensor channels). Setting `subaddress1 = "FF"` disables handling of these additional channels. ```java Thing velbus:vmbel1:: [subaddress1="A1"] From f3565df5390d0dd71c45704f3c2622e7151b5a85 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 4 Oct 2023 09:44:51 +0200 Subject: [PATCH 06/28] Update bundles/org.openhab.binding.velbus/README.md Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 21d6f81076b36..35bf3a8db4859 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -165,7 +165,7 @@ The configuration is set like this : ```java Thing velbus:vmbdali:: [VL1="R,G,B,W"] ``` -The white channel is optionnal. +The white channel is optional. e.g.: ```java From 11964890a3aec0aaa279837bb2b3f982b2aa2383 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 4 Oct 2023 10:08:25 +0200 Subject: [PATCH 07/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- .../velbus/internal/discovery/VelbusThingDiscoveryService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java index d028741dbfb74..ce936051c5195 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java @@ -346,7 +346,6 @@ private void handleModuleSubtypeCommand(byte[] packet, byte address, int subType byte[] subAddresses = new byte[4]; System.arraycopy(packet, 8, subAddresses, 0, 4); - // velbusModule.getModuleAddress().setSubAddresses(subAddresses); velbusModule.getModuleAddress().setSubAddresses(subAddresses, subTypeNumber); for (int i = 0; i < subAddresses.length; i++) { From 215c6ac879abc5aed04f78aa2d621ba900cee59d Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 4 Oct 2023 11:21:55 +0200 Subject: [PATCH 08/28] Update bundles/org.openhab.binding.velbus/README.md Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 35bf3a8db4859..b87a362a9bf96 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -157,7 +157,7 @@ The following thing types support setting the dimspeed: vmb1dm, vmb1led, vmb4dc, vmbdme, vmbdmi, vmbdmir ``` -The `vmbdali` thing has 16 virtual light. A virtual light is created from 4 channels of the DALI module. +The `vmbdali` thing has 16 virtual light channels. A virtual light combines 3 or 4 VMBDALI module channels into an OpenHAB channel to control RGB or RGBW lights. This is because an RGBW DALI light is configured on the VMBDALI module with 4 channels (Red channel, Green channel, Blue channel, White channel). The configuration is set like this : From 817c8c7b9a2b908399816c5c7deb000acacffa28 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 4 Oct 2023 11:22:51 +0200 Subject: [PATCH 09/28] Update bundles/org.openhab.binding.velbus/README.md Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index b87a362a9bf96..9d77b796e41b5 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -160,7 +160,7 @@ vmb1dm, vmb1led, vmb4dc, vmbdme, vmbdmi, vmbdmir The `vmbdali` thing has 16 virtual light channels. A virtual light combines 3 or 4 VMBDALI module channels into an OpenHAB channel to control RGB or RGBW lights. This is because an RGBW DALI light is configured on the VMBDALI module with 4 channels (Red channel, Green channel, Blue channel, White channel). -The configuration is set like this : +The configuration is set like this: ```java Thing velbus:vmbdali:: [VL1="R,G,B,W"] From b49bd663887e96c72849c3928e0a558102b64460 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 4 Oct 2023 14:24:50 +0200 Subject: [PATCH 10/28] Update bundles/org.openhab.binding.velbus/README.md Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 9d77b796e41b5..fe95dfd6d6b98 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -114,7 +114,7 @@ The `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbel1`, `vmbgp1`, `vmbgp1-2`, `v Thing velbus:vmbel1:: [subaddress1="A1"] ``` -The `vmbelo`, `vmbgpo`, `vmbgpod` and `vmbgpod-2` thing type also supports 4 subaddresses. The subaddress4 is the Sensor Address. The value "FF" = not configured. +The `vmbelo`, `vmbgpo`, `vmbgpod` and `vmbgpod-2` thing type also requires configuration of 4 subaddresses in order to access full functionality of the module. The `subaddress4` is the address of the thermostat channels. The value "FF" disables handling of the corresponding group of channels. ```java Thing velbus:vmbelo:: [subaddress1="B1", subaddress2="B2", subaddress3="B3", subaddress4="B4"] From 025684c356049d0832f6a4e0ada79ea89fd7dcc2 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Thu, 5 Oct 2023 08:56:41 +0200 Subject: [PATCH 11/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- .../binding/velbus/internal/VelbusVirtualColorChannel.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java index 0f1fe133d466a..53766584ea51a 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java @@ -94,10 +94,7 @@ public byte getWhiteChannel() { public boolean isVirtualColorChannel(int channel) { byte c = getByteValue(channel); - if (c == redChannel || c == greenChannel || c == blueChannel || c == whiteChannel) { - return true; - } - return false; + return c == redChannel || c == greenChannel || c == blueChannel || c == whiteChannel; } public boolean isColorChannel(int channel) { From 5d76cc40b182a44ed1f4fa96d50322171f81fd8c Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Thu, 5 Oct 2023 08:57:12 +0200 Subject: [PATCH 12/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- .../binding/velbus/internal/VelbusVirtualColorChannel.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java index 53766584ea51a..4b7ff047f701c 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java @@ -100,10 +100,7 @@ public boolean isVirtualColorChannel(int channel) { public boolean isColorChannel(int channel) { byte c = getByteValue(channel); - if (c == redChannel || c == greenChannel || c == blueChannel) { - return true; - } - return false; + return c == redChannel || c == greenChannel || c == blueChannel; } public boolean isWhiteChannel(int channel) { From 0d29715e9550e528512ae843bb7862c0ef4e03f2 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Thu, 5 Oct 2023 08:57:42 +0200 Subject: [PATCH 13/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java Co-authored-by: Simonas Kazlauskas Signed-off-by: Daniel Rosengarten --- .../binding/velbus/internal/VelbusVirtualColorChannel.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java index 4b7ff047f701c..dfb212ddd209b 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java @@ -106,10 +106,7 @@ public boolean isColorChannel(int channel) { public boolean isWhiteChannel(int channel) { byte c = getByteValue(channel); - if (c == whiteChannel) { - return true; - } - return false; + return c == whiteChannel; } public boolean isRGBConfigured() { From 6f1d1d190fb51643b6089f901e10ea32e2cce138 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Thu, 5 Oct 2023 15:37:30 +0200 Subject: [PATCH 14/28] [velbus] colors channels & disposed handlers * VelbusVirtualColorChannel class Permits different values (CH0 or A0) to configure the virtual light's channels. * VelbusColorChannel class Makes color transformation easy with the rescale function. * onPacketReceived interface Stops processing packets when handler is disposed. Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 6 +- .../internal/VelbusBindingConstants.java | 1 + .../velbus/internal/VelbusColorChannel.java | 66 +++++++++++----- .../velbus/internal/VelbusPacketListener.java | 3 +- .../internal/VelbusVirtualColorChannel.java | 60 ++++++++------- .../VelbusThingDiscoveryService.java | 4 +- .../internal/handler/VelbusBlindsHandler.java | 26 ++----- .../internal/handler/VelbusDimmerHandler.java | 20 ++--- .../internal/handler/VelbusRelayHandler.java | 26 ++----- .../handler/VelbusRelayWithInputHandler.java | 26 ++----- .../internal/handler/VelbusSensorHandler.java | 24 ++---- .../VelbusSensorWithAlarmClockHandler.java | 22 ++---- .../VelbusTemperatureSensorHandler.java | 17 ++--- .../handler/VelbusThermostatHandler.java | 26 ++----- .../internal/handler/VelbusThingHandler.java | 20 +++++ .../internal/handler/VelbusVMB4ANHandler.java | 17 ++--- .../internal/handler/VelbusVMB7INHandler.java | 17 ++--- .../handler/VelbusVMBDALIHandler.java | 17 ++--- .../internal/handler/VelbusVMBELHandler.java | 26 ++----- .../internal/handler/VelbusVMBELOHandler.java | 26 ++----- .../internal/handler/VelbusVMBGPOHandler.java | 28 ++----- .../handler/VelbusVMBMeteoHandler.java | 28 ++----- .../handler/VelbusVMBPIROHandler.java | 28 ++----- .../main/resources/OH-INF/config/config.xml | 75 +++++++++++-------- .../resources/OH-INF/i18n/velbus.properties | 60 +++++++-------- 25 files changed, 268 insertions(+), 401 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index fe95dfd6d6b98..a0b54ecf7fd97 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -158,7 +158,8 @@ vmb1dm, vmb1led, vmb4dc, vmbdme, vmbdmi, vmbdmir ``` The `vmbdali` thing has 16 virtual light channels. A virtual light combines 3 or 4 VMBDALI module channels into an OpenHAB channel to control RGB or RGBW lights. -This is because an RGBW DALI light is configured on the VMBDALI module with 4 channels (Red channel, Green channel, Blue channel, White channel). +This is because an RGBW DALI light is configured on the VMBDALI module with 4 channels (Red channel, Green channel, Blue channel, White channel). +The channels of the virtual light can be identified by a module channel `CH1` ... `CH64` or a DALI address `A0` ... `A63`. The configuration is set like this: @@ -169,9 +170,8 @@ The white channel is optional. e.g.: ```java -Thing velbus:vmbdali:: [VL1="CH1,CH2,CH3,CH4", VL2="CH6,CH7,CH5"] +Thing velbus:vmbdali:1:01 [VL1="CH1,CH2,CH3,CH4", VL2="A4,A5,A6"] ``` -In the UI, the virtual light settings are in the advanced configuration of the VMBDALI module. ## Channels diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java index 76766329eea34..8aee830b19e14 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java @@ -243,6 +243,7 @@ public class VelbusBindingConstants { public static final String MODULE_MEMORY_MAP_VERSION = "memory map version"; public static final String MODULE_BUILD = "build"; public static final String CHANNEL = "CH"; + public static final String DALI_ADDRESS = "A"; public static final String VIRTUAL_LIGHT = "VL"; public static final String SUB_ADDRESS = "subaddress"; public static final String DIMSPEED = "dimspeed"; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java index b95b8fa4762d0..4fbc951e2f84e 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java @@ -51,7 +51,7 @@ public void setBrightness(int brightness) { * @param brightnessState the brightness to set */ public void setBrightness(PercentType brightnessState) { - this.brightness = brightnessState.intValue(); + setBrightness(brightnessState.intValue()); } /** @@ -66,8 +66,8 @@ public void setBrightness(HSBType brightnessState) { */ public void setBrightness(byte brightness) { if (brightness != VALUE_UNCHANGED) { - this.brightness = (Byte.toUnsignedInt(brightness) * BRIGHTNESS_MAX_VALUE) - / Byte.toUnsignedInt(DALI_MAX_VALUE); + this.brightness = convertFromVelbus(Byte.toUnsignedInt(brightness), Byte.toUnsignedInt(DALI_MAX_VALUE), + BRIGHTNESS_MAX_VALUE); } } @@ -89,9 +89,7 @@ public PercentType getBrightnessPercent() { * @return the brightness for velbus packet */ public byte getBrightnessVelbus() { - return (this.brightness == BRIGHTNESS_MAX_VALUE) ? DALI_MAX_VALUE - : Integer.valueOf((this.brightness * Byte.toUnsignedInt(DALI_MAX_VALUE)) / BRIGHTNESS_MAX_VALUE) - .byteValue(); + return convertToVelbus(this.brightness, BRIGHTNESS_MAX_VALUE, Byte.toUnsignedInt(DALI_MAX_VALUE)); } /** @@ -112,7 +110,7 @@ public void setColor(int[] rgb) { * @param hsbState the color to set in HSB */ public void setColor(HSBType hsbState) { - this.color = ColorUtil.hsbToRgb(hsbState); + setColor(ColorUtil.hsbToRgb(hsbState)); } /** @@ -137,7 +135,7 @@ public void setColor(byte[] rgb) { */ public void setRedColor(byte red) { if (red != VALUE_UNCHANGED) { - this.color[0] = (red == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(red); + this.color[0] = convertFromVelbus(Byte.toUnsignedInt(red), DALI_MAX_VALUE, COLOR_MAX_VALUE); } } @@ -146,7 +144,7 @@ public void setRedColor(byte red) { */ public void setGreenColor(byte green) { if (green != VALUE_UNCHANGED) { - this.color[1] = (green == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(green); + this.color[1] = convertFromVelbus(Byte.toUnsignedInt(green), DALI_MAX_VALUE, COLOR_MAX_VALUE); } } @@ -155,7 +153,7 @@ public void setGreenColor(byte green) { */ public void setBlueColor(byte blue) { if (blue != VALUE_UNCHANGED) { - this.color[2] = (blue == DALI_MAX_VALUE) ? COLOR_MAX_VALUE : Byte.toUnsignedInt(blue); + this.color[2] = convertFromVelbus(Byte.toUnsignedInt(blue), DALI_MAX_VALUE, COLOR_MAX_VALUE); } } @@ -179,9 +177,10 @@ public HSBType getColorHSB() { public byte[] getColorVelbus() { byte[] rgb = { VALUE_UNCHANGED, VALUE_UNCHANGED, VALUE_UNCHANGED }; - rgb[0] = (this.color[0] == COLOR_MAX_VALUE) ? DALI_MAX_VALUE : Integer.valueOf(this.color[0]).byteValue(); - rgb[1] = (this.color[1] == COLOR_MAX_VALUE) ? DALI_MAX_VALUE : Integer.valueOf(this.color[1]).byteValue(); - rgb[2] = (this.color[2] == COLOR_MAX_VALUE) ? DALI_MAX_VALUE : Integer.valueOf(this.color[2]).byteValue(); + rgb[0] = convertToVelbus(this.color[0], COLOR_MAX_VALUE, DALI_MAX_VALUE); + rgb[1] = convertToVelbus(this.color[1], COLOR_MAX_VALUE, DALI_MAX_VALUE); + rgb[2] = convertToVelbus(this.color[2], COLOR_MAX_VALUE, DALI_MAX_VALUE); + return rgb; } @@ -190,14 +189,14 @@ public byte[] getColorVelbus() { */ public void setWhite(int white) { this.white = (white < WHITE_MIN_VALUE) ? WHITE_MIN_VALUE : white; - this.white = (white < WHITE_MAX_VALUE) ? WHITE_MAX_VALUE : white; + this.white = (white > WHITE_MAX_VALUE) ? WHITE_MAX_VALUE : white; } /** * @param whiteState the white to set */ public void setWhite(PercentType whiteState) { - this.white = whiteState.intValue(); + setWhite(whiteState.intValue()); } /** @@ -205,7 +204,8 @@ public void setWhite(PercentType whiteState) { */ public void setWhite(byte white) { if (white != VALUE_UNCHANGED) { - this.white = (Byte.toUnsignedInt(white) * WHITE_MAX_VALUE) / Byte.toUnsignedInt(DALI_MAX_VALUE); + this.white = convertFromVelbus(Byte.toUnsignedInt(white), Byte.toUnsignedInt(DALI_MAX_VALUE), + WHITE_MAX_VALUE); } } @@ -227,7 +227,37 @@ public PercentType getWhitePercent() { * @return the white value for velbus packet */ public byte getWhiteVelbus() { - return (this.white == WHITE_MAX_VALUE) ? DALI_MAX_VALUE - : Integer.valueOf((this.white * Byte.toUnsignedInt(DALI_MAX_VALUE)) / WHITE_MAX_VALUE).byteValue(); + return convertToVelbus(this.white, WHITE_MAX_VALUE, Byte.toUnsignedInt(DALI_MAX_VALUE)); + } + + /** + * @param value the value to rescale + * @param from_max the maximum value of the first parameter + * @param to_max the maximum value supported by the returned value + * @return the value rescaled + */ + private int rescale(int value, int from_max, int to_max) { + return value * to_max / from_max; + } + + /** + * @param value the value to convert + * @param from_max the maximum value of the first parameter + * @param to_max the maximum value supported by the Velbus module + * @return the value rescaled for the velbus packet + */ + private byte convertToVelbus(int value, int from_max, int to_max) { + return (value >= from_max) ? Integer.valueOf(to_max).byteValue() + : Integer.valueOf(rescale(value, from_max, to_max)).byteValue(); + } + + /** + * @param value the value to convert + * @param from_max the maximum value supported by the Velbus module + * @param to_max the maximum value supported by the returned value + * @return the value rescaled from the packet + */ + private int convertFromVelbus(int value, int from_max, int to_max) { + return (value >= from_max) ? to_max : rescale(value, from_max, to_max); } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java index 8dc1100a4bff9..4a9ec83793eff 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java @@ -26,6 +26,7 @@ public interface VelbusPacketListener { * This method is called whenever the state of the given relay has changed. * * @param packet The bytes of the received packet. + * @return false if handler is disposed, otherwise true. */ - void onPacketReceived(byte[] packet); + boolean onPacketReceived(byte[] packet); } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java index dfb212ddd209b..4e9c88873793f 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java @@ -12,6 +12,8 @@ */ package org.openhab.binding.velbus.internal; +import static org.openhab.binding.velbus.internal.VelbusBindingConstants.*; + import java.util.InvalidPropertiesFormatException; import org.eclipse.jdt.annotation.NonNullByDefault; @@ -44,31 +46,43 @@ public VelbusVirtualColorChannel(int r, int g, int b, int w) { whiteChannel = getByteValue(w); } - public VelbusVirtualColorChannel(String r, String g, String b, String w) throws NumberFormatException { - redChannel = getByteValue(r); - greenChannel = getByteValue(g); - blueChannel = getByteValue(b); - whiteChannel = getByteValue(w); + public VelbusVirtualColorChannel(String r, String g, String b, String w) + throws InvalidPropertiesFormatException, NumberFormatException { + String virtualChannel[] = r.split("^\\s*([a-zA-Z]*)(\\d+)?\\s*$"); + redChannel = getChannelNumber(virtualChannel[0], virtualChannel[1]); + virtualChannel = g.split("^\\s*([a-zA-Z]*)(\\d+)?\\s*$"); + greenChannel = getChannelNumber(virtualChannel[0], virtualChannel[1]); + virtualChannel = b.split("^\\s*([a-zA-Z]*)(\\d+)?\\s*$"); + blueChannel = getChannelNumber(virtualChannel[0], virtualChannel[1]); + virtualChannel = w.split("^\\s*([a-zA-Z]*)(\\d+)?\\s*$"); + whiteChannel = getChannelNumber(virtualChannel[0], virtualChannel[1]); } public VelbusVirtualColorChannel(String rgbw) throws InvalidPropertiesFormatException, NumberFormatException { - String virtualChannels[] = rgbw.split("\\s*,\\s*"); - if (virtualChannels.length == 4) { - redChannel = getByteValue(virtualChannels[0]); - greenChannel = getByteValue(virtualChannels[1]); - blueChannel = getByteValue(virtualChannels[2]); - whiteChannel = getByteValue(virtualChannels[3]); - } else if (virtualChannels.length == 3) { - redChannel = getByteValue(virtualChannels[0]); - greenChannel = getByteValue(virtualChannels[1]); - blueChannel = getByteValue(virtualChannels[2]); + String virtualChannels[] = rgbw.split( + "/^\\s*([a-zA-Z]*)(\\d+)\\s*,\\s*([a-zA-Z]*)(\\d+)\\s*,\\s*([a-zA-Z]*)(\\d+)(?:\\s*,\\s*([a-zA-Z]*)(\\d+))?\\s*$/gm"); + if (virtualChannels.length == 8) { + redChannel = getChannelNumber(virtualChannels[0], virtualChannels[1]); + greenChannel = getChannelNumber(virtualChannels[2], virtualChannels[3]); + blueChannel = getChannelNumber(virtualChannels[4], virtualChannels[5]); + whiteChannel = getChannelNumber(virtualChannels[6], virtualChannels[7]); + } else if (virtualChannels.length == 6) { + redChannel = getChannelNumber(virtualChannels[0], virtualChannels[1]); + greenChannel = getChannelNumber(virtualChannels[2], virtualChannels[3]); + blueChannel = getChannelNumber(virtualChannels[4], virtualChannels[5]); } else { - throw new InvalidPropertiesFormatException("Wrong format"); + throw new InvalidPropertiesFormatException("Wrong number of channels, must be 3 or 4."); } } - private byte getByteValue(String channel) { - return Integer.valueOf(channel.substring(2)).byteValue(); + private byte getChannelNumber(String type, String number) + throws InvalidPropertiesFormatException, NumberFormatException { + if (DALI_ADDRESS.equals(type.toUpperCase())) { + return Integer.valueOf(Integer.valueOf(number) + 1).byteValue(); + } else if (CHANNEL.equals(type.toUpperCase())) { + return Integer.valueOf(number).byteValue(); + } + throw new InvalidPropertiesFormatException("Wrong channel type identifier, must be CH or A."); } private byte getByteValue(int channel) { @@ -110,17 +124,11 @@ public boolean isWhiteChannel(int channel) { } public boolean isRGBConfigured() { - if (redChannel != NOT_CONFIGURED && greenChannel != NOT_CONFIGURED && blueChannel != NOT_CONFIGURED) { - return true; - } - return false; + return redChannel != NOT_CONFIGURED && greenChannel != NOT_CONFIGURED && blueChannel != NOT_CONFIGURED; } public boolean isWhiteConfigured() { - if (whiteChannel != NOT_CONFIGURED) { - return true; - } - return false; + return whiteChannel != NOT_CONFIGURED; } public int getRedColor() { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java index ce936051c5195..85f72056a279e 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java @@ -85,7 +85,7 @@ protected void startScan() { } @Override - public void onPacketReceived(byte[] packet) { + public boolean onPacketReceived(byte[] packet) { if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte address = packet[2]; byte length = packet[3]; @@ -108,8 +108,10 @@ public void onPacketReceived(byte[] packet) { } else { logger.debug("Unknown command '{}' to address '{}'.", String.format("%02X", command), String.format("%02X", address)); + return false; } } + return true; } private void handleModuleTypeCommand(byte[] packet, byte address) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java index e8ef923049e23..382f0c8cad0eb 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java @@ -51,26 +51,10 @@ public class VelbusBlindsHandler extends VelbusThingHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(THING_TYPE_VMB1BL, THING_TYPE_VMB1BLS, THING_TYPE_VMB2BL, THING_TYPE_VMB2BLE)); - private volatile boolean disposed = true; - public VelbusBlindsHandler(Thing thing) { super(thing, 0); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); @@ -144,13 +128,11 @@ private Boolean isFirstGenerationDevice() { } @Override - public void onPacketReceived(byte[] packet) { - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -164,5 +146,7 @@ public void onPacketReceived(byte[] packet) { updateState(getModuleAddress().getChannelId(velbusChannelIdentifier), state); } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java index 5b72fb64d0bb8..7acd0dd5d4902 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java @@ -45,8 +45,6 @@ public class VelbusDimmerHandler extends VelbusThingHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB1DM, THING_TYPE_VMB1LED, THING_TYPE_VMB4DC, THING_TYPE_VMBDME, THING_TYPE_VMBDMI, THING_TYPE_VMBDMIR)); - private volatile boolean disposed = true; - private @NonNullByDefault({}) VelbusDimmerConfig dimmerConfig; public VelbusDimmerHandler(Thing thing) { @@ -58,14 +56,6 @@ public void initialize() { this.dimmerConfig = getConfigAs(VelbusDimmerConfig.class); super.initialize(); - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; } @Override @@ -114,13 +104,11 @@ private Boolean isFirstGenerationDevice() { } @Override - public void onPacketReceived(byte[] packet) { - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte address = packet[2]; byte command = packet[4]; @@ -140,5 +128,7 @@ public void onPacketReceived(byte[] packet) { updateState(getModuleAddress().getChannelId(velbusChannelIdentifier), state); } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java index 0dc73980cfccc..71f2c63388441 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java @@ -43,26 +43,10 @@ public class VelbusRelayHandler extends VelbusThingHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB1RY, THING_TYPE_VMB1RYNO, THING_TYPE_VMB1RYNOS, THING_TYPE_VMB4RY, THING_TYPE_VMB4RYLD, THING_TYPE_VMB4RYNO)); - private volatile boolean disposed = true; - public VelbusRelayHandler(Thing thing) { super(thing, 0); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); @@ -95,13 +79,11 @@ private byte determineCommandByte(OnOffType command) { } @Override - public void onPacketReceived(byte[] packet) { - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -115,5 +97,7 @@ public void onPacketReceived(byte[] packet) { updateState(getModuleAddress().getChannelId(velbusChannelIdentifier), state); } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayWithInputHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayWithInputHandler.java index dadeaa0c4e484..a9256f3504841 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayWithInputHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayWithInputHandler.java @@ -44,26 +44,10 @@ public class VelbusRelayWithInputHandler extends VelbusRelayHandler { private static final StringType PRESSED = new StringType("PRESSED"); private static final StringType LONG_PRESSED = new StringType("LONG_PRESSED"); - private volatile boolean disposed = true; - public VelbusRelayWithInputHandler(Thing thing) { super(thing); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -109,11 +93,9 @@ private boolean isTriggerChannel(byte address, byte channel) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { @@ -138,5 +120,7 @@ public void onPacketReceived(byte[] packet) { } } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java index 5c7337e900d81..037726b6f2ba6 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java @@ -44,8 +44,6 @@ public class VelbusSensorHandler extends VelbusThingHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(THING_TYPE_VMB6IN, THING_TYPE_VMB8IR, THING_TYPE_VMB8PB)); - private volatile boolean disposed = true; - private static final StringType SET_LED = new StringType("SET_LED"); private static final StringType SLOW_BLINK_LED = new StringType("SLOW_BLINK_LED"); private static final StringType FAST_BLINK_LED = new StringType("FAST_BLINK_LED"); @@ -63,20 +61,6 @@ public VelbusSensorHandler(Thing thing, int numberOfSubAddresses) { super(thing, numberOfSubAddresses); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { VelbusBridgeHandler velbusBridgeHandler = getVelbusBridgeHandler(); @@ -145,9 +129,9 @@ private boolean isButtonChannel(ChannelUID channelUID) { } @Override - public void onPacketReceived(byte[] packet) { - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } logger.trace("onPacketReceived() was called"); @@ -189,5 +173,7 @@ public void onPacketReceived(byte[] packet) { } } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java index 4fcd67244d90b..581026d7364e2 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java @@ -122,8 +122,6 @@ public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler { private int clockAlarmConfigurationMemoryAddress; private VelbusClockAlarmConfiguration alarmClockConfiguration = new VelbusClockAlarmConfiguration(); - private volatile boolean disposed = true; - private long lastUpdateAlarm1TimeMillis; private long lastUpdateAlarm2TimeMillis; @@ -143,14 +141,6 @@ public void initialize() { this.clockAlarmConfigurationMemoryAddress = ALARM_CONFIGURATION_MEMORY_ADDRESSES .get(thing.getThingTypeUID()); } - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; } @Override @@ -271,15 +261,11 @@ public synchronized void sendAlarmPacket(int alarmNumber, byte[] packetBytes) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -322,6 +308,8 @@ public void onPacketReceived(byte[] packet) { } } } + + return true; } public Boolean isClockAlarmConfigurationByte(int memoryAddress) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java index f6f8fb18d06aa..7d5ace30f6d33 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java @@ -41,8 +41,6 @@ */ @NonNullByDefault public abstract class VelbusTemperatureSensorHandler extends VelbusSensorWithAlarmClockHandler { - private volatile boolean disposed = true; - private @Nullable ScheduledFuture refreshJob; private @NonNullByDefault({}) VelbusSensorConfig sensorConfig; private ChannelUID temperatureChannel; @@ -60,7 +58,6 @@ public void initialize() { super.initialize(); initializeAutomaticRefresh(); - disposed = false; } private void initializeAutomaticRefresh() { @@ -78,8 +75,6 @@ public void dispose() { refreshJob.cancel(true); } super.dispose(); - - disposed = true; } private void startAutomaticRefresh(int refreshInterval) { @@ -120,15 +115,11 @@ protected void sendSensorReadoutRequest(VelbusBridgeHandler velbusBridgeHandler) } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -143,5 +134,7 @@ public void onPacketReceived(byte[] packet) { updateState(temperatureChannel, state); } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java index 9eeb733a685ad..5cbc0f9043092 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java @@ -41,8 +41,6 @@ */ @NonNullByDefault public abstract class VelbusThermostatHandler extends VelbusTemperatureSensorHandler { - private volatile boolean disposed = true; - private static final double THERMOSTAT_TEMPERATURE_SETPOINT_RESOLUTION = 0.5; private static final StringType OPERATING_MODE_HEATING = new StringType("HEATING"); @@ -104,20 +102,6 @@ public VelbusThermostatHandler(Thing thing, int numberOfSubAddresses, ChannelUID super(thing, numberOfSubAddresses, temperatureChannel); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -181,11 +165,9 @@ public void handleCommand(ChannelUID channelUID, Command command) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } logger.trace("onPacketReceived() was called"); @@ -300,6 +282,8 @@ public void onPacketReceived(byte[] packet) { } } + + return true; } private void triggerThermostatChannels(byte outputChannels, String event) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java index 8e64a2fbac0c2..79efab31daad7 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java @@ -60,6 +60,8 @@ public abstract class VelbusThingHandler extends BaseThingHandler implements Vel private int numberOfSubAddresses; + private volatile boolean disposed = true; + public VelbusThingHandler(Thing thing, int numberOfSubAddresses) { super(thing); @@ -76,6 +78,14 @@ public void initialize() { initializeThing(bridge == null ? ThingStatus.OFFLINE : bridge.getStatus()); initializeChannelNames(); initializeChannelStates(); + disposed = false; + } + + @Override + public void dispose() { + super.dispose(); + + disposed = true; } @Override @@ -244,4 +254,14 @@ protected void sendWriteMemoryPacket(VelbusBridgeHandler velbusBridgeHandler, in return this.velbusBridgeHandler; } + + @Override + public boolean onPacketReceived(byte[] packet) { + logger.trace("onPacketReceived() was called"); + + if (disposed) { + return false; + } + return true; + } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java index f29a717196afb..2d1de05961c20 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java @@ -51,8 +51,6 @@ public class VelbusVMB4ANHandler extends VelbusSensorWithAlarmClockHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB4AN)); - private volatile boolean disposed = true; - private static final String ALARM_GROUP = "alarm"; private static final String ANALOG_INPUT_GROUP = "analogInput"; private static final String ANALOG_OUTPUT_GROUP = "analogOutput"; @@ -79,7 +77,6 @@ public void initialize() { super.initialize(); initializeAutomaticRefresh(); - disposed = false; } private void initializeAutomaticRefresh() { @@ -97,8 +94,6 @@ public void dispose() { refreshJob.cancel(true); } super.dispose(); - - disposed = true; } private void startAutomaticRefresh(int refreshInterval) { @@ -149,15 +144,11 @@ protected void sendSensorReadoutRequest(VelbusBridgeHandler velbusBridgeHandler, } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -220,6 +211,8 @@ public void onPacketReceived(byte[] packet) { updateState(channelUID, new StringType(channelText[channel - 9])); } } + + return true; } protected byte convertChannelUIDToChannelByte(ChannelUID channelUID) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB7INHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB7INHandler.java index c526ee819d6f9..e4727d26d5093 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB7INHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB7INHandler.java @@ -45,8 +45,6 @@ public class VelbusVMB7INHandler extends VelbusSensorWithAlarmClockHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB7IN)); - private volatile boolean disposed = true; - private final ChannelUID counter1Channel = new ChannelUID(thing.getUID(), "counter", "counter1"); private final ChannelUID counter1ChannelCurrent = new ChannelUID(thing.getUID(), "counter", "counter1Current"); private final ChannelUID counter2Channel = new ChannelUID(thing.getUID(), "counter", "counter2"); @@ -71,7 +69,6 @@ public void initialize() { super.initialize(); initializeAutomaticRefresh(); - disposed = false; } private void initializeAutomaticRefresh() { @@ -89,8 +86,6 @@ public void dispose() { refreshJob.cancel(true); } super.dispose(); - - disposed = true; } private void startAutomaticRefresh(int refreshInterval) { @@ -137,15 +132,11 @@ protected void sendCounterStatusRequest(VelbusBridgeHandler velbusBridgeHandler, } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -185,5 +176,7 @@ public void onPacketReceived(byte[] packet) { } } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java index dde9e1243a7d8..a9efdab334bf2 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -52,7 +52,6 @@ public class VelbusVMBDALIHandler extends VelbusSensorWithAlarmClockHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBDALI)); private @Nullable ScheduledFuture refreshJob; private @NonNullByDefault({}) VelbusSensorConfig sensorConfig; - private volatile boolean disposed = true; private VelbusColorChannel[] colorChannels; private VelbusVirtualColorChannel[] virtualColorChannels; @@ -73,7 +72,6 @@ public void initialize() { initializeAutomaticRefresh(); initializeColorChannel(); initializeVirtualLight(); - disposed = false; initializeChannelStates(); } @@ -101,8 +99,8 @@ private void initializeVirtualLight() { try { virtualColorChannels[i - 1] = new VelbusVirtualColorChannel(virtualLight); } catch (Exception e) { - logger.error("VMBDALI on address {} : Virtual Light {} has wrong channel format '{}' ", - getModuleAddress().getAddress(), i, virtualLight); + logger.error("VMBDALI on address {} : Virtual Light {} has wrong channel format '{}'. {}", + getModuleAddress().getAddress(), i, virtualLight, e.getMessage()); } } } @@ -128,7 +126,6 @@ public void dispose() { if (refreshJob != null) { refreshJob.cancel(true); } - disposed = true; } private void startAutomaticRefresh(int refreshInterval) { @@ -280,11 +277,9 @@ private boolean isVirtualLightChannel(ChannelUID channelUID) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } if (packet[0] == VelbusPacket.STX && packet.length >= 7) { @@ -380,6 +375,8 @@ public void onPacketReceived(byte[] packet) { } } } + + return true; } private void updateVirtualLightState(int channel, byte dimVal) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java index 1b4ad489a63db..72996c2e8b1ea 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java @@ -43,28 +43,12 @@ public class VelbusVMBELHandler extends VelbusThermostatHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(THING_TYPE_VMBEL1, THING_TYPE_VMBEL2, THING_TYPE_VMBEL4, THING_TYPE_VMBELPIR)); - private volatile boolean disposed = true; - private final ChannelUID outputChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_OUTPUT, CHANNEL_OUTPUT); public VelbusVMBELHandler(Thing thing) { super(thing, 4, new ChannelUID(thing.getUID(), CHANNEL_GROUP_INPUT, "CH9")); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -97,11 +81,9 @@ private byte determineCommandByte(OnOffType command) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { @@ -114,5 +96,7 @@ public void onPacketReceived(byte[] packet) { updateState(outputChannel, state); } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java index b51c881216b48..95dcdac835e25 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java @@ -42,28 +42,12 @@ public class VelbusVMBELOHandler extends VelbusMemoHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBELO)); - private volatile boolean disposed = true; - private final ChannelUID outputChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_OUTPUT, CHANNEL_OUTPUT); public VelbusVMBELOHandler(Thing thing) { super(thing); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -96,11 +80,9 @@ private byte determineCommandByte(OnOffType command) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { @@ -113,5 +95,7 @@ public void onPacketReceived(byte[] packet) { updateState(outputChannel, state); } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java index cabda4902db4a..dff6de6d3bebd 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java @@ -40,8 +40,6 @@ public class VelbusVMBGPOHandler extends VelbusMemoHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(THING_TYPE_VMBGPO, THING_TYPE_VMBGPOD, THING_TYPE_VMBGPOD_2)); - private volatile boolean disposed = true; - public static final int MODULESETTINGS_MEMORY_ADDRESS = 0x02F0; public static final int LAST_MEMORY_LOCATION_ADDRESS = 0x1A03; @@ -53,20 +51,6 @@ public VelbusVMBGPOHandler(Thing thing) { super(thing); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -90,15 +74,11 @@ public void handleCommand(ChannelUID channelUID, Command command) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -121,5 +101,7 @@ public void onPacketReceived(byte[] packet) { } } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBMeteoHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBMeteoHandler.java index 857e851de1491..0d09dad7607d9 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBMeteoHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBMeteoHandler.java @@ -45,8 +45,6 @@ public class VelbusVMBMeteoHandler extends VelbusTemperatureSensorHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBMETEO)); - private volatile boolean disposed = true; - private static final byte RAIN_SENSOR_CHANNEL = 0x02; private static final byte LIGHT_SENSOR_CHANNEL = 0x04; private static final byte WIND_SENSOR_CHANNEL = 0x08; @@ -64,20 +62,6 @@ public VelbusVMBMeteoHandler(Thing thing) { this.windspeedChannel = new ChannelUID(thing.getUID(), "weatherStation", "CH13"); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -120,15 +104,11 @@ protected int getClockAlarmAndProgramSelectionIndexInModuleStatus() { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -153,5 +133,7 @@ public void onPacketReceived(byte[] packet) { updateState(windspeedChannel, windValueState); } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java index e126f843f6014..dcf0d6abd49cb 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java @@ -43,8 +43,6 @@ public class VelbusVMBPIROHandler extends VelbusTemperatureSensorHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBPIRO)); - private volatile boolean disposed = true; - private ChannelUID illuminanceChannel; public VelbusVMBPIROHandler(Thing thing) { @@ -53,20 +51,6 @@ public VelbusVMBPIROHandler(Thing thing) { this.illuminanceChannel = new ChannelUID(thing.getUID(), "input", "LIGHT"); } - @Override - public void initialize() { - super.initialize(); - - disposed = false; - } - - @Override - public void dispose() { - super.dispose(); - - disposed = true; - } - @Override public void handleCommand(ChannelUID channelUID, Command command) { super.handleCommand(channelUID, command); @@ -89,15 +73,11 @@ public void handleCommand(ChannelUID channelUID, Command command) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - if (disposed) { - return; + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; } - logger.trace("onPacketReceived() was called"); - if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -110,5 +90,7 @@ public void onPacketReceived(byte[] packet) { updateState(illuminanceChannel, lightValueState); } } + + return true; } } diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml index 33ee57425591c..53670bfa89470 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/config/config.xml @@ -531,8 +531,9 @@ The velbus address of the device - - The velbus sub-address of the device (FF = disabled) + + The velbus sub-address of the device (FF = disabled). In the VelbusLink application it's identified by + Sensor or Thermostat. FF @@ -696,23 +697,27 @@ The velbus address of the device - - The velbus sub-address 1 of the device (FF = disabled) + + The velbus sub-address 1 of the device (FF = disabled). In the VelbusLink application it's identified by + Page 3-4 or Pushbuttons 9-16. FF - - The velbus sub-address 2 of the device (FF = disabled) + + The velbus sub-address 2 of the device (FF = disabled). In the VelbusLink application it's identified by + Page 5-6 or Pushbuttons 17-24. FF - - The velbus sub-address 3 of the device (FF = disabled) + + The velbus sub-address 3 of the device (FF = disabled). In the VelbusLink application it's identified by + Page 7-8 or Pushbuttons 25-32. FF - - The velbus sub-address 4 of the device (FF = disabled) + + The velbus sub-address 4 of the device (FF = disabled). In the VelbusLink application it's identified by + Sensor or Thermostat. FF @@ -924,52 +929,62 @@ - - The velbus address of the device + + The velbus address of the device. In the VelbusLink application it's identified by DALI Address A0..A7 + or Channel CH1..CH8. - - The velbus sub-address 1 of the device (FF = disabled) + + The velbus sub-address 1 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Address A8..A15 or Channel CH9..CH16. FF - - The velbus sub-address 2 of the device (FF = disabled) + + The velbus sub-address 2 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Address A16..A23 or Channel CH17..CH24. FF - - The velbus sub-address 3 of the device (FF = disabled) + + The velbus sub-address 3 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Address A24..A31 or Channel CH25..CH32. FF - - The velbus sub-address 4 of the device (FF = disabled) + + The velbus sub-address 4 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Address A32..A39 or Channel CH33..CH40. FF - - The velbus sub-address 5 of the device (FF = disabled) + + The velbus sub-address 5 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Address A40..A47 or Channel CH41..CH48. FF - - The velbus sub-address 6 of the device (FF = disabled) + + The velbus sub-address 6 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Address A48..A55 or Channel CH49..CH56. FF - - The velbus sub-address 7 of the device (FF = disabled) + + The velbus sub-address 7 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Address A56..A63 or Channel CH57..CH64. FF - - The velbus sub-address 8 of the device (FF = disabled) + + The velbus sub-address 8 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Group G0..G7 or Channel CH65..CH72. FF - - The velbus sub-address 9 of the device (FF = disabled) + + The velbus sub-address 9 of the device (FF = disabled). In the VelbusLink application it's identified by + DALI Group G8..G15 or Channel CH73..CH80. FF diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties index 70087ab298d5d..6dd5f616961c1 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties @@ -246,14 +246,14 @@ thing-type.config.velbus.33channelDeviceWithTemperatureSensor.address.label = Ad thing-type.config.velbus.33channelDeviceWithTemperatureSensor.address.description = The velbus address of the device thing-type.config.velbus.33channelDeviceWithTemperatureSensor.refresh.label = Refresh Interval thing-type.config.velbus.33channelDeviceWithTemperatureSensor.refresh.description = Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. -thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress1.label = Page 3-4 Address -thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress1.description = The velbus sub-address 1 of the device (FF = disabled) -thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress2.label = Page 5-6 Address -thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress2.description = The velbus sub-address 2 of the device (FF = disabled) -thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress3.label = Page 7-8 Address -thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress3.description = The velbus sub-address 3 of the device (FF = disabled) -thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress4.label = Sensor Address -thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress4.description = The velbus sub-address 4 of the device (FF = disabled) +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress1.label = Channel CH9..CH16 Address +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress1.description = The velbus sub-address 1 of the device (FF = disabled). In the VelbusLink application it's identified by Page 3-4 or Pushbuttons 9-16. +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress2.label = Channel CH17..CH24 Address +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress2.description = The velbus sub-address 2 of the device (FF = disabled). In the VelbusLink application it's identified by Page 5-6 or Pushbuttons 17-24. +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress3.label = Channel CH25..CH32 Address +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress3.description = The velbus sub-address 3 of the device (FF = disabled). In the VelbusLink application it's identified by Page 7-8 or Pushbuttons 25-32. +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress4.label = Channel CH33 Address +thing-type.config.velbus.33channelDeviceWithTemperatureSensor.subaddress4.description = The velbus sub-address 4 of the device (FF = disabled). In the VelbusLink application it's identified by Sensor or Thermostat. thing-type.config.velbus.4channelDevice.CH1.label = CH1 Name thing-type.config.velbus.4channelDevice.CH1.description = The name of CH1. thing-type.config.velbus.4channelDevice.CH2.label = CH2 Name @@ -576,28 +576,28 @@ thing-type.config.velbus.81channelDevice.VL8.label = Virtual Light 8 thing-type.config.velbus.81channelDevice.VL8.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH29,CH30,CH31,CH32) thing-type.config.velbus.81channelDevice.VL9.label = Virtual Light 9 thing-type.config.velbus.81channelDevice.VL9.description = Create a virtual color light from 3 or 4 channels. Format: Red_channel,Green_channel,Blue_channel,White_channel. White_channel is optionnal. From CH1 to CH64. (e.g. CH33,CH34,CH35,CH36) -thing-type.config.velbus.81channelDevice.address.label = Address (Channel A0...7) -thing-type.config.velbus.81channelDevice.address.description = The velbus address of the device +thing-type.config.velbus.81channelDevice.address.label = Address +thing-type.config.velbus.81channelDevice.address.description = The velbus address of the device. In the VelbusLink application it's identified by DALI Address A0..A7 or Channel CH1..CH8. thing-type.config.velbus.81channelDevice.refresh.label = Refresh Interval thing-type.config.velbus.81channelDevice.refresh.description = Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. -thing-type.config.velbus.81channelDevice.subaddress1.label = Channel A8...15 -thing-type.config.velbus.81channelDevice.subaddress1.description = The velbus sub-address 1 of the device (FF = disabled) -thing-type.config.velbus.81channelDevice.subaddress2.label = Channel A16...23 -thing-type.config.velbus.81channelDevice.subaddress2.description = The velbus sub-address 2 of the device (FF = disabled) -thing-type.config.velbus.81channelDevice.subaddress3.label = Channel A24...31 -thing-type.config.velbus.81channelDevice.subaddress3.description = The velbus sub-address 3 of the device (FF = disabled) -thing-type.config.velbus.81channelDevice.subaddress4.label = Channel A32...39 -thing-type.config.velbus.81channelDevice.subaddress4.description = The velbus sub-address 4 of the device (FF = disabled) -thing-type.config.velbus.81channelDevice.subaddress5.label = Channel A40...47 -thing-type.config.velbus.81channelDevice.subaddress5.description = The velbus sub-address 5 of the device (FF = disabled) -thing-type.config.velbus.81channelDevice.subaddress6.label = Channel A48...55 -thing-type.config.velbus.81channelDevice.subaddress6.description = The velbus sub-address 6 of the device (FF = disabled) -thing-type.config.velbus.81channelDevice.subaddress7.label = Channel A56...63 -thing-type.config.velbus.81channelDevice.subaddress7.description = The velbus sub-address 7 of the device (FF = disabled) -thing-type.config.velbus.81channelDevice.subaddress8.label = Group G0...7 -thing-type.config.velbus.81channelDevice.subaddress8.description = The velbus sub-address 8 of the device (FF = disabled) -thing-type.config.velbus.81channelDevice.subaddress9.label = Group G8...15 -thing-type.config.velbus.81channelDevice.subaddress9.description = The velbus sub-address 9 of the device (FF = disabled) +thing-type.config.velbus.81channelDevice.subaddress1.label = Channel CH9..CH16 Address +thing-type.config.velbus.81channelDevice.subaddress1.description = The velbus sub-address 1 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Address A8..A15 or Channel CH9..CH16. +thing-type.config.velbus.81channelDevice.subaddress2.label = Channel CH17..CH24 Address +thing-type.config.velbus.81channelDevice.subaddress2.description = The velbus sub-address 2 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Address A16..A23 or Channel CH17..CH24. +thing-type.config.velbus.81channelDevice.subaddress3.label = Channel CH25..CH32 Address +thing-type.config.velbus.81channelDevice.subaddress3.description = The velbus sub-address 3 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Address A24..A31 or Channel CH25..CH32. +thing-type.config.velbus.81channelDevice.subaddress4.label = Channel CH33..CH40 Address +thing-type.config.velbus.81channelDevice.subaddress4.description = The velbus sub-address 4 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Address A32..A39 or Channel CH33..CH40. +thing-type.config.velbus.81channelDevice.subaddress5.label = Channel CH41..CH48 Address +thing-type.config.velbus.81channelDevice.subaddress5.description = The velbus sub-address 5 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Address A40..A47 or Channel CH41..CH48. +thing-type.config.velbus.81channelDevice.subaddress6.label = Channel CH49..CH56 Address +thing-type.config.velbus.81channelDevice.subaddress6.description = The velbus sub-address 6 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Address A48..A55 or Channel CH49..CH56. +thing-type.config.velbus.81channelDevice.subaddress7.label = Channel CH57..CH64 Address +thing-type.config.velbus.81channelDevice.subaddress7.description = The velbus sub-address 7 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Address A56..A63 or Channel CH57..CH64. +thing-type.config.velbus.81channelDevice.subaddress8.label = Channel CH65..CH72 Address +thing-type.config.velbus.81channelDevice.subaddress8.description = The velbus sub-address 8 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Group G0..G7 or Channel CH65..CH72. +thing-type.config.velbus.81channelDevice.subaddress9.label = Channel CH73..CH80 Address +thing-type.config.velbus.81channelDevice.subaddress9.description = The velbus sub-address 9 of the device (FF = disabled). In the VelbusLink application it's identified by DALI Group G8..G15 or Channel CH73..CH80. thing-type.config.velbus.8channelDevice.CH1.label = CH1 Name thing-type.config.velbus.8channelDevice.CH1.description = The name of CH1. thing-type.config.velbus.8channelDevice.CH2.label = CH2 Name @@ -638,8 +638,8 @@ thing-type.config.velbus.9channelDeviceWithTemperatureSensor.address.label = Add thing-type.config.velbus.9channelDeviceWithTemperatureSensor.address.description = The velbus address of the device thing-type.config.velbus.9channelDeviceWithTemperatureSensor.refresh.label = Refresh Interval thing-type.config.velbus.9channelDeviceWithTemperatureSensor.refresh.description = Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. -thing-type.config.velbus.9channelDeviceWithTemperatureSensor.subaddress1.label = Sensor Address -thing-type.config.velbus.9channelDeviceWithTemperatureSensor.subaddress1.description = The velbus sub-address of the device (FF = disabled) +thing-type.config.velbus.9channelDeviceWithTemperatureSensor.subaddress1.label = Channel CH9 Address +thing-type.config.velbus.9channelDeviceWithTemperatureSensor.subaddress1.description = The velbus sub-address of the device (FF = disabled). In the VelbusLink application it's identified by Sensor or Thermostat. thing-type.config.velbus.temperatureSensorDevice.address.label = Address thing-type.config.velbus.temperatureSensorDevice.address.description = The velbus address of the device thing-type.config.velbus.temperatureSensorDevice.refresh.label = Refresh Interval From 6f5c9e56032b129d9ef9f443d96e29e52a97206f Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Thu, 5 Oct 2023 19:31:32 +0200 Subject: [PATCH 15/28] [velbus] small correction Signed-off-by: Daniel Rosengarten --- .../velbus/internal/discovery/VelbusThingDiscoveryService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java index 85f72056a279e..0b64c6f71484a 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java @@ -108,7 +108,6 @@ public boolean onPacketReceived(byte[] packet) { } else { logger.debug("Unknown command '{}' to address '{}'.", String.format("%02X", command), String.format("%02X", address)); - return false; } } return true; From 1be6169730af87bd66a9686ccf44ea68985248ec Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 19 Nov 2023 11:54:26 +0100 Subject: [PATCH 16/28] [velbus] Add thing upgrade instructions VMBELx Thing upgrade instructions for VMBEL1, VMBEL2, VMBEL4, VMBELO. Signed-off-by: Daniel Rosengarten --- .../resources/OH-INF/thing/thing-types.xml | 15 ++++++++ .../resources/OH-INF/update/instructions.xml | 38 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml index 379074f4d3c99..80aec0ab55ce8 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml @@ -476,6 +476,9 @@ + + 1 + @@ -496,6 +499,9 @@ + + 1 + @@ -516,6 +522,9 @@ + + 1 + @@ -537,6 +546,9 @@ + + 1 + @@ -557,6 +569,9 @@ + + 1 + diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml new file mode 100644 index 0000000000000..99b287fa63212 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml @@ -0,0 +1,38 @@ + + + + + + + switch + + + + + + + + switch + + + + + + + + switch + + + + + + + + switch + + + + + From bac1d9745dd32550a35aa433944cea7466c8f2ee Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 19 Nov 2023 22:58:35 +0100 Subject: [PATCH 17/28] [velbus] Update Readme Update Readme. Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index e486626d745a8..8cacf4bbc92f9 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -57,6 +57,7 @@ xidel -e \ | vmb8ir | Infrared remote control receiver module | | vmb8pb | 8-Channel Push Button module | | vmb8pbu | Push-button interface with 8 channels for universal mounting | +| vmbdali | DALI gateway module | | vmbdme | Dimmer for electronic/resistive load | | vmbdmir | Single channel triac dimmer for resistive and inductive loads | | vmbdmi | Single channel triac dimmer for resistive and inductive loads | From 018b0e262e20bc2df005d29d96294492cbd7c57e Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Thu, 14 Dec 2023 16:42:18 +0100 Subject: [PATCH 18/28] [velbus] Add new modules Add modules : VMB4RYLD-10, VMB4RYNO-10, VMB2BLE-10, VMB6PB-20, VMBEL1-20, VMBEL2-20, VMBEL4-20, VMBELO-20, VMBGP1-20, VMBGP2-20, VMBGP4-20, VMBGPO-20, VMBDALI-20, VMBEL4PIR-20, VMBGP4PIR-20 Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 163 +++++---- .../internal/VelbusBindingConstants.java | 42 ++- .../VelbusThingDiscoveryService.java | 60 ++++ .../internal/handler/VelbusBlindsHandler.java | 4 +- .../internal/handler/VelbusRelayHandler.java | 5 +- .../VelbusSensorWithAlarmClockHandler.java | 16 +- .../handler/VelbusVMBDALIHandler.java | 3 +- .../internal/handler/VelbusVMBELHandler.java | 3 +- .../internal/handler/VelbusVMBELOHandler.java | 3 +- .../internal/handler/VelbusVMBGPHandler.java | 3 +- .../internal/handler/VelbusVMBGPOHandler.java | 2 +- .../resources/OH-INF/i18n/velbus.properties | 32 ++ .../resources/OH-INF/thing/thing-types.xml | 318 ++++++++++++++++++ 13 files changed, 568 insertions(+), 86 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 8cacf4bbc92f9..2c3588827960f 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -31,60 +31,75 @@ xidel -e \ ``` --> -| Type | Description | -|-------------|--------------------------------------------------------------------------------------------| -| vmb1bl | 1-channel blind control module for din rail | -| vmb1bls | 1-channel blind control module for universal mounting | -| vmb1dm | Dimmer module for inductive/resistive and capacitive load | -| vmb1led | 1-channel 0-10V controlled PWM dimmer for led strips | -| vmb1ry | 1-channel relay module | -| vmb1ryno | 1-channel relay module with potential-free changeover contact | -| vmb1rynos | 1-channel relay module with potential-free changeover contact | -| vmb1rys | 1-channel relay module with input | -| vmb1ts | Temperature Sensor Module | -| vmb2bl | 2-channel blind control module | -| vmb2ble | 2-channel blind control module with extended possibilities | -| vmb2pbn | Push-button interface for Niko 1- or 2-fold push-buttons | -| vmb4an | Analog I/O module | -| vmb4dc | 4-channel 0/1-10V dimmer controller | -| vmb4pb | 4 button interface module | -| vmb4ry | 4-channel relay module | -| vmb4ryld | 4-channel relay module with voltage outputs | -| vmb4ryno | 4-channel relay module with potential-free contacts | -| vmb6in | 6-channel input module | -| vmb6pbn | Push-button interface module for Niko 4- or 6-fold push-button | -| vmb7in | 7-channel input module (potentialfree + pulse) | -| vmb8ir | Infrared remote control receiver module | -| vmb8pb | 8-Channel Push Button module | -| vmb8pbu | Push-button interface with 8 channels for universal mounting | -| vmbdali | DALI gateway module | -| vmbdme | Dimmer for electronic/resistive load | -| vmbdmir | Single channel triac dimmer for resistive and inductive loads | -| vmbdmi | Single channel triac dimmer for resistive and inductive loads | -| vmbel1 | Edge-lit one touch button module | -| vmbel2 | Edge-lit two touch buttons module | -| vmbel4 | Edge-lit four touch buttons module | -| vmbelo | Edge-lit touch panel with Oled display | -| vmbelpir | Edge-lit Motion detector with one touch button | -| vmbgp1-2 | Glass control module with 1 touch key (Edition 2) | -| vmbgp1 | Glass control module with 1 touch key | -| vmbgp2-2 | Glass control module with 2 touch keys (Edition 2) | -| vmbgp2 | Glass control module with 2 touch keys | -| vmbgp4-2 | Glass control module with 4 touch keys (Edition 2) | -| vmbgp4 | Glass control module with 4 touch keys | -| vmbgp4pir-2 | Glass control module with 4 touch keys and built-in motion and twilight sensor (Edition 2) | -| vmbgp4pir | Glass control module with 4 touch keys and built-in motion and twilight sensor | -| vmbgpod-2 | Glass control module with oled display and temperature controller (Edition 2) | -| vmbgpod | Glass control module with oled display and temperature controller | -| vmbgpo | Glass control module with oled display | -| vmbin | 1-channel input module | -| vmbkp | Keypad interface module | -| vmbmeteo | Weather station with thermometer, anemometer, rain sensor and light sensor | -| vmbpirc | Motion and twilight sensor for ceiling mounting | -| vmbpirm | Mini motion and twilight sensor for recessed or surface mounting | -| vmbpiro | Outdoor motion, twilight and temperature sensor, Theben | -| vmbrfr8s | 8 channel RF receiver module | -| vmbvp1 | Doorbird interface module | +| Type | Description | +|--------------|--------------------------------------------------------------------------------------------| +| vmb1bl | 1-channel blind control module for din rail | +| vmb1bls | 1-channel blind control module for universal mounting | +| vmb1dm | Dimmer module for inductive/resistive and capacitive load | +| vmb1led | 1-channel 0-10V controlled PWM dimmer for led strips | +| vmb1ry | 1-channel relay module | +| vmb1ryno | 1-channel relay module with potential-free changeover contact | +| vmb1rynos | 1-channel relay module with potential-free changeover contact | +| vmb1rys | 1-channel relay module with input | +| vmb1ts | Temperature Sensor Module | +| vmb2bl | 2-channel blind control module | +| vmb2ble-10 | 2-channel blind control module with extended possibilities | +| vmb2ble | 2-channel blind control module with extended possibilities | +| vmb2pbn | Push-button interface for Niko 1- or 2-fold push-buttons | +| vmb4an | Analog I/O module | +| vmb4dc | 4-channel 0/1-10V dimmer controller | +| vmb4pb | 4 button interface module | +| vmb4ry | 4-channel relay module | +| vmb4ryld-10 | 4-channel relay module with voltage outputs | +| vmb4ryld | 4-channel relay module with voltage outputs | +| vmb4ryno-10 | 4-channel relay module with potential-free contacts | +| vmb4ryno | 4-channel relay module with potential-free contacts | +| vmb6in | 6-channel input module | +| vmb6pb-20 | 6-channel input module | +| vmb6pbn | Push-button interface module for Niko 4- or 6-fold push-button | +| vmb7in | 7-channel input module (potentialfree + pulse) | +| vmb8ir | Infrared remote control receiver module | +| vmb8pb | 8-Channel Push Button module | +| vmb8pbu | Push-button interface with 8 channels for universal mounting | +| vmbdali-20 | DALI gateway module | +| vmbdali | DALI gateway module | +| vmbdme | Dimmer for electronic/resistive load | +| vmbdmir | Single channel triac dimmer for resistive and inductive loads | +| vmbdmi | Single channel triac dimmer for resistive and inductive loads | +| vmbel1-20 | Edge-lit one touch button module | +| vmbel1 | Edge-lit one touch button module | +| vmbel2-20 | Edge-lit two touch buttons module | +| vmbel2 | Edge-lit two touch buttons module | +| vmbel4pir-20 | Edge-lit Motion detector with four touch buttons | +| vmbel4-20 | Edge-lit four touch buttons module | +| vmbel4 | Edge-lit four touch buttons module | +| vmbelo-20 | Edge-lit touch panel with Oled display | +| vmbelo | Edge-lit touch panel with Oled display | +| vmbelpir | Edge-lit Motion detector with one touch button | +| vmbgp1-20 | Glass control module with 1 touch key | +| vmbgp1-2 | Glass control module with 1 touch key (Edition 2) | +| vmbgp1 | Glass control module with 1 touch key | +| vmbgp2-20 | Glass control module with 2 touch keys | +| vmbgp2-2 | Glass control module with 2 touch keys (Edition 2) | +| vmbgp2 | Glass control module with 2 touch keys | +| vmbgp4-20 | Glass control module with 4 touch keys | +| vmbgp4-2 | Glass control module with 4 touch keys (Edition 2) | +| vmbgp4 | Glass control module with 4 touch keys | +| vmbgp4pir-20 | Glass control module with 4 touch keys and built-in motion and twilight sensor | +| vmbgp4pir-2 | Glass control module with 4 touch keys and built-in motion and twilight sensor (Edition 2) | +| vmbgp4pir | Glass control module with 4 touch keys and built-in motion and twilight sensor | +| vmbgpod-2 | Glass control module with oled display and temperature controller (Edition 2) | +| vmbgpod | Glass control module with oled display and temperature controller | +| vmbgpo-20 | Glass control module with oled display and temperature controller | +| vmbgpo | Glass control module with oled display | +| vmbin | 1-channel input module | +| vmbkp | Keypad interface module | +| vmbmeteo | Weather station with thermometer, anemometer, rain sensor and light sensor | +| vmbpirc | Motion and twilight sensor for ceiling mounting | +| vmbpirm | Mini motion and twilight sensor for recessed or surface mounting | +| vmbpiro | Outdoor motion, twilight and temperature sensor, Theben | +| vmbrfr8s | 8 channel RF receiver module | +| vmbvp1 | Doorbird interface module | ## Discovery @@ -243,7 +258,7 @@ xidel -e 'let $refs := ( | `dimspeed` | `vmb1dm`, `vmb1led`, `vmb4dc`, `vmbdme`, `vmbdmi`, `vmbdmir` | The time (in seconds) needed for dimming from 0 to 100%. | | `refresh` | `vmb1ts`, `vmb4an`, `vmb7in`, `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp1-2`, `vmbgp2`, `vmbgp2-2`, `vmbgp4`, `vmbgp4-2`, `vmbgp4pir`, `vmbgp4pir-2`, `vmbmeteo`, `vmbpirc`, `vmbpirm`, `vmbpiro` | Refresh interval for sensors or counters (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. | -The `vmbdali` thing has 16 virtual light channels. A virtual light combines 3 or 4 VMBDALI module channels into an OpenHAB channel to control RGB or RGBW lights. +The `vmbdali` and `vmbdali-20` things have 16 virtual light channels. A virtual light combines 3 or 4 VMBDALI module channels into an OpenHAB channel to control RGB or RGBW lights. This is because an RGBW DALI light is configured on the VMBDALI module with 4 channels (Red channel, Green channel, Blue channel, White channel). The channels of the virtual light can be identified by a module channel `CH1` ... `CH64` or a DALI address `A0` ... `A63`. @@ -276,7 +291,7 @@ OnOff command types are supported. For thing type `vmb4ry` 4 channels are available `CH1` ... `CH4`. OnOff command types are supported. -For thing types `vmb1ryno`, `vmb1rynos`, `vmb4ryld` and `vmb4ryno` 5 channels are available `CH1` ... `CH5`. +For thing types `vmb1ryno`, `vmb1rynos`, `vmb4ryld`, `vmb4ryld-10`, `vmb4ryno` and `vmb4ryno-10` 5 channels are available `CH1` ... `CH5`. OnOff command types are supported. For thing types `vmb1rys` 6 channels are available `CH1` ... `CH6`. @@ -286,7 +301,7 @@ Pressed and Long_Pressed command types are supported on channel `CH6`. The module `vmb1ts` has a number of channels to set the module's thermostat (`thermostat#currentTemperatureSetpoint`, `thermostat#heatingModeComfortTemperatureSetpoint`, `thermostat#heatingModeDayTemperatureSetpoint`, `thermostat#heatingModeNightTemperatureSetpoint`, `thermostat#heatingModeAntiFrostTemperatureSetpoint`, `thermostat#coolingModeComfortTemperatureSetpoint`, `thermostat#coolingModeDayTemperatureSetpoint`, `thermostat#coolingModeNightTemperatureSetpoint`, `thermostat#coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat#mode`) and thermostat trigger channels: `thermostat#heater`, `thermostat#boost`, `thermostat#pump`, `thermostat#cooler`, `thermostat#alarm1`, `thermostat#alarm2`, `thermostat#alarm3`, `thermostat#alarm4`. -For thing types `vmb2bl` and `vmb2ble` the supported channels are `CH1` and `CH2`. UpDown, StopMove and Percent command types are supported. +For thing types `vmb2bl`, `vmb2ble` and `vmb2ble-10` the supported channels are `CH1` and `CH2`. UpDown, StopMove and Percent command types are supported. For thing type `vmb6in` 6 channels are available `CH1` ... `CH6`. Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH6`. @@ -296,12 +311,11 @@ For thing type `vmb7in` 8 channels are available `CH1` ... `CH8`. Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH8`. 8 trigger channels on channels `input#CH1` ... `input#CH8`. -For thing types `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8ir`, `vmb8pb`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` 8 channels are available `CH1` ... `CH8`. +For thing types `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8ir`, `vmb8pb`, `vmb8pbu`, `vmbrfr8s`, `vmbvp1` and `vmb6pb-20` 8 channels are available `CH1` ... `CH8`. Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH8`. 8 trigger channels on channels `input#CH1` ... `input#CH8`. - -Thing types `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8pb`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` also have and 2 channels to steer the button LED feedback (`feedback#CH1` and `feedback#CH2`). -Additionally, the modules `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. +Thing types `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8pb`, `vmb8pbu`, `vmbrfr8s` and `vmbvp1` also have 8 channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH8`. +Additionally, the modules `vmb2pbn`, `vmb6pbn`, `vmb7in`, `vmb8pbu`, `vmbrfr8s`, `vmbvp1` and `vmb6pb-20` have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. For thing type`vmb4an` 8 trigger channels are avaiable `input#CH1` ... `input#CH8`. These channels will be triggered by the module's alarms. @@ -316,21 +330,22 @@ Sending an ON command will switch the dimmer to the value stored when last turni For thing type `vmb4ry` 4 channels are available `CH1` ... `CH4`. OnOff command types are supported. -Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir` and `vmbpiro` have 8 trigger channels `input:CH1` ... `input:CH8` and one temperature channel `input:CH9`. +Thing types `vmbel1`, `vmbel1-20`, `vmbel2`, `vmbel2-20`, `vmbel4`, `vmbel4-20`, `vmbelpir`, `vmbel4pir-20`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir`, `vmbgp4pir-20` and `vmbpiro` have 8 trigger channels `input:CH1` ... `input:CH8` and one temperature channel `input:CH9`. Pressed and Long_Pressed command types are supported on channels `button#CH1` and `button#CH2` for the thing type `vmbelpir`. -Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH8` for the thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir` and `vmbpiro`. -The thing types `vmbel1` and `vmbgp1` have one channel to steer the button LED feedback `feedback#CH1`. -The thing types `vmbel2` and `vmbgp2` have two channels to steer the button LED feedback `feedback#CH1` and `feedback#CH2`. -The thing types `vmbel4`, `vmbgp4` and `vmbgp4pir` have four channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH4`. +Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH4` for the thing type `vmbel4pir-20`. +Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH8` for the thing types `vmbel1`, `vmbel1-20`, `vmbel2`, `vmbel2-20`, `vmbel4`, `vmbel4-20`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir`, `vmbgp4pir-20` and `vmbpiro`. +The thing types `vmbel1`, `vmbel1-20` and `vmbgp1` have one channel to steer the button LED feedback `feedback#CH1`. +The thing types `vmbel2`, `vmbel2-20` and `vmbgp2` have two channels to steer the button LED feedback `feedback#CH1` and `feedback#CH2`. +The thing types `vmbel4`, `vmbel4-20`, `vmbel4pir-20`, `vmbgp4`, `vmbgp4pir` and `vmbgp4pir-20` have four channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH4`. The thing type `vmbpiro` has a channel `input#LIGHT` indicating the illuminance. -The thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir` have one output channel `output#output`. -Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4` and `vmbgp4pir` have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. -Thing types `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp2`, `vmbgp4` and `vmbgp4pir` also have a number of channels to set the module's thermostat (`thermostat#currentTemperatureSetpoint`, `thermostat#heatingModeComfortTemperatureSetpoint`, `thermostat#heatingModeDayTemperatureSetpoint`, `thermostat#heatingModeNightTemperatureSetpoint`, `thermostat#heatingModeAntiFrostTemperatureSetpoint`, `thermostat#coolingModeComfortTemperatureSetpoint`, `thermostat#coolingModeDayTemperatureSetpoint`, `thermostat#coolingModeNightTemperatureSetpoint`, `thermostat#coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat#mode`) and thermostat trigger channels: `thermostat#heater`, `thermostat#boost`, `thermostat#pump`, `thermostat#cooler`, `thermostat#alarm1`, `thermostat#alarm2`, `thermostat#alarm3`, `thermostat#alarm4`. +The thing types `vmbel1`, `vmbel1-20`, `vmbel2`, `vmbel2-20`, `vmbel4`, `vmbel4-20`, `vmbelpir` and `vmbel4pir-20` have one output channel `output#output`. +Thing types `vmbel1`, `vmbel1-20`, `vmbel2`, `vmbel2-20`, `vmbel4`, `vmbel4-20`, `vmbelpir`, `vmbel4pir-20`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir` and `vmbgp4pir-20` have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. +Thing types `vmbel1`, `vmbel1-20`, `vmbel2`, `vmbel2-20`, `vmbel4`, `vmbel4-20`, `vmbelpir`, `vmbel4pir-20`, `vmbgp1`, `vmbgp2`, `vmbgp4`, `vmbgp4pir` and `vmbgp4pir-20` also have a number of channels to set the module's thermostat (`thermostat#currentTemperatureSetpoint`, `thermostat#heatingModeComfortTemperatureSetpoint`, `thermostat#heatingModeDayTemperatureSetpoint`, `thermostat#heatingModeNightTemperatureSetpoint`, `thermostat#heatingModeAntiFrostTemperatureSetpoint`, `thermostat#coolingModeComfortTemperatureSetpoint`, `thermostat#coolingModeDayTemperatureSetpoint`, `thermostat#coolingModeNightTemperatureSetpoint`, `thermostat#coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat#mode`) and thermostat trigger channels: `thermostat#heater`, `thermostat#boost`, `thermostat#pump`, `thermostat#cooler`, `thermostat#alarm1`, `thermostat#alarm2`, `thermostat#alarm3`, `thermostat#alarm4`. -Thing types `vmbelo`, `vmbgpo`, `vmbgpod` and `vmbgpod-2` have 32 trigger channels `input#CH1` ... `input#CH32` and one temperature channel `input#CH33`. +Thing types `vmbelo`, `vmbelo-20`, `vmbgpo`, `vmbgpo-20`, `vmbgpod` and `vmbgpod-2` have 32 trigger channels `input#CH1` ... `input#CH32` and one temperature channel `input#CH33`. Pressed and Long_Pressed command types are supported on channels `button#CH1` ... `button#CH32`. They have have 32 channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH32`. -The thing type `vmbelo` has one output channel `output#output`. +The thing type `vmbelo` and `vmbelo-20` have one output channel `output#output`. They have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. They have a number of channels to set the module's thermostat thermostat (`thermostat#currentTemperatureSetpoint`, `thermostat#heatingModeComfortTemperatureSetpoint`, `thermostat#heatingModeDayTemperatureSetpoint`, `thermostat#heatingModeNightTemperatureSetpoint`, `thermostat#heatingModeAntiFrostTemperatureSetpoint`, `thermostat#coolingModeComfortTemperatureSetpoint`, `thermostat#coolingModeDayTemperatureSetpoint`, `thermostat#coolingModeNightTemperatureSetpoint`, `thermostat#coolingModeSafeTemperatureSetpoint`, `operatingMode` and `thermostat#mode`) and thermostat trigger channels: `thermostat#heater`, `thermostat#boost`, `thermostat#pump`, `thermostat#cooler`, `thermostat#alarm1`, `thermostat#alarm2`, `thermostat#alarm3`, `thermostat#alarm4`. They also have two channels to control the module's display `oledDisplay:MEMO` and `oledDisplay:SCREENSAVER`. @@ -342,14 +357,14 @@ It also has a number of channels to read out the weather station's sensors: `wea Thing types `vmbpirc` and `vmbpirm` have 7 trigger channels `input#CH1` ... `input#CH7`. Additionally, these modules have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. -Thing type `vmbdali` has 81 trigger channels `input#CH1` ... `input#CH81`. -It has 81 channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH81`. +Thing types `vmbdali` and `vmbdali-20` have 81 trigger channels `input#CH1` ... `input#CH81`. +They have 81 channels to steer the button LED feedback `feedback#CH1` ... `feedback#CH81`. hsbColor command type is supported on channels `color#CH1` ... `color#CH64` (A1 ... A64), `color#CH65` ... `color#CH80` (G1 ... G16) and `color#CH81` (broadcast). This is to set the color on the channels. Percent command type is supported on channels `brightness#CH1` ... `brightness#CH64` (A1 ... A64), `brightness#CH65` ... `brightness#CH80` (G1 ... G16) and `brightness#CH81` (broadcast). This is to set the brightness on the channels. Percent command type is supported on channels `white#CH1` ... `white#CH64` (A1 ... A64), `white#CH65` ... `white#CH80` (G1 ... G16) and `white#CH81` (broadcast). This is to set the white on the channels. Values 1 to 15 are supported on channels `scene#CH1` ... `scene#CH64` (A1 ... A64), `scene#CH65` ... `scene#CH80` (G1 ... G16) and `scene#CH81` (broadcast). This is to set the scene on the channels. hsbColor command type is supported on channels `virtual-light#VL1` ... `virtual-light#VL16`. This is to set the color on the virtual light. -It has a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. +They have a number of channels to set the module's alarms: `clockAlarm#clockAlarm1Enabled`, `clockAlarm#clockAlarm1WakeupHour`, `clockAlarm#clockAlarm1WakeupMinute`, `clockAlarm#clockAlarm1BedtimeHour`, `clockAlarm#clockAlarm1BedtimeMinute`, `clockAlarm#clockAlarm2Enabled`, `clockAlarm#clockAlarm2WakeupHour`, `clockAlarm#clockAlarm2WakeupMinute`, `clockAlarm#clockAlarm2BedtimeHour` and `clockAlarm#clockAlarm2BedtimeMinute`. The trigger channels can be used as a trigger to rules. The event message can be `PRESSED`, `RELEASED`or `LONG_PRESSED`. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java index 8aee830b19e14..f42f6ed088d83 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java @@ -85,6 +85,21 @@ public class VelbusBindingConstants { public static final ThingTypeUID THING_TYPE_VMBIN = new ThingTypeUID(BINDING_ID, "vmbin"); public static final ThingTypeUID THING_TYPE_VMB4PB = new ThingTypeUID(BINDING_ID, "vmb4pb"); public static final ThingTypeUID THING_TYPE_VMBDALI = new ThingTypeUID(BINDING_ID, "vmbdali"); + public static final ThingTypeUID THING_TYPE_VMB4RYLD_10 = new ThingTypeUID(BINDING_ID, "vmb4ryld-10"); + public static final ThingTypeUID THING_TYPE_VMB4RYNO_10 = new ThingTypeUID(BINDING_ID, "vmb4ryno-10"); + public static final ThingTypeUID THING_TYPE_VMB2BLE_10 = new ThingTypeUID(BINDING_ID, "vmb2ble-10"); + public static final ThingTypeUID THING_TYPE_VMB6PB_20 = new ThingTypeUID(BINDING_ID, "vmb6pb-20"); + public static final ThingTypeUID THING_TYPE_VMBEL1_20 = new ThingTypeUID(BINDING_ID, "vmbel1-20"); + public static final ThingTypeUID THING_TYPE_VMBEL2_20 = new ThingTypeUID(BINDING_ID, "vmbel2-20"); + public static final ThingTypeUID THING_TYPE_VMBEL4_20 = new ThingTypeUID(BINDING_ID, "vmbel4-20"); + public static final ThingTypeUID THING_TYPE_VMBELO_20 = new ThingTypeUID(BINDING_ID, "vmbelo-20"); + public static final ThingTypeUID THING_TYPE_VMBGP1_20 = new ThingTypeUID(BINDING_ID, "vmbgp1-20"); + public static final ThingTypeUID THING_TYPE_VMBGP2_20 = new ThingTypeUID(BINDING_ID, "vmbgp2-20"); + public static final ThingTypeUID THING_TYPE_VMBGP4_20 = new ThingTypeUID(BINDING_ID, "vmbgp4-20"); + public static final ThingTypeUID THING_TYPE_VMBGPO_20 = new ThingTypeUID(BINDING_ID, "vmbgpo-20"); + public static final ThingTypeUID THING_TYPE_VMBDALI_20 = new ThingTypeUID(BINDING_ID, "vmbdali-20"); + public static final ThingTypeUID THING_TYPE_VMBEL4PIR_20 = new ThingTypeUID(BINDING_ID, "vmbel4pir-20"); + public static final ThingTypeUID THING_TYPE_VMBGP4PIR_20 = new ThingTypeUID(BINDING_ID, "vmbgp4pir-20"); // thing type sets public static final Set BRIDGE_THING_TYPES_UIDS = Set.of(BRIDGE_THING_TYPE, @@ -99,7 +114,11 @@ public class VelbusBindingConstants { 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, THING_TYPE_VMBDALI); + THING_TYPE_VMBVP1, THING_TYPE_VMBKP, THING_TYPE_VMBIN, THING_TYPE_VMB4PB, THING_TYPE_VMBDALI, + THING_TYPE_VMB4RYLD_10, THING_TYPE_VMB4RYNO_10, THING_TYPE_VMB2BLE_10, THING_TYPE_VMB6PB_20, + THING_TYPE_VMBEL1_20, THING_TYPE_VMBEL2_20, THING_TYPE_VMBEL4_20, THING_TYPE_VMBELO_20, + THING_TYPE_VMBGP1_20, THING_TYPE_VMBGP2_20, THING_TYPE_VMBGP4_20, THING_TYPE_VMBGPO_20, + THING_TYPE_VMBDALI_20, THING_TYPE_VMBEL4PIR_20, THING_TYPE_VMBGP4PIR_20); // Velbus module types public static final byte MODULE_TYPE_VMB8PB = 0x01; @@ -155,6 +174,21 @@ public class VelbusBindingConstants { public static final byte MODULE_TYPE_VMBIN = 0x43; public static final byte MODULE_TYPE_VMB4PB = 0x44; public static final byte MODULE_TYPE_VMBDALI = 0x45; + public static final byte MODULE_TYPE_VMB4RYLD_10 = 0x48; + public static final byte MODULE_TYPE_VMB4RYNO_10 = 0x49; + public static final byte MODULE_TYPE_VMB2BLE_10 = 0x4A; + public static final byte MODULE_TYPE_VMB6PB_20 = 0x4C; + public static final byte MODULE_TYPE_VMBEL1_20 = 0x4F; + public static final byte MODULE_TYPE_VMBEL2_20 = 0x50; + public static final byte MODULE_TYPE_VMBEL4_20 = 0x51; + public static final byte MODULE_TYPE_VMBELO_20 = 0x52; + public static final byte MODULE_TYPE_VMBGP1_20 = 0x54; + public static final byte MODULE_TYPE_VMBGP2_20 = 0x55; + public static final byte MODULE_TYPE_VMBGP4_20 = 0x56; + public static final byte MODULE_TYPE_VMBGPO_20 = 0x57; + public static final byte MODULE_TYPE_VMBDALI_20 = 0x5A; + public static final byte MODULE_TYPE_VMBEL4PIR_20 = 0x5C; + public static final byte MODULE_TYPE_VMBGP4PIR_20 = 0x5F; // Velbus commands public static final byte COMMAND_PUSH_BUTTON_STATUS = 0x00; @@ -167,6 +201,12 @@ public class VelbusBindingConstants { public static final byte COMMAND_SET_DIMVALUE = 0x07; public static final byte COMMAND_SLIDER_STATUS = 0x0F; public static final byte COMMAND_RESTORE_LAST_DIMVALUE = 0x11; + public static final byte COMMAND_FORCED_OFF = 0x12; + public static final byte COMMAND_CANCEL_FORCED_OFF = 0x13; + public static final byte COMMAND_FORCED_ON = 0x14; + public static final byte COMMAND_CANCEL_FORCED_ON = 0x15; + public static final byte COMMAND_INHIBIT = 0x16; + public static final byte COMMAND_CANCEL_INHIBIT = 0x17; public static final byte COMMAND_BLIND_POS = 0x1C; public static final byte COMMAND_SET_DIMSCENE = (byte) 0x1D; public static final byte COMMAND_SET_COLOR = (byte) 0x1E; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java index 0b64c6f71484a..1b2354cd85095 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java @@ -169,6 +169,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB2BLE, 2); break; + case MODULE_TYPE_VMB2BLE_10: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB2BLE_10, 2); + break; case MODULE_TYPE_VMB2PBN: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB2PBN, 8); @@ -189,10 +193,18 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB4RYLD, 5); break; + case MODULE_TYPE_VMB4RYLD_10: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB4RYLD_10, 5); + break; case MODULE_TYPE_VMB4RYNO: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB4RYNO, 5); break; + case MODULE_TYPE_VMB4RYNO_10: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB4RYNO_10, 5); + break; case MODULE_TYPE_VMB6IN: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB6IN, 6); @@ -201,6 +213,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB6PBN, 8); break; + case MODULE_TYPE_VMB6PB_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB6PB_20, 8); + break; case MODULE_TYPE_VMB7IN: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMB7IN, 8); @@ -233,22 +249,42 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL1, 9); break; + case MODULE_TYPE_VMBEL1_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL1_20, 9); + break; case MODULE_TYPE_VMBEL2: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL2, 9); break; + case MODULE_TYPE_VMBEL2_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL2_20, 9); + break; case MODULE_TYPE_VMBEL4: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL4, 9); break; + case MODULE_TYPE_VMBEL4_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL4_20, 9); + break; case MODULE_TYPE_VMBELO: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBELO, 33); break; + case MODULE_TYPE_VMBELO_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBELO_20, 33); + break; case MODULE_TYPE_VMBELPIR: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBELPIR, 9); break; + case MODULE_TYPE_VMBEL4PIR_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBEL4PIR_20, 9); + break; case MODULE_TYPE_VMBGP1: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP1, 9); @@ -257,6 +293,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP1_2, 9); break; + case MODULE_TYPE_VMBGP1_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP1_20, 9); + break; case MODULE_TYPE_VMBGP2: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP2, 9); @@ -265,6 +305,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP2_2, 9); break; + case MODULE_TYPE_VMBGP2_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP2_20, 9); + break; case MODULE_TYPE_VMBGP4: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4, 9); @@ -273,6 +317,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4_2, 9); break; + case MODULE_TYPE_VMBGP4_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4_20, 9); + break; case MODULE_TYPE_VMBGP4PIR: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4PIR, 9); @@ -281,6 +329,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4PIR_2, 9); break; + case MODULE_TYPE_VMBGP4PIR_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 1), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGP4PIR_20, 9); + break; case MODULE_TYPE_VMBGPO: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGPO, 33); @@ -293,6 +345,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGPOD_2, 33); break; + case MODULE_TYPE_VMBGPO_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 4), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBGPO_20, 33); + break; case MODULE_TYPE_VMBMETEO: velbusModule = new VelbusModule(new VelbusModuleAddress(address, 0), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBMETEO, 13); @@ -333,6 +389,10 @@ private void handleModuleTypeCommand(byte[] packet, byte address) { velbusModule = new VelbusModule(new VelbusModuleAddress(address, 9), moduleType, highByteOfSerialNumber, lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBDALI, 81); break; + case MODULE_TYPE_VMBDALI_20: + velbusModule = new VelbusModule(new VelbusModuleAddress(address, 9), moduleType, highByteOfSerialNumber, + lowByteOfSerialNumber, memoryMapVersion, buildYear, buildWeek, THING_TYPE_VMBDALI_20, 81); + break; } if (velbusModule != null) { diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java index 382f0c8cad0eb..f3c7e0598e79c 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java @@ -48,8 +48,8 @@ */ @NonNullByDefault public class VelbusBlindsHandler extends VelbusThingHandler { - public static final Set SUPPORTED_THING_TYPES = new HashSet<>( - Arrays.asList(THING_TYPE_VMB1BL, THING_TYPE_VMB1BLS, THING_TYPE_VMB2BL, THING_TYPE_VMB2BLE)); + public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB1BL, + THING_TYPE_VMB1BLS, THING_TYPE_VMB2BL, THING_TYPE_VMB2BLE, THING_TYPE_VMB2BLE_10)); public VelbusBlindsHandler(Thing thing) { super(thing, 0); diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java index 71f2c63388441..003d7da8c2c18 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java @@ -40,8 +40,9 @@ */ @NonNullByDefault public class VelbusRelayHandler extends VelbusThingHandler { - public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMB1RY, - THING_TYPE_VMB1RYNO, THING_TYPE_VMB1RYNOS, THING_TYPE_VMB4RY, THING_TYPE_VMB4RYLD, THING_TYPE_VMB4RYNO)); + public static final Set SUPPORTED_THING_TYPES = new HashSet<>( + Arrays.asList(THING_TYPE_VMB1RY, THING_TYPE_VMB1RYNO, THING_TYPE_VMB1RYNOS, THING_TYPE_VMB4RY, + THING_TYPE_VMB4RYLD, THING_TYPE_VMB4RYNO, THING_TYPE_VMB4RYLD_10, THING_TYPE_VMB4RYNO_10)); public VelbusRelayHandler(Thing thing) { super(thing, 0); diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java index 581026d7364e2..11e4a568db54a 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java @@ -48,7 +48,7 @@ public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler { public static final Set 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)); + THING_TYPE_VMBVP1, THING_TYPE_VMBKP, THING_TYPE_VMBIN, THING_TYPE_VMB4PB, THING_TYPE_VMB6PB_20)); private static final HashMap ALARM_CONFIGURATION_MEMORY_ADDRESSES = new HashMap(); static { @@ -60,7 +60,7 @@ public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler { ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBEL1, 0x0357); ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBEL2, 0x0357); ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBEL4, 0x0357); - ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBELO, 0x0593); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBELO, 0x05A3); ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBELPIR, 0x030F); ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBPIRC, 0x0031); ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBPIRM, 0x0031); @@ -83,6 +83,18 @@ public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler { ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBIN, 0x00A7); ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMB4PB, 0x00A7); ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBDALI, 0x0513); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMB6PB_20, 0x00A7); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBEL1_20, 0x0357); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBEL2_20, 0x0357); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBEL4_20, 0x0357); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBELO_20, 0x05A3); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBGP1_20, 0x0357); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBGP2_20, 0x0357); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBGP4_20, 0x0357); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBGPO_20, 0x05A3); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBDALI_20, 0x0513); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBEL4PIR_20, 0x032B); + ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMBGP4PIR_20, 0x032B); } private static final byte ALARM_CONFIGURATION_MEMORY_SIZE = 0x09; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java index a9efdab334bf2..47da607ac1ea9 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -49,7 +49,8 @@ */ @NonNullByDefault public class VelbusVMBDALIHandler extends VelbusSensorWithAlarmClockHandler { - public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBDALI)); + public static final Set SUPPORTED_THING_TYPES = new HashSet<>( + Arrays.asList(THING_TYPE_VMBDALI, THING_TYPE_VMBDALI_20)); private @Nullable ScheduledFuture refreshJob; private @NonNullByDefault({}) VelbusSensorConfig sensorConfig; diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java index 72996c2e8b1ea..f617b6644c605 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java @@ -41,7 +41,8 @@ @NonNullByDefault public class VelbusVMBELHandler extends VelbusThermostatHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( - Arrays.asList(THING_TYPE_VMBEL1, THING_TYPE_VMBEL2, THING_TYPE_VMBEL4, THING_TYPE_VMBELPIR)); + Arrays.asList(THING_TYPE_VMBEL1, THING_TYPE_VMBEL2, THING_TYPE_VMBEL4, THING_TYPE_VMBELPIR, + THING_TYPE_VMBEL1_20, THING_TYPE_VMBEL2_20, THING_TYPE_VMBEL4_20, THING_TYPE_VMBEL4PIR_20)); private final ChannelUID outputChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_OUTPUT, CHANNEL_OUTPUT); diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java index 95dcdac835e25..e4f643ec5bea9 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java @@ -40,7 +40,8 @@ */ @NonNullByDefault public class VelbusVMBELOHandler extends VelbusMemoHandler { - public static final Set SUPPORTED_THING_TYPES = new HashSet<>(Arrays.asList(THING_TYPE_VMBELO)); + public static final Set SUPPORTED_THING_TYPES = new HashSet<>( + Arrays.asList(THING_TYPE_VMBELO, THING_TYPE_VMBELO_20)); private final ChannelUID outputChannel = new ChannelUID(thing.getUID(), CHANNEL_GROUP_OUTPUT, CHANNEL_OUTPUT); diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPHandler.java index 661a022bfed8b..19b95bca6db40 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPHandler.java @@ -33,7 +33,8 @@ public class VelbusVMBGPHandler extends VelbusThermostatHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( Arrays.asList(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_VMBGP4, THING_TYPE_VMBGP4_2, THING_TYPE_VMBGP4PIR, THING_TYPE_VMBGP4PIR_2, + THING_TYPE_VMBGP1_20, THING_TYPE_VMBGP2_20, THING_TYPE_VMBGP4_20, THING_TYPE_VMBGP4PIR_20)); public VelbusVMBGPHandler(Thing thing) { super(thing, 4, new ChannelUID(thing.getUID(), "input", "CH9")); diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java index dff6de6d3bebd..5159291923083 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java @@ -38,7 +38,7 @@ @NonNullByDefault public class VelbusVMBGPOHandler extends VelbusMemoHandler { public static final Set SUPPORTED_THING_TYPES = new HashSet<>( - Arrays.asList(THING_TYPE_VMBGPO, THING_TYPE_VMBGPOD, THING_TYPE_VMBGPOD_2)); + Arrays.asList(THING_TYPE_VMBGPO, THING_TYPE_VMBGPOD, THING_TYPE_VMBGPOD_2, THING_TYPE_VMBGPO_20)); public static final int MODULESETTINGS_MEMORY_ADDRESS = 0x02F0; public static final int LAST_MEMORY_LOCATION_ADDRESS = 0x1A03; diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties index 69f949a2e3f12..3b4686df9a9cb 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/i18n/velbus.properties @@ -29,6 +29,8 @@ thing-type.velbus.vmb1ts.label = VMB1TS thing-type.velbus.vmb1ts.description = Temperature Sensor Module thing-type.velbus.vmb2bl.label = VMB2BL thing-type.velbus.vmb2bl.description = 2-channel blind control module +thing-type.velbus.vmb2ble-10.label = VMB2BLE-10 +thing-type.velbus.vmb2ble-10.description = 2-channel blind control module with extended possibilities thing-type.velbus.vmb2ble.label = VMB2BLE thing-type.velbus.vmb2ble.description = 2-channel blind control module with extended possibilities thing-type.velbus.vmb2pbn.label = VMB2PBN @@ -41,12 +43,18 @@ 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-10.label = VMB4RYLD-10 +thing-type.velbus.vmb4ryld-10.description = 4-channel relay module with voltage outputs thing-type.velbus.vmb4ryld.label = VMB4RYLD thing-type.velbus.vmb4ryld.description = 4-channel relay module with voltage outputs +thing-type.velbus.vmb4ryno-10.label = VMB4RYNO-10 +thing-type.velbus.vmb4ryno-10.description = 4-channel relay module with potential-free contacts thing-type.velbus.vmb4ryno.label = VMB4RYNO thing-type.velbus.vmb4ryno.description = 4-channel relay module with potential-free contacts thing-type.velbus.vmb6in.label = VMB6IN thing-type.velbus.vmb6in.description = 6-channel input module +thing-type.velbus.vmb6pbn-20.label = VMB6PBN-20 +thing-type.velbus.vmb6pbn-20.description = 6 button interface module thing-type.velbus.vmb6pbn.label = VMB6PBN thing-type.velbus.vmb6pbn.description = Push-button interface module for Niko 4- or 6-fold push-button thing-type.velbus.vmb7in.label = VMB7IN @@ -57,6 +65,8 @@ thing-type.velbus.vmb8pb.label = VMB8PB thing-type.velbus.vmb8pb.description = 8-Channel Push Button module thing-type.velbus.vmb8pbu.label = VMB8PBU thing-type.velbus.vmb8pbu.description = Push-button interface with 8 channels for universal mounting +thing-type.velbus.vmbdali-20.label = VMBDALI-20 +thing-type.velbus.vmbdali-20.description = DALI gateway module thing-type.velbus.vmbdali.label = VMBDALI thing-type.velbus.vmbdali.description = DALI gateway module thing-type.velbus.vmbdme.label = VMBDME @@ -65,32 +75,52 @@ thing-type.velbus.vmbdmi.label = VMBDMI thing-type.velbus.vmbdmi.description = Single channel triac dimmer for resistive and inductive loads thing-type.velbus.vmbdmir.label = VMBDMI-R thing-type.velbus.vmbdmir.description = Single channel triac dimmer for resistive and inductive loads +thing-type.velbus.vmbel1-20.label = VMBEL1-20 +thing-type.velbus.vmbel1-20.description = Edge-lit one touch button module thing-type.velbus.vmbel1.label = VMBEL1 thing-type.velbus.vmbel1.description = Edge-lit one touch button module +thing-type.velbus.vmbel2-20.label = VMBEL2-20 +thing-type.velbus.vmbel2-20.description = Edge-lit two touch buttons module thing-type.velbus.vmbel2.label = VMBEL2 thing-type.velbus.vmbel2.description = Edge-lit two touch buttons module +thing-type.velbus.vmbel4-20.label = VMBEL4-20 +thing-type.velbus.vmbel4-20.description = Edge-lit four touch buttons module thing-type.velbus.vmbel4.label = VMBEL4 thing-type.velbus.vmbel4.description = Edge-lit four touch buttons module +thing-type.velbus.vmbel4pir-20.label = VMBEL4PIR-20 +thing-type.velbus.vmbel4pir-20.description = Edge-lit Motion detector with four touch button +thing-type.velbus.vmbelo-20.label = VMBELO-20 +thing-type.velbus.vmbelo-20.description = Edge-lit touch panel with Oled display thing-type.velbus.vmbelo.label = VMBELO thing-type.velbus.vmbelo.description = Edge-lit touch panel with Oled display thing-type.velbus.vmbelpir.label = VMBELPIR thing-type.velbus.vmbelpir.description = Edge-lit Motion detector with one touch button thing-type.velbus.vmbgp1-2.label = VMBGP1-2 thing-type.velbus.vmbgp1-2.description = Glass control module with 1 touch key (Edition 2) +thing-type.velbus.vmbgp1-20.label = VMBGP1-20 +thing-type.velbus.vmbgp1-20.description = Glass control module with 1 touch key thing-type.velbus.vmbgp1.label = VMBGP1 thing-type.velbus.vmbgp1.description = Glass control module with 1 touch key thing-type.velbus.vmbgp2-2.label = VMBGP2-2 thing-type.velbus.vmbgp2-2.description = Glass control module with 2 touch keys (Edition 2) +thing-type.velbus.vmbgp2-20.label = VMBGP2-20 +thing-type.velbus.vmbgp2-20.description = Glass control module with 2 touch keys thing-type.velbus.vmbgp2.label = VMBGP2 thing-type.velbus.vmbgp2.description = Glass control module with 2 touch keys thing-type.velbus.vmbgp4-2.label = VMBGP4-2 thing-type.velbus.vmbgp4-2.description = Glass control module with 4 touch keys (Edition 2) +thing-type.velbus.vmbgp4-20.label = VMBGP4-20 +thing-type.velbus.vmbgp4-20.description = Glass control module with 4 touch keys thing-type.velbus.vmbgp4.label = VMBGP4 thing-type.velbus.vmbgp4.description = Glass control module with 4 touch keys thing-type.velbus.vmbgp4pir-2.label = VMBGP4PIR-2 thing-type.velbus.vmbgp4pir-2.description = Glass control module with 4 touch keys and built-in motion and twilight sensor (Edition 2) +thing-type.velbus.vmbgp4pir-20.label = VMBGP4PIR-20 +thing-type.velbus.vmbgp4pir-20.description = Glass control module with 4 touch keys and built-in motion and twilight sensor thing-type.velbus.vmbgp4pir.label = VMBGP4PIR thing-type.velbus.vmbgp4pir.description = Glass control module with 4 touch keys and built-in motion and twilight sensor +thing-type.velbus.vmbgpo-20.label = VMBGPO-20 +thing-type.velbus.vmbgpo-20.description = Glass control module with oled display thing-type.velbus.vmbgpo.label = VMBGPO thing-type.velbus.vmbgpo.description = Glass control module with oled display thing-type.velbus.vmbgpod-2.label = VMBGPOD-2 @@ -669,6 +699,8 @@ channel-group-type.velbus.4channelAnalogInputModule.label = Analog Input channel-group-type.velbus.4channelAnalogInputModule.description = This is a generic analog module with 4 input channels. channel-group-type.velbus.4channelAnalogOutputModule.label = Analog Input channel-group-type.velbus.4channelAnalogOutputModule.description = This is a generic analog module with 4 output channels. +channel-group-type.velbus.4channelButtonModule.label = Button +channel-group-type.velbus.4channelButtonModule.description = This is a generic module with 4 button channels. 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 diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml index 80aec0ab55ce8..920a2e7254567 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/thing/thing-types.xml @@ -204,6 +204,22 @@ + + + + + + + + 2-channel blind control module with extended possibilities + + + + + + + + @@ -293,6 +309,25 @@ + + + + + + + + 4-channel relay module with voltage outputs + + + + + + + + + + + @@ -312,6 +347,25 @@ + + + + + + + + 4-channel relay module with potential-free contacts + + + + + + + + + + + @@ -346,6 +400,24 @@ + + + + + + + + 6 button interface module + + + + + + + + + + @@ -483,6 +555,29 @@ + + + + + + + + Edge-lit one touch button module + + + + + + + + + + 1 + + + + + @@ -506,6 +601,29 @@ + + + + + + + + Edge-lit two touch buttons module + + + + + + + + + + 1 + + + + + @@ -529,6 +647,29 @@ + + + + + + + + Edge-lit four touch buttons module + + + + + + + + + + 1 + + + + + @@ -553,6 +694,30 @@ + + + + + + + + Edge-lit touch panel with Oled display + + + + + + + + + + + 1 + + + + + @@ -576,6 +741,29 @@ + + + + + + + + Edge-lit Motion detector with four touch button + + + + + + + + + + 1 + + + + + @@ -595,6 +783,25 @@ + + + + + + + + Glass control module with 1 touch key + + + + + + + + + + + @@ -633,6 +840,25 @@ + + + + + + + + Glass control module with 2 touch keys + + + + + + + + + + + @@ -690,6 +916,25 @@ + + + + + + + + Glass control module with 4 touch keys + + + + + + + + + + + @@ -728,6 +973,25 @@ + + + + + + + + Glass control module with 4 touch keys and built-in motion and twilight sensor + + + + + + + + + + + @@ -748,6 +1012,26 @@ + + + + + + + + Glass control module with oled display + + + + + + + + + + + + @@ -961,6 +1245,28 @@ + + + + + + + + DALI gateway module + + + + + + + + + + + + + + String @@ -1615,6 +1921,18 @@ + + + + This is a generic module with 4 button channels. + + + + + + + + From a5f13e50eee5628dac934156d57affa06bbee2ce Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 17 Jan 2024 23:14:11 +0100 Subject: [PATCH 19/28] [velbus] Fix codestyle Signed-off-by: Daniel Rosengarten --- .../internal/handler/VelbusSensorWithAlarmClockHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java index 6bf1062aae49a..f4933c13bff66 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorWithAlarmClockHandler.java @@ -51,7 +51,6 @@ public class VelbusSensorWithAlarmClockHandler extends VelbusSensorHandler { THING_TYPE_VMBVP1, THING_TYPE_VMBKP, THING_TYPE_VMBIN, THING_TYPE_VMB4PB, THING_TYPE_VMB6PB_20)); private static final HashMap ALARM_CONFIGURATION_MEMORY_ADDRESSES = new HashMap<>(); - static { ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMB2PBN, 0x0093); ALARM_CONFIGURATION_MEMORY_ADDRESSES.put(THING_TYPE_VMB4AN, 0x0046); From 13aea1e0b3c18b29aba3d559d609006aa5b6ebac Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Wed, 17 Jan 2024 23:24:46 +0100 Subject: [PATCH 20/28] [velbus] Copyright update Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 2 ++ .../org/openhab/binding/velbus/internal/VelbusColorChannel.java | 2 +- .../binding/velbus/internal/VelbusVirtualColorChannel.java | 2 +- .../binding/velbus/internal/handler/VelbusVMBDALIHandler.java | 2 +- .../velbus/internal/packets/VelbusDaliRequestPacket.java | 2 +- .../binding/velbus/internal/packets/VelbusSetColorPacket.java | 2 +- .../binding/velbus/internal/packets/VelbusSetDimPacket.java | 2 +- .../binding/velbus/internal/packets/VelbusSetScenePacket.java | 2 +- 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 2c3588827960f..97be578fdcd98 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -267,9 +267,11 @@ The configuration is set like this: ```java Thing velbus:vmbdali:: [VL1="R,G,B,W"] ``` + The white channel is optional. e.g.: + ```java Thing velbus:vmbdali:1:01 [VL1="CH1,CH2,CH3,CH4", VL2="A4,A5,A6"] ``` diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java index 4fbc951e2f84e..8af7148480fc1 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2023 Contributors to the openHAB project + * Copyright (c) 2010-2024 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java index 4e9c88873793f..f91028337115e 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2023 Contributors to the openHAB project + * Copyright (c) 2010-2024 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java index 47da607ac1ea9..289a298c9d443 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2023 Contributors to the openHAB project + * Copyright (c) 2010-2024 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDaliRequestPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDaliRequestPacket.java index 2e976b258af08..ad47f58ca1d88 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDaliRequestPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDaliRequestPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2023 Contributors to the openHAB project + * Copyright (c) 2010-2024 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetColorPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetColorPacket.java index a87c3e0d31647..dd33b74d5825f 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetColorPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetColorPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2023 Contributors to the openHAB project + * Copyright (c) 2010-2024 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetDimPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetDimPacket.java index 5ff1b9ff62129..2e60a2f09ed69 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetDimPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetDimPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2023 Contributors to the openHAB project + * Copyright (c) 2010-2024 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetScenePacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetScenePacket.java index 13e2c851bbefb..8db1c5617b8c1 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetScenePacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSetScenePacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2023 Contributors to the openHAB project + * Copyright (c) 2010-2024 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. From 89c04aa884baab91858857307fd1f9ffe1e37a31 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Tue, 30 Jan 2024 16:28:33 +0100 Subject: [PATCH 21/28] [velbus] Fix update instructions Added missing bundle reference in channel type. Signed-off-by: Daniel Rosengarten --- .../src/main/resources/OH-INF/update/instructions.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml index 99b287fa63212..188e629e941f9 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml @@ -6,7 +6,7 @@ - switch + velbus:switch @@ -14,7 +14,7 @@ - switch + velbus:switch @@ -22,7 +22,7 @@ - switch + velbus:switch @@ -30,7 +30,7 @@ - switch + velbus:switch From 58ac264ab3946e01147c646dabb0149ae2d6e546 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Mon, 8 Apr 2024 23:23:04 +0200 Subject: [PATCH 22/28] [velbus] Disable push button events on sensor address for new modules Disable push button events on sensor address for new modules *-20. Signed-off-by: Daniel Rosengarten --- .../handler/VelbusThermostatHandler.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java index 3a717aa7335a5..08603c83199fc 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThermostatHandler.java @@ -254,8 +254,9 @@ public boolean onPacketReceived(byte[] packet) { } else if (command == COMMAND_PUSH_BUTTON_STATUS) { ThingTypeUID thingTypeUID = this.thing.getThingTypeUID(); if (thingTypeUID.equals(THING_TYPE_VMBELO) || thingTypeUID.equals(THING_TYPE_VMBGPO) - || thingTypeUID.equals(THING_TYPE_VMBGPOD) || thingTypeUID.equals(THING_TYPE_VMBGPOD_2)) { - // modules VMBELO, VMBGPO, VMBGPOD, VMBGPOD_2 use sub-address 4 for sensor + || thingTypeUID.equals(THING_TYPE_VMBGPOD) || thingTypeUID.equals(THING_TYPE_VMBGPOD_2) + || thingTypeUID.equals(THING_TYPE_VMBGPO_20)) { + // modules VMBELO, VMBGPO, VMBGPOD, VMBGPOD_2, VMBGPO_20 use sub-address 4 for sensor if (address == this.getModuleAddress().getSubAddresses()[3]) { byte outputChannelsJustActivated = packet[5]; byte outputChannelsJustDeactivated = packet[6]; @@ -264,13 +265,20 @@ public boolean onPacketReceived(byte[] packet) { triggerThermostatChannels(outputChannelsJustDeactivated, CommonTriggerEvents.RELEASED); } // modules VMBEL1, VMBEL2, VMBEL4, VMBELPIR, VMBGP1, VMBGP1-2, VMBGP2, VMBGP2-2, VMBGP4, VMBGP4-2, - // VMBGP4PIR, VMBGP4PIR-2 use sub-address 1 for sensor, wich is not usable as push button + // VMBGP4PIR, VMBGP4PIR-2, VMBEL1-20, VMBEL2-20, VMBEL4-20, VMBELO-20, VMBGP1-20, VMBGP2-20, + // VMBGP4-20, VMBEL4PIR-20, VMBGP4PIR-20 use sub-address 1 for sensor, wich is not usable as push + // button } else if (thingTypeUID.equals(THING_TYPE_VMBEL1) || thingTypeUID.equals(THING_TYPE_VMBEL2) || thingTypeUID.equals(THING_TYPE_VMBEL4) || thingTypeUID.equals(THING_TYPE_VMBELPIR) || thingTypeUID.equals(THING_TYPE_VMBGP1) || thingTypeUID.equals(THING_TYPE_VMBGP1_2) || thingTypeUID.equals(THING_TYPE_VMBGP2) || thingTypeUID.equals(THING_TYPE_VMBGP2_2) || thingTypeUID.equals(THING_TYPE_VMBGP4) || thingTypeUID.equals(THING_TYPE_VMBGP4_2) - || thingTypeUID.equals(THING_TYPE_VMBGP4PIR) || thingTypeUID.equals(THING_TYPE_VMBGP4PIR_2)) { + || thingTypeUID.equals(THING_TYPE_VMBGP4PIR) || thingTypeUID.equals(THING_TYPE_VMBGP4PIR_2) + || thingTypeUID.equals(THING_TYPE_VMBEL1_20) || thingTypeUID.equals(THING_TYPE_VMBEL2_20) + || thingTypeUID.equals(THING_TYPE_VMBEL4_20) || thingTypeUID.equals(THING_TYPE_VMBELO_20) + || thingTypeUID.equals(THING_TYPE_VMBGP1_20) || thingTypeUID.equals(THING_TYPE_VMBGP2_20) + || thingTypeUID.equals(THING_TYPE_VMBGP4_20) || thingTypeUID.equals(THING_TYPE_VMBEL4PIR_20) + || thingTypeUID.equals(THING_TYPE_VMBGP4PIR_20)) { if (address != this.getModuleAddress().getAddress()) { byte outputChannelsJustActivated = packet[5]; byte outputChannelsJustDeactivated = packet[6]; From e978b2996c9d2483d40b2a9502cd237310d06a82 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 28 Apr 2024 21:39:02 +0200 Subject: [PATCH 23/28] Update bundles/org.openhab.binding.velbus/README.md Co-authored-by: lsiepel Signed-off-by: Daniel Rosengarten --- bundles/org.openhab.binding.velbus/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 97be578fdcd98..8f9bc74c66092 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -258,7 +258,8 @@ xidel -e 'let $refs := ( | `dimspeed` | `vmb1dm`, `vmb1led`, `vmb4dc`, `vmbdme`, `vmbdmi`, `vmbdmir` | The time (in seconds) needed for dimming from 0 to 100%. | | `refresh` | `vmb1ts`, `vmb4an`, `vmb7in`, `vmbel1`, `vmbel2`, `vmbel4`, `vmbelpir`, `vmbgp1`, `vmbgp1-2`, `vmbgp2`, `vmbgp2-2`, `vmbgp4`, `vmbgp4-2`, `vmbgp4pir`, `vmbgp4pir-2`, `vmbmeteo`, `vmbpirc`, `vmbpirm`, `vmbpiro` | Refresh interval for sensors or counters (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled. | -The `vmbdali` and `vmbdali-20` things have 16 virtual light channels. A virtual light combines 3 or 4 VMBDALI module channels into an OpenHAB channel to control RGB or RGBW lights. +The `vmbdali` and `vmbdali-20` things have 16 virtual light channels. +A virtual light combines 3 or 4 VMBDALI module channels into an openHAB channel to control RGB or RGBW lights. This is because an RGBW DALI light is configured on the VMBDALI module with 4 channels (Red channel, Green channel, Blue channel, White channel). The channels of the virtual light can be identified by a module channel `CH1` ... `CH64` or a DALI address `A0` ... `A63`. From 3e681977d7bb63c9c0ff5f35df1f089439e10746 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 28 Apr 2024 21:47:12 +0200 Subject: [PATCH 24/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java Co-authored-by: lsiepel Signed-off-by: Daniel Rosengarten --- .../binding/velbus/internal/handler/VelbusVMBELHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java index 0678eab6afdb0..391d63bb4c086 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELHandler.java @@ -65,8 +65,8 @@ public void handleCommand(ChannelUID channelUID, Command command) { byte[] packetBytes = packet.getBytes(); velbusBridgeHandler.sendPacket(packetBytes); - } else if (command instanceof OnOffType) { - byte commandByte = determineCommandByte((OnOffType) command); + } else if (command instanceof OnOffType commandAsOnOffType) { + byte commandByte = determineCommandByte(commandAsOnOffType); VelbusRelayPacket packet = new VelbusRelayPacket(getModuleAddress(), commandByte); From 296b2292a8af8e857d98cbbadbd4e1cd8b60003d Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 28 Apr 2024 21:47:25 +0200 Subject: [PATCH 25/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java Co-authored-by: lsiepel Signed-off-by: Daniel Rosengarten --- .../binding/velbus/internal/handler/VelbusVMBELOHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java index 8ac6b385215a9..6b6d6d5a23cf9 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBELOHandler.java @@ -64,8 +64,8 @@ public void handleCommand(ChannelUID channelUID, Command command) { byte[] packetBytes = packet.getBytes(); velbusBridgeHandler.sendPacket(packetBytes); - } else if (command instanceof OnOffType) { - byte commandByte = determineCommandByte((OnOffType) command); + } else if (command instanceof OnOffType commandAsOnOffType) { + byte commandByte = determineCommandByte(commandAsOnOffType); VelbusRelayPacket packet = new VelbusRelayPacket(getModuleAddress(), commandByte); From ff2a1b2aede923a828e62782814a7d9359b8b2ae Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 28 Apr 2024 21:47:48 +0200 Subject: [PATCH 26/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java Co-authored-by: lsiepel Signed-off-by: Daniel Rosengarten --- .../binding/velbus/internal/handler/VelbusVMBDALIHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java index 289a298c9d443..14eaada165138 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -100,7 +100,7 @@ private void initializeVirtualLight() { try { virtualColorChannels[i - 1] = new VelbusVirtualColorChannel(virtualLight); } catch (Exception e) { - logger.error("VMBDALI on address {} : Virtual Light {} has wrong channel format '{}'. {}", + logger.warn("VMBDALI on address {} : Virtual Light {} has wrong channel format '{}'. {}", getModuleAddress().getAddress(), i, virtualLight, e.getMessage()); } } From 9eda04971f54aedae3025590da78c89991a66aae Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 28 Apr 2024 21:48:14 +0200 Subject: [PATCH 27/28] Update bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java Co-authored-by: lsiepel Signed-off-by: Daniel Rosengarten --- .../binding/velbus/internal/handler/VelbusVMBDALIHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java index 14eaada165138..33b9029d19c91 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -126,6 +126,7 @@ public void dispose() { final ScheduledFuture refreshJob = this.refreshJob; if (refreshJob != null) { refreshJob.cancel(true); + this.refreshJob = null; } } From 5fe388c87899513439fd09c52807c16f9dec7407 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 28 Apr 2024 22:35:03 +0200 Subject: [PATCH 28/28] Update VelbusVMBDALIHandler.java Signed-off-by: Daniel Rosengarten --- .../binding/velbus/internal/handler/VelbusVMBDALIHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java index 33b9029d19c91..e8c6bcb80f020 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -126,7 +126,7 @@ public void dispose() { final ScheduledFuture refreshJob = this.refreshJob; if (refreshJob != null) { refreshJob.cancel(true); - this.refreshJob = null; + this.refreshJob = null; } }