-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Add YAML and discovery info export feature for MQTT device subentries #141896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hey there @emontnemery, @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
1af3b60
to
d3b845f
Compare
d3b845f
to
ec41abd
Compare
8acd353
to
9747ebc
Compare
Drafting for now to allow a repair issue to remove the subentry in case an exported item was discovered or added in YAML. |
@NoRi2909 May be you could have a look at the translation strings? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few quick notes on the strings.
Thanks @NoRi2909 ! |
Co-authored-by: Norbert Rittel <norbert@rittel.de>
73ff580
to
e7c7c9e
Compare
Co-authored-by: Norbert Rittel <norbert@rittel.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @jbouwh 👍
Proposed change
Adds YAML and discovery info export and migration feature for MQTT device subentries.
Uses a normal
TextSelector
andTemplateSelector
withread_only
flag enabled for the export flow.Suggestion is to use this as initial implemention and improve the selectors with copy buttons later.
The config export feature helps with trouble shooting the MQTT device subentry and allows to migrate the config to either a YAML based setup or a setup based on MQTT discovery. When the users copies the config, a repair flow is started to assist the user to remove the previous set up MQTT device subentry. The migrated device entities and registry entries will restore after the subentry is removed and the entity is added via the new route (restoring any user customization previous config of the removed device).
Screenshots
YAML export:

Repair flow after YAML config has been copied to remove the subentry and YAML config with the same device identifier has been detected:

The repair flow assists in removing the previous subentry or instructs to change the identifiers as an alternative:

Discovery export:

Repair flow after discovery with the same device identifier has been detected.



Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: