core: Adding authentication to previously included gen1 Shelly device (without authentication) fails.

The problem

When you add authentication (username and password) via the webinterface to a shelly that has been added to HA without authentication before, the authentication cannot be added via the HA interface.

You get a prompt, asking for the username and password but when it is entered, it fails. (“Re-authentication was unsuccessful, please remove the integration and set it up again.”)

Authentication can be added manually by editing /config/.storage/core.config_entries and adding the lines

 "username": "admin",
 "password": "MyCoolPassword1!",

to the data section of the respective shelly section of the file.

(Found this solution here: https://community.home-assistant.io/t/authentication-of-shelly-devices/326986/3)

What version of Home Assistant Core has the issue?

core-2023.03.1

What was the last working version of Home Assistant Core?

unknown

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Shelly

Link to integration documentation on our website

https://www.home-assistant.io/integrations/shelly

Diagnostics information

home-assistant_shelly_2023-03-21T12-58-28.327Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 7
  • Comments: 26 (2 by maintainers)

Most upvoted comments

Having the same issue with 2024.2.1.

Still the same effects:

  • Adding authentication after adding the device fails.
  • Removing device and adding with authentication fails.
  • Reboot HA and add autodetected device works.

The bug reproduces in HA 2024.2.0

The bug reproduces in HA 2024.1.5

I have seen this issue too - today and already some weeks ago.

Moreover it is not possible to delete and readd the device - adding the integration fails after adding the new credentials.

However, what works is to restart HomeAssistant. Afterwards the device was suddenly auto-detected and I was able to provide the credentials.

BTW: This is valid for gen1 shelly devices. I don’t know if this problem exists with gen2 devices.