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

Shelly integration replaces hostnames with IP addresses #121438

Closed
IngmarStein opened this issue Jul 7, 2024 · 5 comments
Closed

Shelly integration replaces hostnames with IP addresses #121438

IngmarStein opened this issue Jul 7, 2024 · 5 comments

Comments

@IngmarStein
Copy link

The problem

I'd like to configure my shellies using host names to make the integration more resilient against IP address changes. I've configured fixed IP reservations in the DHCP server, but I'd like to remove those and be able to, for example, move the devices from one VLAN to another without manually adjusting all IP addresses in the HA integration.

To that end, I've re-configured each integration to use a local hostname and these appear to stick for a while, but they are eventually replaced again with IP addresses. Is there a way to prevent replacement of the hostname or is that even unnecessary because auto-discovery would pick up new IP addresses anyway and match them with existing devices?

What version of Home Assistant Core has the issue?

2024.7.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

shelly

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@rrooggiieerr
Copy link
Contributor

Looking at the Shelly integration source code (config_flow.py) the integration will take care of IP changes

@IngmarStein
Copy link
Author

Excellent. Matching by MAC address or some other unique identifier provides the stability for the use case I mentioned.
If replacing the user-specified hostname is working as intended, please feel free to close this issue. If not, it's essentially just a cosmetic issue.

@home-assistant
Copy link

home-assistant bot commented Jul 7, 2024

Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of shelly can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign shelly Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


shelly documentation
shelly source
(message by IssueLinks)

@thecode
Copy link
Member

thecode commented Jul 8, 2024

To that end, I've re-configured each integration to use a local hostname and these appear to stick for a while, but they are eventually replaced again with IP addresses.

This is by design, we translate the hostname to IP and store the IP.

Is there a way to prevent replacement of the hostname or is that even unnecessary because auto-discovery would pick up new IP addresses anyway and match them with existing devices?

Currently there is no way to prevent replacing the hostname, the integration will update the IP according to mDNS advertisements from the device (based on MAC). This should also work if you move the device into another VLAN (may take some time or device reboot)

@IngmarStein
Copy link
Author

Alright, thanks for clarifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants