]> git.basschouten.com Git - openhab-addons.git/commitdiff
[shelly] Support for Plus Dimmer 10v (#15950)
authorMarkus Michels <markus7017@gmail.com>
Sat, 25 Nov 2023 23:27:03 +0000 (00:27 +0100)
committerGitHub <noreply@github.com>
Sat, 25 Nov 2023 23:27:03 +0000 (00:27 +0100)
* Implements #15949: Plus Dimmer 10v added
* category DimmableLight does not exist; README updated

---------

Signed-off-by: Markus Michels <markus7017@gmail.com>
bundles/org.openhab.binding.shelly/README.md
bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/i18n/shelly.properties
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_lights.xml
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen1_relay.xml
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_relay.xml

index fde35de2e69ee01ce8bd58ce9a1327689d2ed130..d007aecebb813569339c62389bf08997b151c18a 100644 (file)
@@ -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)
 
index 9417205a5f9eb6aa84da032ffd89064bb8168468..38045163274698ead7e170e504c79598de59dec0 100644 (file)
@@ -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);
index 8ec3b279b7bafff7d76689c60519eba051224565..2c2801bfcbc344185adba4689e029e093a1f05be 100644 (file)
@@ -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
index 2269fa96c43d3db155b242f29b8c6ed7ac5c671c..92313c5c503ea77a8beddc34447ea908a920fa04 100644 (file)
                <item-type>Dimmer</item-type>
                <label>@text/channel-type.shelly.whiteBrightness.label</label>
                <description>@text/channel-type.shelly.whiteBrightness.description</description>
-               <category>DimmableLight</category>
+               <category>Light</category>
                <state min="0" max="100" step="1" readOnly="false"></state>
        </channel-type>
 
index c2ef67421c9a13a9701023deac62b2b11798c653..0a252956acb5bccc75efabbc02ef769bcab0dac2 100644 (file)
        <thing-type id="shellydimmer">
                <label>Shelly Dimmer</label>
                <description>@text/thing-type.shelly.shellydimmer.description</description>
-               <category>DimmableLight</category>
                <channel-groups>
                        <channel-group id="relay" typeId="dimmerChannel"/>
                        <channel-group id="meter" typeId="meter"/>
        <thing-type id="shellydimmer2">
                <label>Shelly Dimmer 2</label>
                <description>@text/thing-type.shelly.shellydimmer2.description</description>
-               <category>DimmableLight</category>
                <channel-groups>
                        <channel-group id="relay" typeId="dimmerChannel"/>
                        <channel-group id="meter" typeId="meter"/>
                <item-type>Dimmer</item-type>
                <label>@text/channel-type.shelly.dimmerBrightness.label</label>
                <description>@text/channel-type.shelly.dimmerBrightness.description</description>
-               <category>DimmableLight</category>
+               <category>Light</category>
        </channel-type>
 
        <channel-type id="meterWatts">
index b66b8137fc01efef2a56a233b384da3584c70d3d..1a0d7bb60515220368203071510c7c43cbb8974b 100644 (file)
        <thing-type id="shellypluswdus">
                <label>Shelly Plus Dimmer US</label>
                <description>@text/thing-type.shelly.shellypluswdus.description</description>
-               <category>DimmableLight</category>
+               <channel-groups>
+                       <channel-group id="relay" typeId="dimmerChannel"/>
+                       <channel-group id="meter" typeId="meter"/>
+                       <channel-group id="device" typeId="deviceStatus"/>
+               </channel-groups>
+
+               <representation-property>serviceName</representation-property>
+               <config-description-ref uri="thing-type:shelly:dimmer-gen2"/>
+       </thing-type>
+
+       <thing-type id="shellyplus10v">
+               <label>Shelly Plus Dimmer 10V</label>
+               <description>@text/thing-type.shelly.shellyplus10v.description</description>
                <channel-groups>
                        <channel-group id="relay" typeId="dimmerChannel"/>
                        <channel-group id="meter" typeId="meter"/>