Skip to content

Add a button mode that opens an entity page on the panel - #423

Draft
jamesmulcahy wants to merge 1 commit into
NSPManager:develfrom
jamesmulcahy:feat/button-open-entity-page-proto
Draft

jamesmulcahy wants to merge 1 commit into
NSPManager:develfrom
jamesmulcahy:feat/button-open-entity-page-proto

Conversation

@jamesmulcahy

@jamesmulcahy jamesmulcahy commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds a button mode that tells the panel to open an entity's page when a physical button is pressed. It's the first step towards "physical button shortcuts", where a button opens a device's page or runs an action. The first user is a small mode that opens the first media player in the panel's room.

This PR only changes the manager ↔ panel interface. Nothing sends the new mode yet, and the change is additive.

Changes

  • NSPanelConfig.NSPanelButtonMode.OPEN_ENTITY_PAGE = 5: on press, the panel opens the entity page for the button's topic itself, without a round trip to the manager. The relay is left alone.
  • NSPanelConfig.button1_entity_page_topic = 47 and button2_entity_page_topic = 48: the state topic of the entity whose page the button opens. Empty for every other mode.

The panel only needs the state topic: EntityPage::show() already takes one, and every manager entity has get_mqtt_state_topic(). So the same mode will work for lights, thermostats and media players. The manager decides which entity to send.

Compatibility

  • Older firmware that receives mode 5 falls into the default: branch of its button handler. It logs "Unknown button action" and does nothing.
  • Newer firmware paired with an older manager never receives mode 5.

Generated code comes from docker/protobuf/regenerate.sh. Only protobuf_nspanel changes.

Follow-ups

  1. Manager and web UI: a button mode, "Open the room's first media player" (stored as 6), sent as OPEN_ENTITY_PAGE with the first media player in the panel's room, in entities-page order. A room with no media player falls back to NOTIFY_MANAGER. The topic follows the room's entities: every change to them already reloads the manager, which resends each panel's config. Add a button mode that opens the room's first media player #425, with manager and Django tests.
  2. Firmware: handle OPEN_ENTITY_PAGE. The page opens from the page-transition task, waking the screen from the screensaver. A press with the page already showing does nothing, and one with another entity's page showing switches entity. Buttons: open an entity page when the manager configures it NSPanelManager-firmware#64, which depends on the media player firmware PR (Media player support NSPanelManager-firmware#27).
  3. Later: an entity picker, so a button can open any light, thermostat or media player page, or toggle/activate entities that have no page.

All three pieces have been run together against the dev stack and a QEMU-emulated panel.

I'm opening this as a draft, to get feedback on the message design before the follow-ups build on it.

🤖 Generated with Claude Code

OPEN_ENTITY_PAGE tells the panel to open the entity page for
buttonN_entity_page_topic when the button is pressed, without a round
trip to the manager. The relay is left alone.

Older firmware that receives mode 5 logs "Unknown button action" and
does nothing; newer firmware paired with an older manager never
receives it.

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

This branch has not been deployed

No deployments
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.

1 participant