From a4da9863301dec962ec4cf395bce813761ed24f7 Mon Sep 17 00:00:00 2001 From: Markus Michels Date: Sun, 26 Nov 2023 00:27:03 +0100 Subject: [PATCH] [shelly] Support for Plus Dimmer 10v (#15950) * Implements #15949: Plus Dimmer 10v added * category DimmableLight does not exist; README updated --------- Signed-off-by: Markus Michels --- bundles/org.openhab.binding.shelly/README.md | 27 +++++++++++++++++++ .../discovery/ShellyThingCreator.java | 9 +++++++ .../resources/OH-INF/i18n/shelly.properties | 1 + .../OH-INF/thing/shellyGen1_lights.xml | 2 +- .../OH-INF/thing/shellyGen1_relay.xml | 4 +-- .../OH-INF/thing/shellyGen2_relay.xml | 14 +++++++++- 6 files changed, 52 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.shelly/README.md b/bundles/org.openhab.binding.shelly/README.md index fde35de2e69ee..d007aecebb813 100644 --- a/bundles/org.openhab.binding.shelly/README.md +++ b/bundles/org.openhab.binding.shelly/README.md @@ -1178,6 +1178,33 @@ Refer to [Smartify Roller Shutters with openHAB and Shelly](doc/UseCaseSmartRoll | | totalKWH | Number | yes | Total energy consumption in kwh since the device powered up (resets on restart) | | | lastUpdate | DateTime | yes | Timestamp of the last measurement | +### Shelly Plus Dimmer 10v (thing-type: shellyplus10v) + +| Group | Channel | Type | read-only | Description | +| ----- | ------------ | -------- | --------- | --------------------------------------------------------------------------------- | +| relay | brightness | Dimmer | r/w | Currently selected brightness. | +| | outputName | String | yes | Logical name of this relay output as configured in the Shelly App | +| | input1 | Switch | yes | ON: Input/Button for input 1 is powered, see general notes on channels | +| | button1 | Trigger | yes | Event trigger, see section Button Events | +| | lastEvent1 | String | yes | Last event type (S/SS/SSS/L) for input 1 | +| | eventCount1 | Number | yes | Counter gets incremented every time the device issues a button event. | +| | input2 | Switch | yes | ON: Input/Button for channel 2 is powered, see general notes on channels | +| | button2 | Trigger | yes | Event trigger, see section Button Events | +| | lastEvent2 | String | yes | Last event type (S/SS/SSS/L) for input 2 | +| | eventCount2 | Number | yes | Counter gets incremented every time the device issues a button event. | +| | autoOn | Number | r/w | Relay #1: Sets a timer to turn the device ON after every OFF command; in seconds | +| | autoOff | Number | r/w | Relay #1: Sets a timer to turn the device OFF after every ON command; in seconds | +| | timerActive | Switch | yes | Relay #1: ON: An auto-on/off timer is active | +| meter | currentWatts | Number | yes | Current power consumption in Watts | +| | lastPower1 | Number | yes | Energy consumption for a round minute, 1 minute ago | +| | totalKWH | Number | yes | Total energy consumption in kwh since the device powered up (resets on restart) | +| | lastUpdate | DateTime | yes | Timestamp of the last measurement | + +`Note: The Dimmer should be calibrated using the device Web UI or Shelly App.` + +Using the Thing configuration option `brightnessAutoOn` you could decide if the light is turned on when a brightness > 0 is set. +`true`: Brightness will be set and device output is powered = light turns on with the new brightness +`false`: Brightness will be set, but output stays unchanged so light will not be switched on when it's currently off. ### Shelly Plus i4, i4DC (thing-types: shellyplusi4, shellyplusi4dc) 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 9417205a5f9eb..3804516327469 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 @@ -80,6 +80,7 @@ public class ShellyThingCreator { public static final String SHELLYDT_PLUSHT = "SNSN-0013A"; public static final String SHELLYDT_PLUSSMOKE = "SNSN-0031Z"; public static final String SHELLYDT_PLUSDIMMERUS = "SNDM-0013US"; + public static final String SHELLYDT_PLUSDIMMER10V = "SNGW-0A11WW010"; public static final String SHELLYDT_PLUSWALLDISPLAY = "SAWD-0A1XX10EU1"; // Shelly Pro Series @@ -168,6 +169,7 @@ public class ShellyThingCreator { public static final String THING_TYPE_SHELLYPLUSPLUGS_STR = "shellyplusplug"; 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"; // Shelly Wall Display public static final String THING_TYPE_SHELLYPLUSWALLDISPLAY_STR = "shellywalldisplay"; @@ -276,6 +278,10 @@ public class ShellyThingCreator { THING_TYPE_SHELLYPLUSPLUGUS_STR); public static final ThingTypeUID THING_TYPE_SHELLYPLUSDIMMERUS = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPLUSDIMMERUS_STR); + public static final ThingTypeUID THING_TYPE_SHELLYPLUSDIMMER10V = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLYPLUSDIMMER10V_STR); + + // Shelly Wall Display public static final ThingTypeUID THING_TYPE_SHELLYPLUSWALLDISPLAY = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPLUSWALLDISPLAY_STR); @@ -356,6 +362,7 @@ public class ShellyThingCreator { THING_TYPE_MAPPING.put(SHELLYDT_PLUSHT, THING_TYPE_SHELLYPLUSHT_STR); THING_TYPE_MAPPING.put(SHELLYDT_PLUSSMOKE, THING_TYPE_SHELLYPLUSSMOKE_STR); THING_TYPE_MAPPING.put(SHELLYDT_PLUSDIMMERUS, THING_TYPE_SHELLYPLUSDIMMERUS_STR); + THING_TYPE_MAPPING.put(SHELLYDT_PLUSDIMMER10V, THING_TYPE_SHELLYPLUSDIMMER10V_STR); // Plus Mini Series THING_TYPE_MAPPING.put(SHELLYDT_MINI1, THING_TYPE_SHELLYMINI1_STR); @@ -435,6 +442,8 @@ public class ShellyThingCreator { THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSHT_STR, THING_TYPE_SHELLYPLUSHT_STR); THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSSMOKE_STR, THING_TYPE_SHELLYPLUSSMOKE_STR); THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSDIMMERUS_STR, THING_TYPE_SHELLYPLUSDIMMERUS_STR); + THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSDIMMER10V_STR, THING_TYPE_SHELLYPLUSDIMMER10V_STR); + THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSWALLDISPLAY_STR, THING_TYPE_SHELLYPLUSWALLDISPLAY_STR); THING_TYPE_MAPPING.put(THING_TYPE_SHELLYMINI1_STR, THING_TYPE_SHELLYMINI1_STR); 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 8ec3b279b7baf..2c2801bfcbc34 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 @@ -99,6 +99,7 @@ thing-type.shelly.shellyplusi4dc.description = Shelly Plus i4DC - 4xDC Input Dev thing-type.shelly.shellyplusht.description = Shelly Plus HT - Humidity and Temperature sensor with display thing-type.shelly.shellyplussmoke.description = Shelly Plus Smoke - Smoke Detector with Alarm thing-type.shelly.shellypluswdus.description = Shelly Wall Dimmer US Device +thing-type.shelly.shellyplus10v.description = Shelly Plus Dimmer 10V # Wall displays thing-type.shelly.shellywalldisplay.description = Shelly Wall Display with sensors and input/output diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_lights.xml b/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_lights.xml index 2269fa96c43d3..92313c5c503ea 100644 --- a/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_lights.xml +++ b/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_lights.xml @@ -237,7 +237,7 @@ Dimmer @text/channel-type.shelly.whiteBrightness.description - DimmableLight + Light diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_relay.xml b/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_relay.xml index c2ef67421c9a1..0a252956acb5b 100644 --- a/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_relay.xml +++ b/bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_relay.xml @@ -255,7 +255,6 @@ @text/thing-type.shelly.shellydimmer.description - DimmableLight @@ -269,7 +268,6 @@ @text/thing-type.shelly.shellydimmer2.description - DimmableLight @@ -469,7 +467,7 @@ Dimmer @text/channel-type.shelly.dimmerBrightness.description - DimmableLight + Light 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 b66b8137fc01e..1a0d7bb605152 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 @@ -357,7 +357,19 @@ @text/thing-type.shelly.shellypluswdus.description - DimmableLight + + + + + + + serviceName + + + + + + @text/thing-type.shelly.shellyplus10v.description