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

How to change API key in add-on? #400

Closed
reedy opened this issue Sep 8, 2023 · 8 comments
Closed

How to change API key in add-on? #400

reedy opened this issue Sep 8, 2023 · 8 comments

Comments

@reedy
Copy link
Contributor

reedy commented Sep 8, 2023

Is your feature request related to a problem? Please describe.
I don't see any obvious way on how to change an API key after adding it.

Do I need to add a new integration entity (and then update every sensor/entity usage)? Can I just change it somewhere in config?

Describe the solution you'd like

Documenting how to change the API key would be good as a minimum.

Potentially even including a way on the "Configure" page to replace/override the API key would be very useful.

Describe alternatives you've considered

Additional context
Security issues happen... myenergi may need to reset them some day, you may share it (accidentally or on purpose) with someone you no longer want to have access to the device(s)...

@G6EJD
Copy link

G6EJD commented Sep 8, 2023

This is really easy to do, I’ve done it many times, I just remove the integration, then re-add then enter the new credentials and then everything comes back unaltered. No need for an option to do that.

@reedy
Copy link
Contributor Author

reedy commented Sep 8, 2023

That's fine, but probably worth at least documenting as such then :)

@G6EJD
Copy link

G6EJD commented Sep 8, 2023

You can make the necessary readme amendments and submit it here as a change

@reedy
Copy link
Contributor Author

reedy commented Sep 8, 2023

I can, indeed. As I've submitted other PR's to it previously (and a different one today, too!) ;)

But the issue was originally posed from not knowing the answer.

Adding an option to do it would still make the workflow easier for users anyway. Removing stuff from HA, with unknown consequences of doing so isn't always the most appealing idea. You don't generally expect to have to delete something and re-add it to change a password, for example.

Hub Serial numbers could change too, in case of warranty replacements etc. Especially as they're now integrated into the eddi/zappi devices, but that will result in new/"different" sensors, and things needing updating. I'm not sure a workflow of being able to "change" it would make any sense though.

reedy added a commit to reedy/ha-myenergi that referenced this issue Sep 8, 2023
* Fixes a typo
* Add a list of "common" sensors (firmware version, serial number etc)
* Adds a few more sensors etc that are exposed
* Mention that libbi isn't currently supported; CJNE#395
* Document how to change the API key; CJNE#400
@reedy
Copy link
Contributor Author

reedy commented Sep 8, 2023

Screenshot 2023-09-08 at 12 28 13

reedy added a commit to reedy/ha-myenergi that referenced this issue Sep 8, 2023
* Fixes a typo
* Add a list of "common" sensors (firmware version, serial number etc)
* Adds a few more sensors etc that are exposed
* Mention that libbi isn't currently supported; CJNE#395
* Document how to change the API key; CJNE#400
@AJediIAm
Copy link

AJediIAm commented Sep 8, 2023

Compliments for the nice bug report and taking action to update the documentation. I always appreciate users who take their time to communicate their issues with the developers.

Updating IP address or credentials is commonly done by removing and adding a device in Home Assistant. This is not a MyEnergy specific problem.
There are a number of feature requests on the HA Community Forum to facilitate these changes better which you can vote on.

@reedy
Copy link
Contributor Author

reedy commented Sep 8, 2023

Updating IP address or credentials is commonly done by removing and adding a device in Home Assistant. This is not a MyEnergy specific problem. There are a number of feature requests on the HA Community Forum to facilitate these changes better which you can vote on.

I've not looked how they store it, but https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/ actually lets you view (probably not the best idea, I know), and edit the Api key.

But now you mention it, I think that's the only such case of integrations I've used that does allow it like that... Everything else is write only at install/configure time... Which, as you say, seems to be the standard, for now at least.

I would completely understand not necessarily adding your own way to do/store this, for now. But obviously if/when something is implemented upstream, taking advantage of that wouldn't be a bad thing.

Compliments for the nice bug report and taking action to update the documentation. I always appreciate users who take their time to communicate their issues with the developers.

A FLOSS-y developer background makes me well versed in knowing that if you don't report an issue (unless someone else already has, of course), the developer will probably not know it is one. And similar, if it's things that within your competence to fix, or at least, attempt to do so, it's rarely not appreciated.

And in terms of documentation; better documentation helps everyone.

@reedy
Copy link
Contributor Author

reedy commented Sep 12, 2023

Closing this as resolved. The docs are updated, so until something better happens upstream in HA, I think this is good enough

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