8000 Update Matrix integration docs for new features by decompil3d · Pull Request #39646 · home-assistant/home-assistant.io · GitHub
[go: up one dir, main page]

Skip to content

Update Matrix integration docs for new features #39646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

decompil3d
8000 Copy link
Contributor
@decompil3d decompil3d commented Jun 19, 2025

Proposed change

This PR adds documentation to the Matrix integration page that relates to my PR to core adding some new functionality to the integration.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Updated Matrix integration documentation to describe support for triggering commands via emoji reactions on messages.
    • Added examples demonstrating how to configure commands and automations based on emoji reactions, including threaded replies and automated emoji responses.
    • Clarified descriptions and updated example aliases for improved readability.
    • Added sections explaining how to reply in threads and react to messages using the integration.

@home-assistant home-assistant bot added in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch next This PR goes into the next branch labels Jun 19, 2025
@home-assistant
Copy link

It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the current branch. Please change the target branch of this PR to current and rebase if needed. If this is documentation for a new feature, please add a link to that PR in your description.

Copy link
netlify bot commented Jun 19, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit a70bd22
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/6855902da160d10008f1aa38
😎 Deploy Preview https://deploy-preview-39646--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor
coderabbitai bot commented Jun 19, 2025
📝 Walkthrough

Walkthrough

The Matrix integration documentation was updated to introduce support for triggering commands via emoji reactions on messages. This includes a new reaction key in the command schema, expanded example configurations and automations, and new documentation on replying in threads and reacting to messages. Terminology and formatting improvements were also made.

Changes

File(s) Change Summary
source/_integrations/matrix.markdown Added optional reaction key to commands schema; updated example config and automations; added documentation on replying in threads using thread_parent and reacting with matrix.react; revised descriptions and formatting including enclosing default homeserver URL in angle brackets.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MatrixBot
    participant Automation

    User->>MatrixBot: Reacts to a message with 👍
    MatrixBot->>Automation: Emits matrix_command event (command: thumbsup)
    Automation->>MatrixBot: Sends threaded reply acknowledging reaction
Loading
sequenceDiagram
    participant User
    participant MatrixBot
    participant Automation

    User->>MatrixBot: Sends "!testword" command
    MatrixBot->>Automation: Emits matrix_command event (command: testword)
    Automation->>MatrixBot: Adds ✅ reaction to original message
Loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
source/_integrations/matrix.markdown (2)

129-130: Consider quoting emoji literals
To ensure compatibility across all YAML parsers, wrap the emoji in quotes.

- reaction: "👍"

273-276: Refine wording for clarity
In the “Replying in threads” section, replace “inside of a thread” with “inside a thread” in both occurrences to eliminate redundancy.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between ff7234a and 8d971d9.

📒 Files selected for processing (1)
  • source/_integrations/matrix.markdown (6 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/matrix.markdown

[style] ~273-~273: This phrase is redundant. Consider using “inside”.
Context: ...he received message. If the message was inside of a thread, the event will also contain a...

(OUTSIDE_OF)


[style] ~276-~276: This phrase is redundant. Consider using “inside”.
Context: ...e root message of the thread. To reply inside of a thread, pass the correct message iden...

(OUTSIDE_OF)

🔇 Additional comments (8)
source/_integrations/matrix.markdown (8)

55-55: Approve minor formatting change
Enclosing the default homeserver URL in <...> correctly creates a clickable link in the docs.


75-77: Approve updated “word” key documentation
The description, required flag, and type for the word command key are clear and consistent with existing entries.


80-82: Approve updated “expression” key documentation
The regex-based command example is well-described and follows the same pattern as other command keys.


83-85: Approve new “reaction” key in schema
Adding the reaction key with a concise description correctly documents emoji-triggered commands.


138-139: Approve automation alias rename
Changing the alias to “Respond to !testword” matches the updated “handle” semantics.


149-150: Approve automation alias rename
Updating the alias to “Respond to an introduction” maintains consistent terminology.


173-185: Approve emoji reaction action example
The matrix.react action with a ✅ reaction is correctly formatted and clearly demonstrates usage.


191-193: Approve updated summary bullet
The new bullet accurately describes listening for emoji reactions and responding in threads.

Comment on lines 160 to 172
- alias: "Respond to a reaction in a thread"
triggers:
- trigger: event
event_type: matrix_command
event_data:
command: thumbsup
actions:
- action: notify.matrix_notify
data:
message: "I saw that {{trigger.event.data.args['reaction']}} -- glad you appreciated this!"
data:
thread_id: "{{trigger.event.data.thread_parent | default(trigger.event.data.event_id)}}"

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Document reaction event data
The “Event data” section above covers word and expression commands but omits reaction triggers. Please add details (e.g., that data.args['reaction'] contains the emoji) under “### Event data.”

🤖 Prompt for AI Agents
In source/_integrations/matrix.markdown around lines 160 to 172, the
documentation lacks details about reaction event data for matrix_command
triggers. Add a section under "### Event data" explaining that for reaction
triggers, data.args['reaction'] contains the emoji used in the reaction. This
will clarify how reaction events are represented and used in triggers.

@home-assistant home-assistant bot added has-parent This PR has a parent PR in a other repo and removed needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch labels Jun 19, 2025
Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
source/_integrations/matrix.markdown (1)

274-277: Remove redundant “inside of” phrasing
Simplify wording by replacing “inside of a thread” with “in a thread” for conciseness.

- If the message was inside of a thread, `thread_parent` will be the identifier of the root message of the thread. If it is not inside of a thread, `thread_parent` will be the same as `event_id`.
+ If the message was in a thread, `thread_parent` will be the identifier of the root message. If it is not in a thread, `thread_parent` will be the same as `event_id`.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 8d971d9 and a70bd22.

📒 Files selected for processing (1)
  • source/_integrations/matrix.markdown (6 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/matrix.markdown

[style] ~274-~274: This phrase is redundant. Consider using “inside”.
Context: ...ssage of the thread. If the message was inside of a thread, thread_parent will be the i...

(OUTSIDE_OF)


[style] ~275-~275: This phrase is redundant. Consider using “inside”.
Context: ...oot message of the thread. If it is not inside of a thread, thread_parent will be the s...

(OUTSIDE_OF)


[style] ~277-~277: This phrase is redundant. Consider using “inside”.
Context: ...ll be the same as event_id. To reply inside of a thread, pass the correct message iden...

(OUTSIDE_OF)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (12)
source/_integrations/matrix.markdown (12)

55-57: Clarify default homeserver URL formatting
Enclosing the default Matrix homeserver URL in angle brackets improves readability and prevents YAML parsing issues.


75-75: Improve word command description clarity
The updated description clearly explains how the word key is used to trigger commands.


79-81: Enhance expression command schema
Adding required: false and the type: string for the expression key completes the schema definition.


82-85: Introduce reaction key in commands schema
Documenting the reaction option aligns the schema with the new feature for emoji-triggered commands.


129-130: Add example for reaction-triggered command
Including the 👍 reaction command in the sample configuration demonstrates the new reaction key in action.


138-138: Update alias label to “Respond to”
Changing “React to !testword” to “Respond to !testword” better reflects the action taken in the automation.


149-149: Consistent alias wording for introduction
Aligns the introduction automation’s alias with the updated “Respond to” phrasing.


160-172: Add threaded reaction automation example
The new automation shows how to reply in the correct thread using thread_parent, illustrating the threaded reply feature.


173-185: Add emoji reaction automation example
Documenting the matrix.react action with reaction, room, and message_id parameters clarifies how to programmatically react to a message.


191-193: Update overview bullets to include reactions
Reflects the new behavior in the high-level summary, ensuring the documentation matches the examples.


270-288: Document replying in threads section
This new section clearly explains how to use thread_parent to send replies in Matrix threads.


289-299: Document reacting to messages section
The “Reacting to messages” section provides clear instructions and a complete example for using the matrix.react action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-parent This PR has a parent PR in a other repo in-progress This PR/Issue is currently being worked on next This PR goes into the next branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0