Change of authentication credentials should be a requirement for all official integrations

I have been around ha since, I think, 2016. I have never seen that statement in the docs and it doesn’t seem that intuitive. I suggest it be made a lot clearer. But I am unsure where to add it to the docs. Any suggestions?

1 Like

It’s not true for all integrations. That’s the problem. But it is true for most.

In that case it would be great if this is handled by HA core and not per integration.
This would make integration maintenance also easier.
But I now know what you mean.

Just tried with the integrations I use. The first one I tried adds a new sensor in addition to the old. No, many integrations do not alter existing item by re-adding. It just adds more instances.

Each integration handles config flow for their integration, so that’s not an option.

It depends on the integration and what it uses for unique identification of each device & entity. And yes, many integrations have a solid backing behind this. It just so happens that you found one that didn’t.

An example where this wouldn’t work is if you decided to integrate a integration using a hostname, but the second time you use the IP address. That would most likely create a new integration with additional entities.

One might whimsically muse the return of yaml :slight_smile:

The whole UI based configuration system did not seem to contemplate people changing configurations.

It does, it’s just not natural. You can delete the integration too and re-add it and your settings should remain the same for your entities. It’s not a great system, nor is it intuitive. But you can change it in a number of ways.

I would love a button to redo the configuration, that’s why I voted for this FR. I’m just explaining how to get to the goal right now. It seems that this upsets people for some reason.

1 Like

Will the device_id change when you do that? Given the number of automations that use devices rather than entities, that would be problematic.

Anyway, i voted too :smile:

I think we just understand “many” differently. The fact is. Many integrations have a good way to reconfigure a device. And many do not. Too many. Those that have it does it well or good enough. I gave an example of a good one as one of my first postings in this thread. And thank you to all the many devs that has provided a reconfig per device.

No, when you delete the integration without restarting, the entity registry should remain until you restart. So it should just plop right back to where it was with new credentials.

Again, it 100% depends on what the integration uses to identify each unique config entry. Some are poorly set up, most are not. The ones that fit in the “most are not” category, found unique identifiers all the way down the chain so that you can reintegrate without issue.

If an integration used my example above (hostname or IP), that would be an example of a bad integration in my opinion. Mainly because IP’s can change. A mac address would be a better choice.

Looks like the hooks for this are finally coming: Config Entries can now provide a reconfigure step | Home Assistant Developer Docs (home-assistant.io)

1 Like

Yes, there’s been whispers that reauth and reloading was being worked on. I’ve brought it up many times.

2 Likes

The one issue I had, is more simply a change of service port for an internal app (due to a change of kubernetes containers), I thought it was straight forward to change.

Regarding the password, it would be good to record the time of when it was setup and provide a ‘Password anniversary’ change update that would be cool.

One integration, HEOS, you have to do the signing with a service (Denon HEOS - Home Assistant).

Out of curiosity, on my previous commits in github there were few checks before I was allowed to even get the merge requested (which were actually spot on!), could a check be added to verify if the re-auth exist?

The groundwork for reauth and reconfiguration was added a few versions ago, now integrations just need to use the new methods.

2 Likes