Added a simple, mqtt configurable notification overlay#72
Conversation
|
Thank you for this, it's an excellent first contribution. The quality bar here is high: the design doc reasons all the way through the Portal volume quirk, DND behavior, audio-focus ducking, and the boot race before a line of code; the inSampleSize subsample guard shows you were thinking about the Gen-1 Portal heap specifically; and the retain-bit drop is a genuinely sharp defense against phantom-doorbell-on-reconnect. Test coverage on the parser is thorough and everything builds and passes clean locally. The two-track HA integration (discoverable notify.send_message for simple alerts, raw mqtt.publish for rich payloads) is exactly the right shape. Merging this. There are a handful of small finishing touches that we'll take on ourselves as a follow-up, recorded here so the full picture is visible. None of them are blockers and none change the design:
We'll also file a follow-up to add a body-size cap on the image fetch. It's safe under the trusted-LAN model you documented, but cheap insurance worth having. Really nice work. Looking forward to more. |
Small post-merge fixes to the notification feature plus a CI repair: - MqttPublisher: split openTarget into a pure routeTarget() (dispatch only) and the open/state echo, so a notify on_tap no longer rewrites the "Open" text entity's retained HA state. - SoundPlayer: abandon any held audio focus before requesting again, so a second chime can't orphan the previous focus request and leave STREAM_MUSIC ducked. Refresh stale STREAM_NOTIFICATION comments to match USAGE_ALARM. - docs: fix duration example (8000 -> 8 seconds) in the design doc. - ci(tests.yml): pin setup-android packages to platform-tools; the action's default `tools` package archive now fails to download and breaks setup. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Tested on a Portal+ (2nd gen)



Adds the ability to pop up a notification, from mqtt, that can display a photo, play a sound, and perform an intent navigation.
Additionally, you can play just a sound in isolation without a notification pop up.
Example use case: User has a doorbell camera that is wired for talk back in Home Assistant. Instead of overriding current user action on screen, a notification appears that plays a sound and contains a photo and description of the interruption. User can decide to select the notification and be navigated to a target dashboard to interact as needed.
Example use case for just sound notification: User has a driveway sensor but no camera/image. Sensor fires and informs portal to play an audible notification.
The notification sound was validated against DND and is attached to the STREAM_ALARM volume control which is not linked to the standard user volume control/buttons.
2 available notification submittal paths. Path 1 uses home assistants default notification capabilities which is limited in what it can send; it can only send a message. Path 2 is direct mqtt message submittal and allows for more configuration, such as notification position, media to play, etc.