[shelly] Add Plus/Pro Dimmer models (Gen3/Gen4): 1PM, 2PM, 10V, DALI - #19226
[shelly] Add Plus/Pro Dimmer models (Gen3/Gen4): 1PM, 2PM, 10V, DALI#19226markus7017 wants to merge 13 commits into
Conversation
f3632c0 to
c8e11cc
Compare
|
@wborn could you please add Copilot as a reviewer |
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive support for multiple new Shelly dimmer devices across the Plus and Pro product lines. It introduces support for 7 new dimmer models while also consolidating and improving the Bluetooth Low Energy (BLU) device handling.
Key changes include:
- Addition of Plus Dimmer G3/G4, DALI Dimmer G3, 0/1-10V Dimmer, and Pro Dimmer 1PM/2PM/0-1/10V support
- Refactoring of BLU device discovery and event handling logic
- Test suite updates to accommodate new device types and consolidated functionality
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ShellyThingCreatorTest.java | Updated test cases to support new dimmer devices and consolidated BLU service name validation |
| ShellyMDNSDiscoveryParticipantTest.java | Removed file - tests moved to ShellyThingCreatorTest |
| ShellyDeviceProfileTest.java | Added tests for new dimmer devices and BLU service name building |
| shellyGen2_relay.xml | Added thing type definitions for Plus Dimmer and DALI Dimmer |
| shellyGen2_lights.xml | Added Pro Dimmer 1PM/2PM/0-1/10V thing type definitions |
| ShellyDevices.java | Added device constants and mappings for all new dimmer models |
| Multiple API and handler files | Refactored BLU handling, improved dimmer support, and consolidated event processing |
Comments suppressed due to low confidence (1)
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_lights.xml:1
- The table entry for shellyprodimmer2pm incorrectly shows 'Shelly Pro 1PM' when it should be 'Shelly Pro 2PM' to match the dual channel description.
<?xml version="1.0" encoding="UTF-8"?>
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Besides the copilot comments there are also conflicts to solve. |
|
#20044 was closed, so i guess this can be moved forward? |
|
@lsiepel I started this PR a long time ago. In between some refactoring happened, lately with PR #20909. This is adding new Duo bulbs - not the same scope from a first point of view, but those also utilizes dimmer structures. It was a significant reduced scope to this one here so I would like first #20909 getting merged and then work on this one here. |
c8e11cc to
d1e955d
Compare
Went through everything labeled as a "bug fix" here. Most of it turned out to be corrections inside the new Gen2/3/4 dimmer code this PR itself adds, so there's nothing to extract — that code doesn't exist on Two items were genuine, independent bugs in the already-shipped Gen1 Dimmer 1/2 support, so I split those into #21226 (requested your review there). Once that merges I'll rebase this PR on top. |
|
#21226 has merged — this PR is now rebased on top of it, build green (see below). Re #20909: confirmed it's a real dependency, not just a precaution. Both PRs independently touch |
|
Updated test build available — rebased on latest main, Pro Dimmer 2PM thing-type reverted to its already-released ID (no re-discovery needed for anyone who already tested). New devices supported:
org.openhab.binding.shelly-5.3.0-SNAPSHOT-plus_pro_dimmer.jar — see README-plus_pro_dimmer for updated README. |
|
Carved out the Button 1/Button 2 label fix into a standalone bugfix branch ( The meter-capability-map fix stays here since it only applies to thing types this PR itself introduces. |
|
@lsiepel Could you please trigger a Copilot |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.
Suppressed comments (1)
bundles/org.openhab.binding.shelly/src/main/resources/OH-INF/thing/shellyGen2_relay.xml:653
- The for
shellyplus10vis split across two lines, which can lead to an unintended newline/extra whitespace in the rendered thing-type description. Keep it as a single line to avoid UI formatting artifacts.
<description>Shelly Plus 0/1-10V Dimmer - analog interface dimmer controller for compatible LED drivers and ballasts
(Gen2/Gen3/Gen4)</description>
|
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/shelly-beta-with-plus-pro-mini-and-blu-support/139554/1 |
|
Rebased on latest org.openhab.binding.shelly-5.3.0-SNAPSHOT-plus_pro_dimmer.jar — see README-plus_pro_dimmer for updated README. @ijasan updated build available if you want to re-test. |
Re-Test completed. Environment: Test Results: Dimmer2 (Gen1) / SHDM-2 / Firmware 1.14.0
Dimmer Plus (G3) / S3DM-0A101WWL / Firmware 2.0.0 The labels for the relay#button1 and relay#button2 channels have the same value without the number in the name, just as is the case with the other channels, such as relay#input1 and relay#input2.
Otherwise, everything is OK. Dimmer Plus (G4) / S4DM-0A101WWL / Firmware 2.0.0 The labels for the relay#button1 and relay#button2 channels have the same value without the number in the name, just as is the case with the other channels, such as relay#input1 and relay#input2.
Otherwise, everything is OK. |
|
@ijasan Thanks for testing! The button1/button2 label issue on Dimmer Plus (G3/G4) is fixed now - the channel labels correctly show the number suffix like the other indexed channels (input1/input2 etc.). |
|
Re: the earlier low-confidence Copilot comment about |
| Double currentTc = tmp.tC; | ||
| if (!getBool(tmp.isValid) || currentTc == null || tC > currentTc) { | ||
| tmp.isValid = true; | ||
| tmp.tC = tC; | ||
| tmp.tF = temperature.tF; | ||
| tmp.units = "C"; | ||
| } |
There was a problem hiding this comment.
[P2] Do not retain the historical maximum temperature
status.tmp survives between full polls and WebSocket notifications. After the first value, this comparison only replaces it with a higher value, while the device temperature channel is published from status.tmp; a dimmer that cools from 60 C to 40 C therefore remains at 60 C indefinitely. The existing relay status mapping keeps the latest component reading, which would also avoid this stale state here.
| Double currentTc = tmp.tC; | |
| if (!getBool(tmp.isValid) || currentTc == null || tC > currentTc) { | |
| tmp.isValid = true; | |
| tmp.tC = tC; | |
| tmp.tF = temperature.tF; | |
| tmp.units = "C"; | |
| } | |
| tmp.isValid = true; | |
| tmp.tC = tC; | |
| tmp.tF = temperature.tF; | |
| tmp.units = "C"; |
Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
…ndling for multi-channel devices Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
The system:button core channel type had no i18n label override in this binding, so the digit-numbering logic in ShellyChannelDefinitions.createChannel() (gated on a non-empty label) never ran for it. Plus Dimmer relay#button1/relay#button2 channels (the only case where the digit suffix must come from the channel name rather than the group name) showed as plain "Button" with no index. Adding an explicit label override lets the existing numbering logic apply. Signed-off-by: Markus Michels <markus7017@gmail.com>
Pro Dimmer PM devices measure power on their light:N RPC component, not switch:N, so resetting the resetTotals channel called the non-existent Switch.ResetCounters and failed. isDimmer now selects Light.ResetCounters, checked before the generic hasRelays fallback (dimmers always set hasRelays=true). Signed-off-by: Markus Michels <markus7017@gmail.com>
Expose the number of control gears found on the DALI bus and whether a bus scan is currently active as new advanced channels on Plus/Pro Dimmer things that have a DALI interface. Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>
Signed-off-by: Markus Michels <markus7017@gmail.com>


Summary
Adds support for the remaining Gen2/Gen3/Gen4 Plus and Pro dimmer models.
Feature:
Fix:
Change:
Dependency
#21226 has merged — this PR is rebased on top of it.
Still depends on #20909 (open): both PRs independently touch the same dimmer status method, so whichever merges second will need a small manual reconciliation. Not blocking — flagging so it's tracked.
Test instructions
Closing