Skip to content

Document push subscription webhook commands - #3230

Open
hariharanjagan wants to merge 2 commits into
home-assistant:masterfrom
hariharanjagan:patch-1
Open

Document push subscription webhook commands#3230
hariharanjagan wants to merge 2 commits into
home-assistant:masterfrom
hariharanjagan:patch-1

Conversation

@hariharanjagan

@hariharanjagan hariharanjagan commented Jul 5, 2026

Copy link
Copy Markdown

Proposed change

Documents two new webhook commands the companion app can send to Home Assistant:
register_push_subscription and remove_push_subscription.

An app registers a push token together with a list of entity IDs it wants to
watch. When any of those entities changes state, Home Assistant posts to the
app's push URL so the app can refresh. Re-registering with the same
subscription_id updates the existing one (for example when the token or the
entity list changes). The second command removes a subscription.

Both are added to the existing list of webhook commands on the
Sending data page, following the same format as the other commands.

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features for which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Editing or restructuring documentation guidelines
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

  • I have read and followed the documentation guidelines.
  • I have verified that my changes render correctly in the documentation.

Additional information

Summary by CodeRabbit

  • Documentation
    • Added new API guidance for push notifications, including how to register and remove push subscriptions.
    • Documented request fields, limits, idempotency behavior, and required identifiers for subscription management.

Add register_push_subscription and remove_push_subscription to the native
app integration webhook commands, so companion apps can subscribe to silent
pushes on entity state changes.

Documents the core feature added in home-assistant/core#174943.
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Documentation update adding two new webhook action sections—"Register a push subscription" and "Remove a push subscription"—to the native app integration sending-data guide, describing payload fields, idempotency, limits, and required parameters.

Changes

Push Subscription Documentation

Layer / File(s) Summary
Register and remove push subscription sections
docs/api/native-app-integration/sending-data.md
Adds "Register a push subscription" section with JSON example and field table (subscription_id, push_token, entity_ids, target), describing idempotent behavior and 50-subscription limit; adds "Remove a push subscription" section with JSON example and key table for required subscription_id.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Related PRs: None specified

Suggested labels: documentation

Suggested reviewers: None specified

🐇 A quiet hop through docs anew,
Two new sections come into view—
Subscribe with care, unsubscribe with ease,
Push notifications, silent as a breeze.
Fifty limits, tokens bright,
Docs now guide the app just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: adding documentation for push subscription webhook commands.
Description check ✅ Passed The template is largely complete, with the required sections filled in and the relevant pull request link provided.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/api/native-app-integration/sending-data.md`:
- Around line 353-358: The parameter tables in the native app integration doc
need to be reformatted to match the repo’s markdownlint style, since the current
no-leading-pipe layout will keep failing MD055/MD058. Update both the
subscription table and the removal table using the same leading-pipe table style
used elsewhere in the guide, and ensure each table is separated by blank lines
before and after it. Use the existing table sections in the sending-data
markdown as the targets for this formatting cleanup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a0ad7a44-c9c9-412f-9d30-ac8f93188183

📥 Commits

Reviewing files that changed from the base of the PR and between 8cf6136 and f4730d5.

📒 Files selected for processing (1)
  • docs/api/native-app-integration/sending-data.md

Comment on lines +353 to +358
| Key | Type | Description
| --- | ---- | -----------
`subscription_id` | string |Stable identifier the app assigns to this subscription. Re-registering with the same value updates the existing subscription in place. Required.
`push_token` | string | The token the push should be delivered to. Required.
`entity_ids` | list | Entity IDs whose state changes trigger a push. Must contain between 1 and 50 valid entity IDs; duplicates are ignored. Required.
`target` | string | Opaque value echoed back in the push payload so the app can route it to the correct surface. Optional.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Normalize both parameter tables to the repo’s markdownlint style.

Both tables use the no-leading-pipe format and need blank-line separation, so they’ll keep triggering MD055/MD058 in docs CI. Please switch them to the leading-pipe style used elsewhere in the guide.

Suggested fix
+
+| Key | Type | Description |
+| --- | --- | --- |
+| `subscription_id` | string | Stable identifier the app assigns to this subscription. Re-registering with the same value updates the existing subscription in place. Required. |
+| `push_token` | string | The token the push should be delivered to. Required. |
+| `entity_ids` | list | Entity IDs whose state changes trigger a push. Must contain between 1 and 50 valid entity IDs; duplicates are ignored. Required. |
+| `target` | string | Opaque value echoed back in the push payload so the app can route it to the correct surface. Optional. |
+

Apply the same formatting to the removal table below.

Also applies to: 372-374

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 353-353: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


[warning] 355-355: Table pipe style
Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe

(MD055, table-pipe-style)


[warning] 356-356: Table pipe style
Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe

(MD055, table-pipe-style)


[warning] 357-357: Table pipe style
Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe

(MD055, table-pipe-style)


[warning] 358-358: Table pipe style
Expected: leading_only; Actual: no_leading_or_trailing; Missing leading pipe

(MD055, table-pipe-style)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/api/native-app-integration/sending-data.md` around lines 353 - 358, The
parameter tables in the native app integration doc need to be reformatted to
match the repo’s markdownlint style, since the current no-leading-pipe layout
will keep failing MD055/MD058. Update both the subscription table and the
removal table using the same leading-pipe table style used elsewhere in the
guide, and ensure each table is separated by blank lines before and after it.
Use the existing table sections in the sending-data markdown as the targets for
this formatting cleanup.

Source: Linters/SAST tools

@hariharanjagan hariharanjagan changed the title Update sending-data.md Document push subscription webhook commands Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants