Skip to content

Send per-event buzzer sounds to panels in NSPanelConfig - #394

Merged
tpanajott merged 2 commits into
NSPManager:develfrom
jamesmulcahy:feat/buzzer-sounds
Oct 16, 2026
Merged

tpanajott merged 2 commits into
NSPManager:develfrom
jamesmulcahy:feat/buzzer-sounds

Conversation

@jamesmulcahy

@jamesmulcahy jamesmulcahy commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Adds per-event buzzer sounds to NSPanelConfig, so the manager can tell panels what to play for touches, scene activation and scene saves. This is the manager side of the panel buzzer support merged in NSPManager/NSPanelManager-firmware#29. The firmware side that uses it is NSPManager/NSPanelManager-firmware#38.

Changes

  • Proto: adds an NSPanelSoundEvent enum (TOUCH, SCENE_ACTIVATED, SCENE_SAVED) and repeated Sound sounds = 45 (event → RTTTL string) to NSPanelConfig.
  • Settings: adds three global MQTTManager settings, buzzer_sound_touch, buzzer_sound_scene_activated and buzzer_sound_scene_saved. All default to empty. A per-panel setting with the same name overrides the global one.
  • NSPanel::send_config(): adds one sounds entry for each non-empty setting.

Behaviour

An empty setting sends no entry, and the event is silent. Panels therefore sound exactly as they do today until someone sets a sound. Older firmware ignores the new field.

Not in this PR

There is no UI for the settings yet, because the UI is changing. Until there is, set them through the REST API, which also triggers a reload:

POST /rest/settings
{"settings": {"buzzer_sound_touch": "touch:d=32,o=6,b=190:g6,16p,32c7"}}

Generated code

protobuf_nspanel.pb.{cc,h} were regenerated with protoc 27.0. Before applying the proto change, I confirmed it reproduces the checked-in files byte for byte, so the diff contains only this change.

Testing

  • nspanel.cpp and the regenerated protobuf_nspanel.pb.cc pass a syntax-only compile (gcc 15, C++23)
  • Full MQTTManager build in Docker, plus --test: NSPanelTest.* passes, including three new tests in tests/nspanel_test.cpp (no sounds without settings, global sounds sent per event, per-panel settings override global ones)
  • End to end with the companion firmware on a panel

🤖 Generated with Claude Code

Add a repeated Sound field to NSPanelConfig that maps panel events
(TOUCH, SCENE_ACTIVATED, SCENE_SAVED) to RTTTL melodies, for the panel
buzzer support added to the firmware in NSPanelManager-firmware#29.

The sounds come from three new global settings, buzzer_sound_touch,
buzzer_sound_scene_activated and buzzer_sound_scene_saved, which a
panel setting with the same name overrides. They default to empty,
which sends no entry and leaves the event silent, so panels behave as
before until a sound is configured. There is no UI for them yet; set
them through POST /rest/settings.

Generated with protoc 27.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers a panel with no buzzer settings, the global sound for each event,
and panel settings overriding the global ones, including an empty panel
setting silencing an event that has a global sound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jamesmulcahy

Copy link
Copy Markdown
Contributor Author

I've tested this end-to-end with the matching NSPanelManager-firmware PR and can confirm it works end-to-end.

If we can get both pieces merged, I'll followup with a UI change to allow users to customize the sounds

@tpanajott tpanajott left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks pretty good but If we have this sort of functionality it would perhaps be smart to have functionality to, at least over MQTT (ie. from Home Assistant or OpenHAB) be able to put the panel in a "quite mode" for night time. I'm thinking of a user having this on and then needing to get up at night and waking up the wife because the panel beeps. I'm thinking this can be a toggle just as the relay state or such.

@jamesmulcahy

Copy link
Copy Markdown
Contributor Author

@tpanajott Are you thinking that the toggle would be triggered externally, or that we'd include functionality for managing the time periods where it's disabled?

Could we merge the baseline functionality as is, and build this on top? As is, no panels will start playing sounds when this is merged, you'd have to call the API and set sounds up first.

@tpanajott

Copy link
Copy Markdown
Collaborator

Yeah, externally controlled simply by a toggle. I'll merge this as is.

@tpanajott
tpanajott merged commit 4a0ca11 into NSPManager:devel Oct 16, 2026
1 check passed
jamesmulcahy added a commit to jamesmulcahy/NSPanelManager that referenced this pull request Oct 18, 2026
NSPManager#394 added the Sound message and NSPanelConfig.sounds to
protobuf_nspanel.proto but did not regenerate the protobuf-c code the
firmware builds against.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants