Companion name not updated after public key change; Reconfigure fails while port is in use
Maintainers usually reply within 11 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 46/100
Research direction
Start in __init__.py around lines 511–530, where the public key mismatch migration updates the config entry, then trace how companion names and entity IDs are stored and migrated. Also inspect _reconfigure_save() and USB validation in config_flow.py around line 293 to understand why a running entry cannot reconnect. Done means the refreshed name and all companion entities are migrated, and Reconfigure works for a running USB entry or a disabled entry.
Written by the indexing model from the issue text.
Description
Summary
After replacing the companion node (same USB path, new device with a new public key and a new name),
the integration's public key migration updates pubkey and renames most entities to the new key
prefix, but the stored companion name (entry.data["name"], shown as "Primary Node" in the options
dialog) keeps the old node's name. There is no working way to update it from the UI.
Environment
- meshcore-ha 3.0.5 (HACS)
- Home Assistant 2026.10.4 (Docker,
network_mode: host) - Old companion: RAK4631, Companion USB, name
old@exemple - New companion: Heltec V4, Companion USB 1.18, name
new@exemple - Connection: USB,
/dev/ttyMESHCORE, 115200
Steps to reproduce
- Run the integration with companion A (USB).
- Replace it with companion B (different key and name) on the same
/dev/ttyMESHCORE. - Reload the integration → "MeshCore public key changed" repair appears, entities are migrated to the new prefix.
- Open the integration options → "Primary Node" still shows companion A's name.
Impact
coordinator.name comes from entry.data[CONF_NAME] (coordinator.py:196), so after the swap:
- Outgoing messages are reported with the old name (
logbook.py:476usescoordinator.nameas
sender_name). Automations that filter out own echoes bysender_name(new name) stop working —
every bot reply triggered an "incoming message" notification. - Device / entity names keep the old name suffix (
..._4631_essh_fr). - Some entities were not migrated to the new key prefix at all:
sensor.<old>_cli_console,
button.<old>_cli_run,button.<old>_cli_clear,sensor.<old>_discovered_summary_*,
update.<old>_firmware.
In __init__.py (around lines 511–530) the mismatch branch only sets new_data[CONF_PUBKEY] = live_pubkey;
the name is not refreshed from the device.
Reconfigure doesn't help
_reconfigure_save() (config_flow.py:293) would update the name, but:
- With the entry enabled, Reconfigure → USB → same path fails with "Failed to connect",
presumably becausevalidate_usb_input()opens the serial port that the running integration already holds. - With the entry disabled, Reconfigure is not offered.
The only workaround was to delete the config entry and add it again, which resets all options and repeater
subscriptions and changes the companion entity IDs.
Expected
- The public key migration also refreshes the stored companion name from the device (as Reconfigure does), and
migrates all companion entities to the new prefix. - Reconfigure works for a running USB entry (e.g., release the connection before validating), or is available
while the entry is disabled.
Happy to provide diagnostics or debug logs if useful.
- Dominant language
- Python
- Stars
- 269
- Forks
- 58
- Avg merge
- 10d 17h
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from meshcore-dev/meshcore-ha
-
Beta Tagging?Openquestion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
meshcore-dev/meshcore-ha#365 · 1 comment ·
Maintainers usually reply within 11 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
meshcore-dev/meshcore-ha#196 · 3 comments ·
Maintainers usually reply within 11 days
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
meshcore-dev/meshcore-ha#432 ·
Maintainers usually reply within 11 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
meshcore-dev/meshcore-ha#426 ·
Maintainers usually reply within 11 days
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
meshcore-dev/meshcore-ha#420 · 1 comment ·
Maintainers usually reply within 11 days
All issues in meshcore-dev/meshcore-ha
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day