diff --git a/bundles/org.openhab.binding.shelly/README.md b/bundles/org.openhab.binding.shelly/README.md index bb07e7b72bdc2..92577ac898e3f 100644 --- a/bundles/org.openhab.binding.shelly/README.md +++ b/bundles/org.openhab.binding.shelly/README.md @@ -1226,7 +1226,7 @@ If the Shelly Add-On is installed: The roller positioning calibration has to be performed using the Shelly Web UI or App before the position can be set in percent. Refer to [Smartify Roller Shutters with openHAB and Shelly](doc/UseCaseSmartRoller.md) for more information on roller integration. -### Shelly Plus Plug-S/IT/UK/US (thing-type: shellyplusplug) +### Shelly Plus Plug-S/IT/UK/US (thing-type: shellyplusplug, shellyplusplugus) | Group | Channel | Type | read-only | Description | | ----- | ------------ | -------- | --------- | --------------------------------------------------------------------------------- | diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java index 65956bbd93bd4..7dca98ce383f2 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java @@ -201,6 +201,7 @@ public class ShellyThingCreator { public static final String THING_TYPE_SHELLYPLUSSMOKE_STR = "shellyplussmoke"; public static final String THING_TYPE_SHELLYPLUSUNI_STR = "shellyplusuni"; public static final String THING_TYPE_SHELLYPLUSPLUGS_STR = "shellyplusplug"; + public static final String SVC_TYPE_SHELLYPLUSPLUGUS_STR = "shellyplugus"; public static final String THING_TYPE_SHELLYPLUSPLUGUS_STR = "shellyplusplugus"; public static final String THING_TYPE_SHELLYPLUSDIMMERUS_STR = "shellypluswdus"; public static final String THING_TYPE_SHELLYPLUSDIMMER10V_STR = "shellyplus10v"; @@ -515,6 +516,7 @@ public class ShellyThingCreator { Map.entry(THING_TYPE_SHELLYPLUS1PMG4_STR, THING_TYPE_SHELLYPLUS1PM_STR), Map.entry(THING_TYPE_SHELLYPLUS2PM_RELAY_STR, THING_TYPE_SHELLYPLUS2PM_RELAY_STR), Map.entry(THING_TYPE_SHELLYPLUS2PM_ROLLER_STR, THING_TYPE_SHELLYPLUS2PM_ROLLER_STR), + Map.entry(SVC_TYPE_SHELLYPLUSPLUGUS_STR, THING_TYPE_SHELLYPLUSPLUGUS_STR), Map.entry(THING_TYPE_SHELLYPLUSPLUGS_STR, THING_TYPE_SHELLYPLUSPLUGS_STR), Map.entry(THING_TYPE_SHELLYPLUSPLUGUS_STR, THING_TYPE_SHELLYPLUSPLUGUS_STR), Map.entry(THING_TYPE_SHELLYPLUSI4_STR, THING_TYPE_SHELLYPLUSI4_STR), @@ -604,7 +606,7 @@ private static String getThingTypeID(String serviceName, String deviceType, Stri if (serviceNameLowerCase.startsWith(THING_TYPE_SHELLY2_PREFIX)) { // Shelly v2 return getRelayOrRollerType(THING_TYPE_SHELLY2_RELAY_STR, THING_TYPE_SHELLY2_ROLLER_STR, mode); } - if (serviceNameLowerCase.startsWith(THING_TYPE_SHELLYPLUG_STR)) { + if (serviceNameLowerCase.startsWith(THING_TYPE_SHELLYPLUG_STR) && !serviceNameLowerCase.contains("plugus")) { // shellyplug-s needs to be mapped to shellyplugs to follow the schema // for the thing types: - if (serviceNameLowerCase.startsWith(THING_TYPE_SHELLYPLUGS_STR) || serviceNameLowerCase.contains("-s")) { diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/i18n/shelly.properties b/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/i18n/shelly.properties index 0a868d54cb146..c20a2eaff5f3c 100644 --- a/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/i18n/shelly.properties +++ b/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/i18n/shelly.properties @@ -94,7 +94,8 @@ thing-type.shelly.shellyplus1.description = Shelly Plus 1 (Single Relay Switch) thing-type.shelly.shellyplus1pm.description = Shelly Plus 1PM - Single Relay Switch with Power Meter thing-type.shelly.shellyplus2-relay.description = Shelly Plus 2PM - Dual Relay Switch with Power Meter thing-type.shelly.shellyplus2pm-roller.description = Shelly Plus 2PM - Roller Control with Power Meter -thing-type.shelly.shellyplusplug.description = Shelly Plus Plug S/IT/UK/US . Outlet with Power Meter +thing-type.shelly.shellyplusplug.description = Shelly Plus Plug S/IT/UK. Outlet with Power Meter +thing-type.shelly.shellyplusplugus.description = Shelly Plus Plug US. Outlet with Power Meter thing-type.shelly.shellyplusi4.description = Shelly Plus i4 - 4xInput Device thing-type.shelly.shellyplusi4dc.description = Shelly Plus i4DC - 4xDC Input Device thing-type.shelly.shellyplusuni.description = Shelly Plus UNI - Universal Module diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_relay.xml b/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_relay.xml index 88a65c41e5e07..46d7a2070182b 100644 --- a/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_relay.xml +++ b/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_relay.xml @@ -87,6 +87,20 @@ + + + @text/thing-type.shelly.shellyplusplugus.description + PowerOutlet + PowerOutlet + + + + + + + serviceName + + diff --git a/bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfileTest.java b/bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfileTest.java index 4be4198cea70e..a6a6dfcfc934d 100644 --- a/bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfileTest.java +++ b/bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfileTest.java @@ -91,6 +91,7 @@ private static Stream provideTestCasesForApiDetermination() { Arguments.of(THING_TYPE_SHELLYPLUS2PM_RELAY_STR, true, false), // Arguments.of(THING_TYPE_SHELLYPLUS2PM_ROLLER_STR, true, false), // Arguments.of(THING_TYPE_SHELLYPLUSPLUGS_STR, true, false), // + Arguments.of(THING_TYPE_SHELLYPLUSPLUGUS_STR, true, false), // Arguments.of(THING_TYPE_SHELLYPLUSI4_STR, true, false), // Arguments.of(THING_TYPE_SHELLYPLUSI4DC_STR, true, false), // Arguments.of(THING_TYPE_SHELLY1MINI_STR, true, false), // diff --git a/bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreatorTest.java b/bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreatorTest.java index 94a9bab45387b..9b08344e5f27d 100644 --- a/bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreatorTest.java +++ b/bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreatorTest.java @@ -89,6 +89,7 @@ private static Stream provideTestCasesForGetThingUIDReturnsThingUidAc Arguments.of("shellyplug-su1-" + DEVICE_ID, "", "", THING_TYPE_SHELLYPLUGS_STR), // Arguments.of("shellyplugu1-" + DEVICE_ID, "", "", THING_TYPE_SHELLYPLUGU1_STR), // Arguments.of("shellyplugu12-" + DEVICE_ID, "", "", THING_TYPE_SHELLYPLUGU1_STR), // + Arguments.of("shellyplugus-" + DEVICE_ID, "", "", THING_TYPE_SHELLYPLUSPLUGUS_STR), // Arguments.of("shellyrgbw2-" + DEVICE_ID, "", "color", THING_TYPE_SHELLYRGBW2_COLOR_STR), // Arguments.of("shellyrgbw2-" + DEVICE_ID, "", "", THING_TYPE_SHELLYRGBW2_WHITE_STR), // Arguments.of("shellyrgbw2-" + DEVICE_ID, "", "colour", THING_TYPE_SHELLYRGBW2_WHITE_STR), //