Skip to content

[shelly] Add support for Shelly Plug M Gen3#20632

Merged
lsiepel merged 5 commits intoopenhab:mainfrom
kaenguruhs:add-shelly-plug-m-gen3
May 3, 2026
Merged

[shelly] Add support for Shelly Plug M Gen3#20632
lsiepel merged 5 commits intoopenhab:mainfrom
kaenguruhs:add-shelly-plug-m-gen3

Conversation

@kaenguruhs
Copy link
Copy Markdown
Contributor

Importance

provides a new addon / adds a new thing

Description

This PR adds support for the Shelly Plug M Gen3.
The device is identified by the model ID S3PL-30110EU.

Technical changes:

  • Added SHELLYDT_PLUSPLUGM_G3 and mapping to ShellyDevices.java.
  • Updated ShellyThingCreator.java to correctly handle Gen3 discovery for this model.
  • Updated shellyGen2_relay.xml description to include the "M" variant.
  • Updated README.md to include "M" variant.

Testing

Legal Process

  • I have signed my commits (DCO).

Closes #20631.

Signed-off-by: Martin Bartsch <kaenguruhs@gmx.net>
@kaenguruhs kaenguruhs requested a review from markus7017 as a code owner April 26, 2026 16:30
Martin Bartsch added 2 commits April 26, 2026 18:39
Signed-off-by: Martin Bartsch <kaenguruhs@gmx.net>
Signed-off-by: Martin Bartsch <kaenguruhs@gmx.net>
@lsiepel lsiepel requested a review from Copilot April 26, 2026 16:53
@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Apr 26, 2026
@kaenguruhs
Copy link
Copy Markdown
Contributor Author

Updated the PR with missing UI definitions and adjusted the unit tests. New *.jar is here: org.openhab.binding.shelly-5.2.0-SNAPSHOT.zip

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Shelly binding support for the Shelly Plug M Gen3 (model id S3PL-30110EU) by mapping it into the existing Gen2/Gen3 RPC “Plus Plug” thing type and ensuring discovery/identification recognizes the new service/model identifiers.

Changes:

  • Add the new model id constant and map S3PL-30110EU to a supported thing type.
  • Adjust discovery/type resolution to avoid misclassifying shellyplugmg3-* as a Gen1 “shellyplug”.
  • Update tests and user-facing descriptions/docs to include the “M” variant.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyDevices.java Adds model id mapping for Plug M Gen3 and service-name mapping for shellyplugmg3.
bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java Ensures shellyplugmg3-* doesn’t get routed through the Gen1 plug name mapping.
bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreatorTest.java Extends service-name and device-type mapping test cases for Plug M Gen3.
bundles/org.openhab.binding.shelly/src/test/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfileTest.java Adds Plug M thing type to the generation/API determination test matrix.
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_relay.xml Updates the shellyplusplug thing type description to include “M”.
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/i18n/shelly.properties Updates the English i18n description for shellyplusplug.
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/i18n/shelly_de.properties Updates the German i18n description for shellyplusplug.
bundles/org.openhab.binding.shelly/README.md Adds the Plug M Gen3 model id to the supported device table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bundles/org.openhab.binding.shelly/README.md Outdated
Copy link
Copy Markdown
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See copilot comments

Signed-off-by: Martin Bartsch <kaenguruhs@gmx.net>
Copy link
Copy Markdown
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM

Waiting for @markus7017 to confirm

@markus7017
Copy link
Copy Markdown
Contributor

@kaenguruhs Looks good, could you please add the new device type to the unit tests (ShellyDeviceProfileTest, ShellyThingCreatorTest)

@kaenguruhs
Copy link
Copy Markdown
Contributor Author

Hi @markus7017,

in ShellyThingCreatorTest.java I added the new plug:

In ShellyDeviceProfileTest I did not add the new plug M as I did not add a new THING_TYPE (just like the PLUSPLUGIT, which is not mentioned in there, too).

What do you expect me to do?

Copy link
Copy Markdown
Contributor

@markus7017 markus7017 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One final comment. Otherwise LGTM

Signed-off-by: Martin Bartsch <kaenguruhs@gmx.net>
@lsiepel lsiepel added this to the 5.2 milestone May 3, 2026
@lsiepel lsiepel merged commit 17f131d into openhab:main May 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[shelly] Support for Shelly Plug M Gen3

4 participants