Skip to content

feat(homeassistant): support notify service delivery#23643

Open
BlackishGreen33 wants to merge 2 commits into
NousResearch:mainfrom
BlackishGreen33:bg/feat-homeassistant-notify-service
Open

feat(homeassistant): support notify service delivery#23643
BlackishGreen33 wants to merge 2 commits into
NousResearch:mainfrom
BlackishGreen33:bg/feat-homeassistant-notify-service

Conversation

@BlackishGreen33

Copy link
Copy Markdown
Contributor

Fixes #23136

Problem:
Home Assistant gateway responses only used persistent_notification.create, so mobile push notify services could not receive agent replies.

Implementation:

  • Read platforms.homeassistant.extra.notify_service and HASS_NOTIFY_SERVICE.
  • Normalize both notify.mobile_app_iphone and mobile_app_iphone to the notify service endpoint.
  • Keep persistent_notification.create as the default when no service is configured.

Tests:

  • source /Users/blackishgreen03/workspace/hermes-agent/venv/bin/activate && python -m pytest tests/gateway/test_homeassistant.py tests/integration/test_ha_integration.py -q (48 passed)
  • source /Users/blackishgreen03/workspace/hermes-agent/venv/bin/activate && python -m pytest tests/ -q (attempted; this local env fails with missing optional deps such as acp, fastapi, numpy plus unrelated existing failures: 251 failed, 21484 passed, 168 skipped, 91 errors)

This change is intentionally narrow: it does not change inbound HA event handling or the default persistent notification behavior.

Copilot AI review requested due to automatic review settings May 11, 2026 07:41

Copilot AI 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.

Pull request overview

Adds optional Home Assistant notify.<service> delivery for outbound gateway messages so agent responses can be routed to mobile push notify services (while keeping persistent_notification.create as the default).

Changes:

  • Read platforms.homeassistant.extra.notify_service and HASS_NOTIFY_SERVICE, and normalize notify.<service> vs <service>.
  • Route HomeAssistantAdapter.send() to /api/services/notify/<service> when configured; otherwise keep /api/services/persistent_notification/create.
  • Add unit + integration test coverage and update Home Assistant messaging docs.

Reviewed changes

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

Show a summary per file
File Description
gateway/platforms/homeassistant.py Adds notify-service configuration + routing logic for outbound REST sends.
gateway/config.py Adds HASS_NOTIFY_SERVICE env override into HA platform config.
tests/gateway/test_homeassistant.py Adds unit tests for notify-service normalization and send() routing.
tests/integration/test_ha_integration.py Adds integration test verifying notify service calls hit the notify endpoint.
tests/conftest.py Ensures HASS_NOTIFY_SERVICE is treated as a credential-like env var for test isolation.
website/docs/user-guide/messaging/homeassistant.md Documents HASS_NOTIFY_SERVICE and notify_service config option + behavior.

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

Comment thread gateway/platforms/homeassistant.py
Comment thread gateway/platforms/homeassistant.py Outdated
@BlackishGreen33

Copy link
Copy Markdown
Contributor Author

CI note after checking logs:

  • Windows footguns (blocking) fails on tools/process_registry.py:588 (os.killpg(..., signal.SIGKILL)). This PR does not modify that file; the match comes from existing upstream code.
  • e2e fails the existing /new session reset cases in tests/e2e/test_platform_commands.py across telegram/discord/slack because reset_session was called 0 times. This PR does not touch gateway slash command/session reset behavior.
  • Several longer jobs (test and build jobs) were still pending when checked.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery labels May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: HA outbound - support notify service (mobile push)

3 participants