From 45c71a2f4be34911efa2b7889d134248ebf91175 Mon Sep 17 00:00:00 2001 From: Stefan Pledl Date: Sat, 10 Aug 2024 20:56:04 +0200 Subject: [PATCH] [enocean] Eltako FJ62 support - Add Eltako FJ62 to the list of supported rollershutters - Add support for Eltako FJ62 rollershutter RPS status response Signed-off-by: Stefan Pledl --- bundles/org.openhab.binding.enocean/README.md | 6 +- .../binding/enocean/internal/eep/EEPType.java | 4 + .../eep/F6_00/F6_00_00_EltakoFJ62.java | 106 ++++++++++++++++++ .../resources/OH-INF/i18n/enocean.properties | 7 +- .../resources/OH-INF/thing/Rollershutter.xml | 7 +- 5 files changed, 121 insertions(+), 9 deletions(-) create mode 100644 bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_00/F6_00_00_EltakoFJ62.java diff --git a/bundles/org.openhab.binding.enocean/README.md b/bundles/org.openhab.binding.enocean/README.md index 4454cfcffa5..6727e70b114 100644 --- a/bundles/org.openhab.binding.enocean/README.md +++ b/bundles/org.openhab.binding.enocean/README.md @@ -38,7 +38,7 @@ This binding is developed on and tested with the following devices - USB300 and EnOceanPi gateways - The following Eltako actuators: - FSR14 (light switch) - - FSB14 (rollershutter) + - FSB14, FJ62 (rollershutter) - FUD14 (dimmer) - FSSA-230V (smart plug) - FWZ12-65A (energy meter) @@ -93,7 +93,7 @@ Hence if your device supports one of the following EEPs the chances are good tha | automatedMeterSensor | A5-12 | 0x00-03 | counter, currentNumber, instantpower, totalusage, amrLitre, amrCubicMetre | FWZ12 | Discovery | | environmentalSensor | A5-13 | 0x01-02 | temperature, windspeed, illumination, rainStatus | FWS61 | Discovery | | centralCommand | A5-38 | 0x08 | dimmer, generalSwitch | Eltako FUD14, FSR14 | Teach-in | -| rollershutter | A5-3F/D2-05/A5-38 | 0x7F/00/08 | rollershutter | Eltako FSB14, NodOn SIN-2-RS-01| Teach-in/Discovery | +| rollershutter | A5-3F/D2-05/A5-38 | 0x7F/00/08 | rollershutter | Eltako FSB14 / FJ62, NodOn SIN-2-RS-01| Teach-in/Discovery | | measurementSwitch | D2-01 | 0x00-0F,11,12 | generalSwitch(/A/B), instantpower, totalusage, repeaterMode | NodOn In Wall Switch | Discovery | | windowSashHandleSensor | D2-06 | 0x50 | windowHandleState, windowSashState, batteryLevel, batteryLow, windowBreachEvent, windowCalibrationState, windowCalibrationStep | Siegenia Senso Secure | Discovery | | multiFunctionSmokeDetector | D2-14/F6-05 | 0x30/02 | smokeDetection, batteryLow | Insafe+, Afriso ASD | Discovery | @@ -233,7 +233,7 @@ If you change the SenderId of your thing, you have to pair again the thing with | | enoceanId | | | | | sendingEEPId | | A5_3F_7F_EltakoFSB, A5_3F_7F_EltakoFRM, A5_38_08_07, D2_05_00_NODON | | | broadcastMessages | | true, false | -| | receivingEEPId¹ | | A5_3F_7F_EltakoFSB, A5_3F_7F_EltakoFRM, A5_11_03, D2_05_00_NODON | +| | receivingEEPId¹ | | A5_3F_7F_EltakoFSB, A5_3F_7F_EltakoFRM, F6_00_00_EltakoFJ62, A5_11_03, D2_05_00_NODON | | | suppressRepeating | | true, false | | | pollingInterval | Refresh interval in seconds | Integer | | measurementSwitch | senderIdOffset | | 1-127 | diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPType.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPType.java index 3a0ed4dd85d..9a31a60888b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPType.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPType.java @@ -151,6 +151,7 @@ import org.openhab.binding.enocean.internal.eep.D2_06.D2_06_50; import org.openhab.binding.enocean.internal.eep.D2_14.D2_14_30; import org.openhab.binding.enocean.internal.eep.D2_50.D2_50; import org.openhab.binding.enocean.internal.eep.D5_00.D5_00_01; +import org.openhab.binding.enocean.internal.eep.F6_00.F6_00_00_EltakoFJ62; import org.openhab.binding.enocean.internal.eep.F6_01.F6_01_01; import org.openhab.binding.enocean.internal.eep.F6_02.F6_02_01; import org.openhab.binding.enocean.internal.eep.F6_02.F6_02_02; @@ -413,6 +414,9 @@ public enum EEPType { CentralCommandBlinds(RORG._4BS, 0x38, 0x08, false, A5_38_08_Blinds.class, THING_TYPE_ROLLERSHUTTER, 0x07, CHANNEL_ROLLERSHUTTER, CHANNEL_ANGLE, CHANNEL_TEACHINCMD), + EltakoFJ62_RPS(RORG.RPS, 0x00, 0x00, false, "EltakoFJ62", 0, F6_00_00_EltakoFJ62.class, THING_TYPE_ROLLERSHUTTER, + CHANNEL_ROLLERSHUTTER, CHANNEL_CONTACT), + // UniversalCommand(RORG._4BS, 0x3f, 0x7f, false, A5_3F_7F_Universal.class, THING_TYPE_UNIVERSALACTUATOR, // CHANNEL_GENERIC_ROLLERSHUTTER, CHANNEL_GENERIC_LIGHT_SWITCHING, CHANNEL_GENERIC_DIMMER, CHANNEL_TEACHINCMD), EltakoFSB(RORG._4BS, 0x3f, 0x7f, false, false, "EltakoFSB", 0, A5_3F_7F_EltakoFSB.class, THING_TYPE_ROLLERSHUTTER, diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_00/F6_00_00_EltakoFJ62.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_00/F6_00_00_EltakoFJ62.java new file mode 100644 index 00000000000..63524e84826 --- /dev/null +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_00/F6_00_00_EltakoFJ62.java @@ -0,0 +1,106 @@ +/** + * 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.enocean.internal.eep.F6_00; + +import static org.openhab.binding.enocean.internal.EnOceanBindingConstants.CHANNEL_CONTACT; +import static org.openhab.binding.enocean.internal.EnOceanBindingConstants.CHANNEL_ROLLERSHUTTER; + +import java.util.function.Function; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.enocean.internal.config.EnOceanChannelContactConfig; +import org.openhab.binding.enocean.internal.eep.Base._RPSMessage; +import org.openhab.binding.enocean.internal.messages.ERP1Message; +import org.openhab.core.config.core.Configuration; +import org.openhab.core.library.types.OpenClosedType; +import org.openhab.core.library.types.PercentType; +import org.openhab.core.types.Command; +import org.openhab.core.types.State; +import org.openhab.core.types.UnDefType; + +/** + * + * @author Stefan Pledl - Initial contribution + */ +@NonNullByDefault +public class F6_00_00_EltakoFJ62 extends _RPSMessage { + + static final byte UP = 0x01; + static final byte DOWN = 0x02; + static final byte OPEN = 0x70; + static final byte CLOSED = 0x50; + + public F6_00_00_EltakoFJ62() { + super(); + } + + public F6_00_00_EltakoFJ62(ERP1Message packet) { + super(packet); + } + + @Override + protected void convertFromCommandImpl(String channelId, String channelTypeId, Command command, + Function getCurrentStateFunc, @Nullable Configuration config) { + } + + @Override + protected State convertToStateImpl(String channelId, String channelTypeId, + Function getCurrentStateFunc, Configuration config) { + + switch (channelId) { + case CHANNEL_ROLLERSHUTTER: + switch (bytes[0]) { + case OPEN: + return PercentType.ZERO; + case CLOSED: + return PercentType.HUNDRED; + default: + return UnDefType.UNDEF; + } + + case CHANNEL_CONTACT: + EnOceanChannelContactConfig c = config.as(EnOceanChannelContactConfig.class); + if (c.inverted) { + switch (bytes[0]) { + case OPEN: + return OpenClosedType.CLOSED; + case CLOSED: + return OpenClosedType.OPEN; + case UP: + return OpenClosedType.CLOSED; + default: + return UnDefType.UNDEF; + } + } else { + switch (bytes[0]) { + case OPEN: + return OpenClosedType.OPEN; + case CLOSED: + return OpenClosedType.CLOSED; + case DOWN: + return OpenClosedType.CLOSED; + default: + return UnDefType.UNDEF; + } + } + } + + return UnDefType.UNDEF; + } + + @Override + public boolean isValidForTeachIn() { + return false; + } +} diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/i18n/enocean.properties b/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/i18n/enocean.properties index 8e165ddaf32..e05f94972ab 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/i18n/enocean.properties +++ b/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/i18n/enocean.properties @@ -43,7 +43,7 @@ thing-type.enocean.rockerSwitch.channel.rockerSwitchAction.label = Rocker Switch thing-type.enocean.rockerSwitch.channel.rockerswitchA.label = Rocker Switch - Channel A thing-type.enocean.rockerSwitch.channel.rockerswitchB.label = Rocker Switch - Channel B thing-type.enocean.rollershutter.label = Rollershutter Actuator -thing-type.enocean.rollershutter.description = Rollershutter like Eltako FSB14/61/71 or NodOn SIN-2-RS-01 (EEP: A5-37, D2-05) +thing-type.enocean.rollershutter.description = Rollershutter like Eltako FSB14/61/71, FJ62 or NodOn SIN-2-RS-01 (EEP: A5-37, D2-05) thing-type.enocean.roomOperatingPanel.label = Room Operating Panel thing-type.enocean.roomOperatingPanel.description = Room operating panel with different kinds of sensors (EEP: A5-10) thing-type.enocean.temperatureHumiditySensor.label = Temperature/Humidity Sensor @@ -270,16 +270,17 @@ thing-type.config.enocean.rollershutter.enoceanId.description = EnOceanId of dev thing-type.config.enocean.rollershutter.pollingInterval.label = Polling Interval thing-type.config.enocean.rollershutter.pollingInterval.description = Time in seconds after a refresh is triggered, 0 to disable thing-type.config.enocean.rollershutter.receivingEEPId.label = EEP for Receiving States -thing-type.config.enocean.rollershutter.receivingEEPId.option.A5_3F_7F_EltakoFSB = Eltako FSB14/61/71 +thing-type.config.enocean.rollershutter.receivingEEPId.option.A5_3F_7F_EltakoFSB = Eltako FSB14/61/71, FJ62 thing-type.config.enocean.rollershutter.receivingEEPId.option.A5_3F_7F_EltakoFRM = Eltako FRM60 thing-type.config.enocean.rollershutter.receivingEEPId.option.D2_05_00 = D2-05-00 Rollershutter thing-type.config.enocean.rollershutter.receivingEEPId.option.D2_05_00_NODON = NODON SIN-2-RS-01 (EEP: D2-05-00) thing-type.config.enocean.rollershutter.receivingEEPId.option.A5_11_03 = A5-11-03 Rollershutter status thing-type.config.enocean.rollershutter.receivingEEPId.option.F6_00_00 = PTM200 Rollershutter status +thing-type.config.enocean.rollershutter.receivingEEPId.option.F6_00_00_EltakoFJ62= Eltako FJ62 status thing-type.config.enocean.rollershutter.senderIdOffset.label = Sender Id thing-type.config.enocean.rollershutter.senderIdOffset.description = Id is used to generate the EnOcean Id (Int between [1-127]). If not specified the next free Id will be determined by bridge thing-type.config.enocean.rollershutter.sendingEEPId.label = EEP for Sending Commands -thing-type.config.enocean.rollershutter.sendingEEPId.option.A5_3F_7F_EltakoFSB = Eltako FSB14/61/71 +thing-type.config.enocean.rollershutter.sendingEEPId.option.A5_3F_7F_EltakoFSB = Eltako FSB14/61/71, FJ62 thing-type.config.enocean.rollershutter.sendingEEPId.option.A5_3F_7F_EltakoFRM = Eltako FRM60 thing-type.config.enocean.rollershutter.sendingEEPId.option.D2_05_00 = D2-05-00 Rollershutter thing-type.config.enocean.rollershutter.sendingEEPId.option.D2_05_00_NODON = NODON SIN-2-RS-01 (EEP: D2-05-00) diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/thing/Rollershutter.xml b/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/thing/Rollershutter.xml index 5092f25fbbf..19d1061d017 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/thing/Rollershutter.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/OH-INF/thing/Rollershutter.xml @@ -10,7 +10,7 @@ - Rollershutter like Eltako FSB14/61/71 or NodOn SIN-2-RS-01 (EEP: A5-37, D2-05) + Rollershutter like Eltako FSB14/61/71, FJ62 or NodOn SIN-2-RS-01 (EEP: A5-37, D2-05) @@ -30,7 +30,7 @@ - + @@ -46,12 +46,13 @@ - + + 4 true