Repository navigation
Add a buzzer mute switch to Home Assistant discovery - #400
Open
jamesmulcahy wants to merge 1 commit into
Open
jamesmulcahy wants to merge 1 commit into
jamesmulcahy wants to merge 1 commit into
Conversation
Each Sonoff panel gets a "Mute sounds" switch. While it is on, the manager sends the panel's config without any buzzer sounds, which silences every event; turning it off sends the configured sounds again. No protocol or firmware change is needed. The switch is registered with retain, so the broker keeps the last command and the mute survives manager restarts. The retained command is only cleared when the panel is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #394: the "quiet mode" toggle from the review, controllable over MQTT from Home Assistant or OpenHAB.
Changes
homeassistant/switch/nspanelmanager/<mac>_buzzer_mute/config), usingnspanel/<mac>/buzzer_mute_cmdandnspanel/<mac>/buzzer_mute_statewith1/0payloads like the relay and screen switches. Custom panels don't get the switch, since only the Sonoff firmware drives a buzzer.NSPanel: the manager subscribes to the command topic. When the mute changes it publishes the state and resends the config. While muted,send_config()leaves out everysoundsentry; unmuting sends the configured sounds again.Behaviour
buzzer_raw_commandstill play.retain: true, so the broker keeps the last command and the mute survives manager restarts. Panel reboots are covered because the config is resent when the panel registers. The retained command is only cleared when the panel is removed.Testing
--test: all 147 tests pass, including seven new ones intests/nspanel_test.cpp(mute sends no sounds and unmute restores them, mute survives a config reload, a repeated command doesn't resend the config, an unknown payload is ignored, Sonoff panels register the retained switch, custom panels don't)🤖 Generated with Claude Code