Skip to content
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

Changing any network setting resets HA device/entity customization #24

Closed
mundschenk-at opened this issue Jul 25, 2022 · 4 comments
Closed

Comments

@mundschenk-at
Copy link
Collaborator

mundschenk-at commented Jul 25, 2022

Changing anything in the /mqttconfig screen results in all device/entity customizations (friendly name, icon, entity slug) being reset because the HA discovery data is removed even when the HA topic was not changed at all. This is because all config keys are always present when saving (also ensuring a restart on every save because configChanged is always true).

@rodriguezst
Copy link
Contributor

rodriguezst commented Jul 26, 2022

My fault, sorry. Entities are removed from HASS when a value is set as topic (to avoid orphan MQTT retained messages) but even when the topic is not changed and only other MQTT options are changed that function is triggered with a value equal to the previous one.
A check to see if value is equal to the one stored at preference_mqtt_hass_discovery shall be added here:

// Previous HASS config has to be disabled first (remove retained MQTT messages)

I cannot do it myself right now. I am on vacation with limited access to test changes :(

@technyon
Copy link
Owner

I have added the suggested fix (not committed yet). Can you check if it works like this?

nuki_hub.zip

@mundschenk-at
Copy link
Collaborator Author

I updated the FW and clicked "Save" without actually changing any setting - the HA entities stayed safely in their customized form.

@technyon
Copy link
Owner

ok I'll prepare a release then

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

No branches or pull requests

3 participants