Skip to content

Add wildcard support for ChannelEventTriggerHandler#5512

Merged
kaikreuzer merged 5 commits into
openhab:mainfrom
jimtng:wildcard-channel-event-trigger
May 6, 2026
Merged

Add wildcard support for ChannelEventTriggerHandler#5512
kaikreuzer merged 5 commits into
openhab:mainfrom
jimtng:wildcard-channel-event-trigger

Conversation

@jimtng
Copy link
Copy Markdown
Contributor

@jimtng jimtng commented Apr 24, 2026

Resolve #5504

Follow up TODO after this is merged:

  • Update docs
  • Make sure rulesdsl supports it
  • Update helper libraries (js, python, jruby)

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng jimtng force-pushed the wildcard-channel-event-trigger branch from 2214297 to 4109375 Compare April 24, 2026 05:12
@jimtng jimtng marked this pull request as ready for review April 24, 2026 06:08
@jimtng jimtng requested a review from a team as a code owner April 24, 2026 06:08
@kaikreuzer kaikreuzer requested a review from Copilot April 30, 2026 19:21
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 wildcard (*, ?) support to core.ChannelEventTrigger so a single trigger definition can match multiple channel UIDs (similar to existing wildcard behavior for things/items), and updates module type descriptions/tests accordingly.

Changes:

  • Introduce wildcard parsing for channelUID in ChannelEventTriggerHandler via a topic-regex-based TopicEventFilter.
  • Add unit tests for * and ? channel wildcard matching.
  • Update i18n + module type JSON descriptions to document wildcard support.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandler.java Adds wildcard handling by switching to a TopicEventFilter when channelUID contains */?.
bundles/org.openhab.core.automation/src/test/java/org/openhab/core/automation/internal/module/handler/ChannelEventTriggerHandlerTest.java Adds tests for * and ? wildcard channel patterns.
bundles/org.openhab.core.automation/src/main/resources/OH-INF/i18n/automation.properties Documents wildcard support for channelUID configuration.
bundles/org.openhab.core.automation/src/main/resources/OH-INF/automation/moduletypes/ChannelTrigger.json Documents wildcard support for channelUID configuration in the module type definition.

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

jimtng added 2 commits May 1, 2026 13:18
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


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

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


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

…NotApplied case

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Copy link
Copy Markdown
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@kaikreuzer kaikreuzer merged commit ba06ad8 into openhab:main May 6, 2026
5 checks passed
@kaikreuzer kaikreuzer added the enhancement An enhancement or new feature of the Core label May 6, 2026
@kaikreuzer kaikreuzer added this to the 5.2 milestone May 6, 2026
@jimtng jimtng deleted the wildcard-channel-event-trigger branch May 6, 2026 18:03
@jimtng
Copy link
Copy Markdown
Contributor Author

jimtng commented May 7, 2026

@openhab/javascript-maintainers @openhab/python-maintainers this may require an update in the helper library's docs.

Main doc update: openhab/openhab-docs#2717
JRuby update: openhab/openhab-jruby#533

ccutrer pushed a commit to openhab/openhab-jruby that referenced this pull request May 7, 2026
See: openhab/openhab-core/pull/5512

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
florian-h05 added a commit to openhab/openhab-js that referenced this pull request May 10, 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 of the Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wildcard support for channel event triggers

3 participants