Skip to content

[somfytahoma] Add closure channel and scaling for RS100 shutter motors#20432

Merged
lsiepel merged 4 commits intoopenhab:mainfrom
HenmusZev:added-channel-closure-to-shutter-somfytahoma-rs100
May 4, 2026
Merged

[somfytahoma] Add closure channel and scaling for RS100 shutter motors#20432
lsiepel merged 4 commits intoopenhab:mainfrom
HenmusZev:added-channel-closure-to-shutter-somfytahoma-rs100

Conversation

@HenmusZev
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Hennie Hageman <hennie.hageman@gmail.com>
@HenmusZev HenmusZev requested a review from octa22 as a code owner March 22, 2026 19:20
@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label Mar 23, 2026
Copy link
Copy Markdown
Contributor

@octa22 octa22 left a comment

Choose a reason for hiding this comment

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

Hello,
thanks for the contribution. The initial version of this binging had a separate channel for controlling the closure, but we decided to merge it into a common "control" channel several years ago. Take inspiration from SomfyTahomaRollerShutterHandler, there is already the ClosureState getting/setting.
Thanks

@HenmusZev
Copy link
Copy Markdown
Contributor Author

"Hi @octa22, thank you for the feedback! That makes a lot of sense. I see now that the control channel should be the single point of contact for both commands and state. I will revert the changes to shutter.xml and update the SomfyTahomaShutterHandler.java to link the CONTROL channel to core:ClosureState and implement the setClosure command logic as suggested. I'll push the updates as soon as I've tested them."

…te and commands

Signed-off-by: Hennie Hageman <hennie.hageman@gmail.com>
…te and commands

Signed-off-by: Hennie Hageman <hennie.hageman@gmail.com>
@HenmusZev
Copy link
Copy Markdown
Contributor Author

"I have updated the PR following the feedback:

  • Removed the additional closure channel from shutter.xml.
  • Refactored SomfyTahomaShutterHandler to use the existing CONTROL channel for both state (core:ClosureState) and commands.
  • Implemented the setClosure logic within the handler, following the RollerShutter model.
  • Verified that both binary commands and percentage positioning work correctly with RS100 hardware.

Ready for review!"

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

Updates the Somfy Tahoma shutter handler to better integrate Rollershutter control semantics by wiring the control channel to a closure-related state and by sending setClosure commands for numeric inputs.

Changes:

  • Map the control channel to core:ClosureState via stateNames.
  • Rework handleCommand() to cancel current executions on STOP and to send setClosure with parameters for numeric commands.
  • Change getTahomaCommand() visibility/signature and adjust its default mapping behavior.

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

…te and commands

Signed-off-by: Hennie Hageman <hennie.hageman@gmail.com>
@HenmusZev
Copy link
Copy Markdown
Contributor Author

"Regarding the scaling: I've verified with the actual RS100 hardware that the states are already correctly reported as 0-100% in openHAB (likely handled by the base handler). Therefore, additional scaling in updateState is not required. I have, however, updated handleCommand to explicitly separate DecimalType from other commands to prevent unsupported commands from being sent as setClosure [0]."

@lsiepel lsiepel requested a review from octa22 March 27, 2026 08:06
@HenmusZev
Copy link
Copy Markdown
Contributor Author

I don't want to push but is the review waiting on me?

@HenmusZev HenmusZev marked this pull request as draft April 13, 2026 10:52
@HenmusZev HenmusZev marked this pull request as ready for review April 13, 2026 10:53
@HenmusZev HenmusZev marked this pull request as draft April 13, 2026 10:54
@HenmusZev HenmusZev marked this pull request as ready for review April 20, 2026 16:28
@lsiepel
Copy link
Copy Markdown
Contributor

lsiepel commented Apr 28, 2026

Thanks for providing a patch to the openHAB project. Looks like this is your first contribution here. Welcome!

Previously @octa22 did a review and commented on the design. The PR is adapted and some changes where applied. It would be nice if @octa22 can do another check.
From my side this LGTM

@lsiepel lsiepel merged commit bfa9e38 into openhab:main May 4, 2026
2 checks passed
@lsiepel lsiepel added this to the 5.2 milestone May 4, 2026
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.

5 participants