Skip to content

Commit

Permalink
Re-Add/Fix Shelly Plus UNI support
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Michels <[email protected]>
  • Loading branch information
markus7017 committed Nov 28, 2024
1 parent 6e81a76 commit 37ce496
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 9 deletions.
11 changes: 6 additions & 5 deletions bundles/org.openhab.binding.shelly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ See section [Discovery](#discovery) for details.
| shellydimmer | Shelly Dimmer | SHDM-1 |
| shellydimmer2 | Shelly Dimmer2 | SHDM-2 |
| shellyix3 | Shelly ix3 | SHIX3-1 |
| shellyuni | Shelly UNI, Shelly Plus UNI | SHUNI-1, SNSN-0043X |
| shellyuni | Shelly UNI, Shelly Plus UNI | SHUNI-1 |
| shellyplug | Shelly Plug | SHPLG2-1 |
| shellyplugs | Shelly Plug-S | SHPLG-S |
| shellyem | Shelly EM with integrated Power Meters | SHEM |
Expand Down Expand Up @@ -86,13 +86,14 @@ See section [Discovery](#discovery) for details.
| shellyplus1pm | Shelly Plus 1PM with 1x relay + power meter | SNSW-001P16EU, S3SW-001P16EU |
| shellyplus2pm-relay | Shelly Plus 2PM with 2x relay + power meter, relay mode | SNSW-002P16EU, SNSW-102P16EU |
| shellyplus2pm-roller | Shelly Plus 2PM with 2x relay + power meter, roller mode | SNSW-002P16EU, SNSW-102P16EU |
| shellyplusplug | Shelly Plug-S | SNPL-00112EU |
| shellyplusplug | Shelly Plug-IT | SNPL-00110IT |
| shellyplusplug | Shelly Plug-UK | SNPL-00112UK |
| shellyplusplugus | Shelly Plug-US | SNPL-00116US |
| shellyplusplug | Shelly Plus Plug | SNPL-00112EU |
| shellyplusplug | Shelly Plus Plug-IT | SNPL-00110IT |
| shellyplusplug | Shelly Plus Plug-UK | SNPL-00112UK |
| shellyplusplugus | Shelly Plus Plug-US | SNPL-00116US |
| shellyplusi4 | Shelly Plus i4 with 4x AC input | SNSN-0024X, S3SN-0024X |
| shellyplusi4dc | Shelly Plus i4 with 4x DC input | SNSN-0D24X |
| shellyplus10v | Shelly Plus Dimmer 0/10V (Gen 2) or 0/1/10V (Gen 3) | SNDM-00100WW, S3DM-0010WW |
| shellyplusuni | Shelly Plus UNI | SNSN-0043X |
| shellyplusht | Shelly Plus HT with temperature + humidity sensor | SNSN-0013A |
| shellyhtg3 | Shelly Plus HT Gen 3 with temperature + humidity sensor | S3SN-0U12A |
| shellyplussmoke | Shelly Plus Smoke sensor | SNSN-0031Z |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class ShellyBindingConstants {
THING_TYPE_SHELLYPLUSI4, //
THING_TYPE_SHELLYPLUSI4DC, //
THING_TYPE_SHELLYPLUSDIMMER10V, //
THING_TYPE_SHELLYPLUSUNI, //
THING_TYPE_SHELLYPLUSHT, //
THING_TYPE_SHELLYPLUSHTG3, //
THING_TYPE_SHELLYPLUSSMOKE, //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ public class ShellyThingCreator {
THING_TYPE_SHELLYPLUSI4DC_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPLUSHT = new ThingTypeUID(BINDING_ID,
THING_TYPE_SHELLYPLUSHT_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPLUSUNI = new ThingTypeUID(BINDING_ID,
THING_TYPE_SHELLYPLUSUNI_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPLUSHTG3 = new ThingTypeUID(BINDING_ID,
THING_TYPE_SHELLYPLUSHTG3_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPLUSSMOKE = new ThingTypeUID(BINDING_ID,
Expand Down Expand Up @@ -398,7 +400,7 @@ public class ShellyThingCreator {
THING_TYPE_MAPPING.put(SHELLYDT_PLUSHT, THING_TYPE_SHELLYPLUSHT_STR);
THING_TYPE_MAPPING.put(SHELLYDT_PLUSHTG3, THING_TYPE_SHELLYPLUSHTG3_STR);
THING_TYPE_MAPPING.put(SHELLYDT_PLUSSMOKE, THING_TYPE_SHELLYPLUSSMOKE_STR);
THING_TYPE_MAPPING.put(SHELLYDT_PLUSUNI, THING_TYPE_SHELLYUNI_STR);
THING_TYPE_MAPPING.put(SHELLYDT_PLUSUNI, THING_TYPE_SHELLYPLUSUNI_STR);
THING_TYPE_MAPPING.put(SHELLYDT_PLUSDIMMERUS, THING_TYPE_SHELLYPLUSDIMMERUS_STR);
THING_TYPE_MAPPING.put(SHELLYDT_PLUSDIMMER10V, THING_TYPE_SHELLYPLUSDIMMER10V_STR);
THING_TYPE_MAPPING.put(SHELLYDT_PLUSDIMMER0110VG3, THING_TYPE_SHELLYPLUSDIMMER10V_STR);
Expand Down Expand Up @@ -488,7 +490,7 @@ public class ShellyThingCreator {
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSI4DC_STR, THING_TYPE_SHELLYPLUSI4DC_STR);
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_SHELLYPLUSUNI_STR, THING_TYPE_SHELLYUNI_STR);
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPLUSUNI_STR, THING_TYPE_SHELLYPLUSUNI_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_SHELLYPLUSDIMMER0110VG3_STR, THING_TYPE_SHELLYPLUSDIMMER10V_STR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ thing-type.shelly.shellyplus2pm-roller.description = Shelly Plus 2PM - Roller Co
thing-type.shelly.shellyplusplug.description = Shelly Plus Plug S/IT/UK/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
thing-type.shelly.shellyplusht.description = Shelly Plus HT - Humidity and Temperature sensor with display
thing-type.shelly.shellyplushtg3.description = Shelly Plus HT Gen 3 - Humidity and Temperature sensor with display
thing-type.shelly.shellyplussmoke.description = Shelly Plus Smoke - Smoke Detector with Alarm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
</channel-type>

<channel-type id="sensorHumidity">
<item-type unitHint="%">Number:Dimensionless</item-type>
<item-type>Number:Dimensionless</item-type>
<label>@text/channel-type.shelly.sensorHumidity.label</label>
<description>@text/channel-type.shelly.sensorHumidity.description</description>
<category>Humidity</category>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,25 @@
<config-description-ref uri="thing-type:shelly:relay-gen2"/>
</thing-type>

<thing-type id="shellyplusuni">
<label>Shelly Plus UNI</label>
<description>@text/thing-type.shelly.shellyplusuni.description</description>

<channel-groups>
<channel-group id="relay1" typeId="relayChannel">
<label>@text/channel-group-type.shelly.relayChannel1.label</label>
</channel-group>
<channel-group id="relay2" typeId="relayChannel">
<label>@text/channel-group-type.shelly.relayChannel2.label</label>
</channel-group>
<channel-group id="sensors" typeId="sensorData"/>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>

<representation-property>serviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>

<thing-type id="shelly1mini">
<label>ShellyPlus 1 Mini</label>
<description>@text/thing-type.shelly.shelly1mini.description</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private static Stream<Arguments> provideTestCasesForGetThingUIDReturnsThingUidBy
Arguments.of(SHELLYDT_PLUSHT, "", THING_TYPE_SHELLYPLUSHT_STR), //
Arguments.of(SHELLYDT_PLUSHTG3, "", THING_TYPE_SHELLYPLUSHTG3_STR), //
Arguments.of(SHELLYDT_PLUSSMOKE, "", THING_TYPE_SHELLYPLUSSMOKE_STR), //
Arguments.of(SHELLYDT_PLUSUNI, "", THING_TYPE_SHELLYUNI_STR), //
Arguments.of(SHELLYDT_PLUSUNI, "", THING_TYPE_SHELLYPLUSUNI_STR), //
Arguments.of(SHELLYDT_PLUSDIMMERUS, "", THING_TYPE_SHELLYPLUSDIMMERUS_STR), //
Arguments.of(SHELLYDT_PLUSDIMMER10V, "", THING_TYPE_SHELLYPLUSDIMMER10V_STR), //
Arguments.of(SHELLYDT_PLUSDIMMER0110VG3, "", THING_TYPE_SHELLYPLUSDIMMER10V_STR), //
Expand Down

0 comments on commit 37ce496

Please sign in to comment.