From bd2dcba1ce9b1f6d41acb7ccafa8ed4ac934d072 Mon Sep 17 00:00:00 2001 From: Daniel Rosengarten Date: Sun, 28 Apr 2024 22:55:54 +0200 Subject: [PATCH] [velbus] New functionality and bug fix (#15661) * [velbus] New functionnality & Bug fix Signed-off-by: Daniel Rosengarten Co-authored-by: Simonas Kazlauskas Co-authored-by: lsiepel --- bundles/org.openhab.binding.velbus/README.md | 210 ++-- .../internal/VelbusBindingConstants.java | 131 ++- .../velbus/internal/VelbusColorChannel.java | 263 +++++ .../velbus/internal/VelbusHandlerFactory.java | 4 + .../velbus/internal/VelbusModuleAddress.java | 41 +- .../velbus/internal/VelbusPacketListener.java | 3 +- .../internal/VelbusVirtualColorChannel.java | 170 ++++ .../VelbusThingDiscoveryService.java | 102 +- .../internal/handler/VelbusBlindsHandler.java | 12 +- .../internal/handler/VelbusBridgeHandler.java | 59 +- .../internal/handler/VelbusDimmerHandler.java | 8 +- .../internal/handler/VelbusRelayHandler.java | 13 +- .../handler/VelbusRelayWithInputHandler.java | 8 +- .../internal/handler/VelbusSensorHandler.java | 27 +- .../VelbusSensorWithAlarmClockHandler.java | 144 +-- .../VelbusTemperatureSensorHandler.java | 11 +- .../handler/VelbusThermostatHandler.java | 114 ++- .../internal/handler/VelbusThingHandler.java | 29 +- .../internal/handler/VelbusVMB4ANHandler.java | 11 +- .../internal/handler/VelbusVMB7INHandler.java | 11 +- .../handler/VelbusVMBDALIHandler.java | 400 ++++++++ .../internal/handler/VelbusVMBELHandler.java | 68 +- .../internal/handler/VelbusVMBELOHandler.java | 68 +- .../internal/handler/VelbusVMBGPHandler.java | 3 +- .../internal/handler/VelbusVMBGPOHandler.java | 12 +- .../handler/VelbusVMBMeteoHandler.java | 10 +- .../handler/VelbusVMBPIROHandler.java | 10 +- .../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 | 714 +++++++++++++ .../resources/OH-INF/i18n/velbus.properties | 488 +++++++++ .../resources/OH-INF/thing/thing-types.xml | 939 +++++++++++++++++- .../resources/OH-INF/update/instructions.xml | 38 + 36 files changed, 4008 insertions(+), 321 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 create mode 100644 bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml diff --git a/bundles/org.openhab.binding.velbus/README.md b/bundles/org.openhab.binding.velbus/README.md index 873babc8d8f1..8f9bc74c6609 100644 --- a/bundles/org.openhab.binding.velbus/README.md +++ b/bundles/org.openhab.binding.velbus/README.md @@ -31,59 +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 | -| 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 @@ -242,8 +258,29 @@ 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. +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: + +```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"] +``` + ## 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. @@ -257,7 +294,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`. @@ -265,9 +302,9 @@ 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. +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`. @@ -277,17 +314,16 @@ 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:clockAlarm1Type`, `clockAlarm:clockAlarm1WakeupHour`, `clockAlarm:clockAlarm1WakeupMinute`, `clockAlarm:clockAlarm1BedtimeHour`, `clockAlarm:clockAlarm1BedtimeMinute`, `clockAlarm:clockAlarm2Enabled`, `clockAlarm:clockAlarm2Type`, `clockAlarm:clockAlarm2WakeupHour`, `clockAlarm:clockAlarm2WakeupMinute`, `clockAlarm:clockAlarm2BedtimeHour` and `clockAlarm:clockAlarm2BedtimeMinute`. +8 trigger channels on channels `input#CH1` ... `input#CH8`. +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`. +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`. @@ -297,29 +333,41 @@ 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`. -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`. +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`, `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`, `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`. -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` 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`. -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 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. +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`. @@ -386,7 +434,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 b9a8bd870654..6504119e2c03 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,22 @@ 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"); + 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, @@ -98,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_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; @@ -114,6 +134,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 +173,22 @@ 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; + 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; @@ -161,11 +198,24 @@ 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_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; + 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 +260,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; + + // 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; + 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 +283,60 @@ 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"; + // 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"; + 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_WHITE = "white"; + 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 000000000000..8af7148480fc --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusColorChannel.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) 2010-2024 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) { + setBrightness(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 = convertFromVelbus(Byte.toUnsignedInt(brightness), Byte.toUnsignedInt(DALI_MAX_VALUE), + BRIGHTNESS_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 convertToVelbus(this.brightness, BRIGHTNESS_MAX_VALUE, Byte.toUnsignedInt(DALI_MAX_VALUE)); + } + + /** + * @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) { + setColor(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] = convertFromVelbus(Byte.toUnsignedInt(red), DALI_MAX_VALUE, COLOR_MAX_VALUE); + } + } + + /** + * @param green the green value to set from velbus packet + */ + public void setGreenColor(byte green) { + if (green != VALUE_UNCHANGED) { + this.color[1] = convertFromVelbus(Byte.toUnsignedInt(green), DALI_MAX_VALUE, COLOR_MAX_VALUE); + } + } + + /** + * @param blue the blue value to set from velbus packet + */ + public void setBlueColor(byte blue) { + if (blue != VALUE_UNCHANGED) { + this.color[2] = convertFromVelbus(Byte.toUnsignedInt(blue), DALI_MAX_VALUE, COLOR_MAX_VALUE); + } + } + + /** + * @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] = 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; + } + + /** + * @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) { + setWhite(whiteState.intValue()); + } + + /** + * @param white the white to set from velbus packet + */ + public void setWhite(byte white) { + if (white != VALUE_UNCHANGED) { + this.white = convertFromVelbus(Byte.toUnsignedInt(white), Byte.toUnsignedInt(DALI_MAX_VALUE), + WHITE_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 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/VelbusHandlerFactory.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java index ba48a7f86293..bcbb9510afc3 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 3e8d13979ad6..9196738f8c8a 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/VelbusPacketListener.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java index 9ce91362ebc5..0d1a0846fdd3 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 new file mode 100644 index 000000000000..f91028337115 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusVirtualColorChannel.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2010-2024 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 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; + 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 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*([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 number of channels, must be 3 or 4."); + } + } + + 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) { + return Integer.valueOf(channel).byteValue(); + } + + public byte getRedChannel() { + return redChannel; + } + + public byte getGreenChannel() { + return greenChannel; + } + + public byte getBlueChannel() { + return blueChannel; + } + + public byte getWhiteChannel() { + return whiteChannel; + } + + public boolean isVirtualColorChannel(int channel) { + byte c = getByteValue(channel); + + return c == redChannel || c == greenChannel || c == blueChannel || c == whiteChannel; + } + + public boolean isColorChannel(int channel) { + byte c = getByteValue(channel); + + return c == redChannel || c == greenChannel || c == blueChannel; + } + + public boolean isWhiteChannel(int channel) { + byte c = getByteValue(channel); + + return c == whiteChannel; + } + + public boolean isRGBConfigured() { + return redChannel != NOT_CONFIGURED && greenChannel != NOT_CONFIGURED && blueChannel != NOT_CONFIGURED; + } + + public boolean isWhiteConfigured() { + return whiteChannel != NOT_CONFIGURED; + } + + 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); + } else if (c == whiteChannel) { + setWhite(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 fd024d2201d2..a276a8dbba6a 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 @@ -43,6 +43,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 */ @Component(scope = ServiceScope.PROTOTYPE, service = VelbusThingDiscoveryService.class) @NonNullByDefault @@ -76,7 +77,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]; @@ -91,12 +92,17 @@ 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)); } } + return true; } private void handleModuleTypeCommand(byte[] packet, byte address) { @@ -155,6 +161,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); @@ -175,10 +185,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); @@ -187,6 +205,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); @@ -216,57 +238,93 @@ 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_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, 4), moduleType, highByteOfSerialNumber, + 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, 4), moduleType, highByteOfSerialNumber, + 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_VMBELPIR: + 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, 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_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, 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_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, 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_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, 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_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); @@ -279,6 +337,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); @@ -315,6 +377,14 @@ 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; + 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) { @@ -322,14 +392,14 @@ 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, 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 5566ee8dc9aa..090f7fe757ba 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); @@ -128,8 +128,10 @@ private Boolean isFirstGenerationDevice() { } @Override - public void onPacketReceived(byte[] packet) { - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -144,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/VelbusBridgeHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java index 3453870fd399..e0cead60cd0c 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 a6621d327698..42892ac75467 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 @@ -104,8 +104,10 @@ private Boolean isFirstGenerationDevice() { } @Override - public void onPacketReceived(byte[] packet) { - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte address = packet[2]; @@ -126,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 18cbe39aceae..5265d4803f7b 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); @@ -79,8 +80,10 @@ private byte determineCommandByte(OnOffType command) { } @Override - public void onPacketReceived(byte[] packet) { - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -95,5 +98,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 9b30f797d743..9fb4a66d6be6 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 @@ -93,8 +93,10 @@ private boolean isTriggerChannel(byte address, byte channel) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -118,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 3d9e2abdf51e..8c541d2af47c 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 @@ -99,19 +99,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 +121,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) { + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } + logger.trace("onPacketReceived() was called"); if (packet[0] == VelbusPacket.STX && packet.length >= 5) { @@ -144,7 +148,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 +157,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,11 +166,14 @@ 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); } } } } + + 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 aadd8621dee3..f4933c13bff6 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); @@ -82,6 +82,19 @@ 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); + 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; @@ -93,26 +106,30 @@ 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(); @@ -158,52 +175,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); @@ -256,10 +273,10 @@ public synchronized void sendAlarmPacket(int alarmNumber, byte[] packetBytes) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -303,6 +320,8 @@ public void onPacketReceived(byte[] packet) { } } } + + return true; } public Boolean isClockAlarmConfigurationByte(int memoryAddress) { @@ -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 f6d652575ee1..a98304d74f48 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 @@ -74,6 +74,7 @@ public void dispose() { if (refreshJob != null) { refreshJob.cancel(true); } + super.dispose(); } private void startAutomaticRefresh(int refreshInterval) { @@ -114,10 +115,10 @@ protected void sendSensorReadoutRequest(VelbusBridgeHandler velbusBridgeHandler) } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -133,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 0e8a03c7f183..08603c83199f 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; @@ -58,34 +59,44 @@ 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); @@ -154,8 +165,10 @@ public void handleCommand(ChannelUID channelUID, Command command) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } logger.trace("onPacketReceived() was called"); @@ -238,14 +251,47 @@ 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) + || 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]; + + 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, 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_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]; + + triggerThermostatChannels(outputChannelsJustActivated, CommonTriggerEvents.PRESSED); + triggerThermostatChannels(outputChannelsJustDeactivated, CommonTriggerEvents.RELEASED); + } + } - triggerThermostatChannels(outputChannelsJustActivated, CommonTriggerEvents.PRESSED); - triggerThermostatChannels(outputChannelsJustDeactivated, CommonTriggerEvents.RELEASED); } } + + 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 00d6e5778676..a68f87662b9e 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 @@ -152,7 +162,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; + } } } @@ -237,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 b827ad63052f..39c0d9b75053 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 @@ -93,6 +93,7 @@ public void dispose() { if (refreshJob != null) { refreshJob.cancel(true); } + super.dispose(); } private void startAutomaticRefresh(int refreshInterval) { @@ -143,10 +144,10 @@ protected void sendSensorReadoutRequest(VelbusBridgeHandler velbusBridgeHandler, } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -210,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 a0e40d27bc6c..29e8e6c5a723 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 @@ -85,6 +85,7 @@ public void dispose() { if (refreshJob != null) { refreshJob.cancel(true); } + super.dispose(); } private void startAutomaticRefresh(int refreshInterval) { @@ -131,10 +132,10 @@ protected void sendCounterStatusRequest(VelbusBridgeHandler velbusBridgeHandler, } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -175,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 new file mode 100644 index 000000000000..e8c6bcb80f02 --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBDALIHandler.java @@ -0,0 +1,400 @@ +/** + * Copyright (c) 2010-2024 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, THING_TYPE_VMBDALI_20)); + private @Nullable ScheduledFuture refreshJob; + private @NonNullByDefault({}) VelbusSensorConfig sensorConfig; + + 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(); + 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.warn("VMBDALI on address {} : Virtual Light {} has wrong channel format '{}'. {}", + getModuleAddress().getAddress(), i, virtualLight, e.getMessage()); + } + } + } + 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); + this.refreshJob = null; + } + } + + 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) + || isWhiteGroupChannel(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) + || isWhiteGroupChannel(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 (isWhiteGroupChannel(channelUID)) { + if (command instanceof PercentType percentCommand) { + int channelNumber = getModuleAddress().getChannelNumber(channelUID); + boolean isVirtualLight = false; + + 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 + "'."); + } + } 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 isWhiteGroupChannel(ChannelUID channelUID) { + return CHANNEL_GROUP_WHITE.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 boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } + + 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()); + updateVirtualLightState(channel, packet[7]); + } 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 white = new ChannelUID(thing.getUID(), CHANNEL_GROUP_WHITE, CHANNEL + channel); + colorChannel.setWhite(packet[11]); + updateState(white, 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()); + updateVirtualLightState(i, packet[7]); + } + } else if (packet.length >= 12) { + VelbusColorChannel colorChannel; + ChannelUID brightness; + ChannelUID color; + ChannelUID white; + 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()); + + white = new ChannelUID(thing.getUID(), CHANNEL_GROUP_WHITE, CHANNEL + i); + colorChannel.setWhite(packet[11]); + updateState(white, 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]; + + 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; + + 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()); + updateVirtualLightState(i, packet[6]); + } + } + } + } + + return true; + } + + 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/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 0948989974f8..391d63bb4c08 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,85 @@ 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)); + 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); 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 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 commandAsOnOffType) { + byte commandByte = determineCommandByte(commandAsOnOffType); + + 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 boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } + + 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); + } + } + + 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 1ea9602ca61a..6b6d6d5a23cf 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,91 @@ */ 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)); + 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); public VelbusVMBELOHandler(Thing thing) { super(thing); } + + @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 commandAsOnOffType) { + byte commandByte = determineCommandByte(commandAsOnOffType); + + 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 boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } + + 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); + } + } + + return true; + } } 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 45797ef6e7c1..ed8ce97ca213 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 8a926d52de3c..6374dc8c6e70 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; @@ -74,10 +74,10 @@ public void handleCommand(ChannelUID channelUID, Command command) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -101,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 8add52e7d015..41f7c2ad3e46 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 @@ -104,10 +104,10 @@ protected int getClockAlarmAndProgramSelectionIndexInModuleStatus() { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -133,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 9b9f7adcb3e4..784701fd7024 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 @@ -73,10 +73,10 @@ public void handleCommand(ChannelUID channelUID, Command command) { } @Override - public void onPacketReceived(byte[] packet) { - super.onPacketReceived(packet); - - logger.trace("onPacketReceived() was called"); + public boolean onPacketReceived(byte[] packet) { + if (!super.onPacketReceived(packet)) { + return false; + } if (packet[0] == VelbusPacket.STX && packet.length >= 5) { byte command = packet[4]; @@ -90,5 +90,7 @@ public void onPacketReceived(byte[] packet) { updateState(illuminanceChannel, lightValueState); } } + + return true; } } 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 000000000000..ad47f58ca1d8 --- /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-2024 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 0f899ed94a99..e3b7c1270b79 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 000000000000..dd33b74d5825 --- /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-2024 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 000000000000..2e60a2f09ed6 --- /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-2024 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 000000000000..8db1c5617b8c --- /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-2024 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 cd7ab69b0cab..730eddd9de17 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,12 @@ The velbus address of the device + + + The velbus sub-address of the device (FF = disabled). In the VelbusLink application it's identified by + Sensor or Thermostat. + FF + Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no @@ -690,6 +696,30 @@ The velbus address of the device + + + 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). 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). 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). In the VelbusLink application it's identified by + Sensor or Thermostat. + FF + Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no @@ -896,4 +926,688 @@ true + + + + + 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). 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). 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). 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). 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). 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). 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). 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). 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). In the VelbusLink application it's identified by + DALI Group G8..G15 or Channel CH73..CH80. + 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 fba843337328..3b4686df9a9c 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,38 +65,62 @@ 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 thing-type.velbus.vmbdme.description = Dimmer for electronic/resistive load 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 @@ -244,6 +276,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 = 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 @@ -372,6 +412,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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 +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 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 @@ -412,6 +668,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 = 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 @@ -419,10 +677,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 @@ -437,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 @@ -451,6 +715,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.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 @@ -546,6 +822,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 +845,213 @@ 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 + +# 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 +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 a4633a69f9ae..920a2e725456 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 - + @@ -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 + + + + + + + + + + @@ -473,8 +545,35 @@ + + + 1 + + + + + + + + + + + + + Edge-lit one touch button module + + + + + + + + + + 1 + @@ -492,8 +591,35 @@ + + + + + 1 + + + + + + + + + + + + + Edge-lit two touch buttons module + + + + + + + + 1 + @@ -511,8 +637,35 @@ + + + + + 1 + + + + + + + + + + + + + Edge-lit four touch buttons module + + + + + + + + 1 + @@ -530,9 +683,37 @@ + + + 1 + + + + + + + + + + + + + Edge-lit touch panel with Oled display + + + + + + + + + + + 1 + @@ -550,8 +731,35 @@ + + + + + 1 + + + + + + + + + + + + + Edge-lit Motion detector with four touch button + + + + + + + + 1 + @@ -575,6 +783,25 @@ + + + + + + + + Glass control module with 1 touch key + + + + + + + + + + + @@ -613,6 +840,25 @@ + + + + + + + + Glass control module with 2 touch keys + + + + + + + + + + + @@ -670,6 +916,25 @@ + + + + + + + + Glass control module with 4 touch keys + + + + + + + + + + + @@ -708,6 +973,25 @@ + + + + + + + + Glass control module with 4 touch keys and built-in motion and twilight sensor + + + + + + + + + + + @@ -728,6 +1012,26 @@ + + + + + + + + Glass control module with oled display + + + + + + + + + + + + @@ -919,6 +1223,50 @@ + + + + + + + + DALI gateway module + + + + + + + + + + + + + + + + + + + + + + DALI gateway module + + + + + + + + + + + + + + String @@ -1085,7 +1433,8 @@ Currently measured wind speed Wind - + + trigger @@ -1108,6 +1457,14 @@ + + Number + + Scene options for DALI network + + + + This is a generic module with 8 input channels and a temperature sensor. @@ -1268,6 +1625,102 @@ + + + This is a generic module with 81 input channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is a generic module with 1 output. + + + + + @@ -1369,6 +1822,95 @@ + + + + This is a generic module with 81 feedback channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1379,6 +1921,18 @@ + + + + This is a generic module with 4 button channels. + + + + + + + + @@ -1462,6 +2016,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 white color channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is a generic module with 81 scene channels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is a generic module with 16 virtual light channels. + + + + + + + + + + + + + + + + + + + + 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 000000000000..188e629e941f --- /dev/null +++ b/bundles/org.openhab.binding.velbus/src/main/resources/OH-INF/update/instructions.xml @@ -0,0 +1,38 @@ + + + + + + + velbus:switch + + + + + + + + velbus:switch + + + + + + + + velbus:switch + + + + + + + + velbus:switch + + + + +