home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.07k stars 31.09k forks source link

Add-on screen shows the wrong host name/slug-id #126463

Open gcoan opened 2 months ago

gcoan commented 2 months ago

The problem

For any running add-on in HAOS you can see the hostname/slug id, useful if you want to call actions to for example restart the add-on from an automation: IMG_1365

However the add-on slug id is shown incorrectly, with the numeric part and the text part separated by a hyphen

If you look at developer tools / actions / restart addon the dropdown list gives the correct slug id’s which is the number and text name separated by an underscore. IMG_1366

if you try calling the restart service with the slug id from the addon details page (with the hyphen not the underscore), it fails

What version of Home Assistant Core has the issue?

core-2024.9.2

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

All addons

Link to integration documentation on our website

https://www.home-assistant.io/addons/

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

mib1185 commented 2 months ago

The hostname in the add-on info page is not the add-on (slugified) id - it is the hostname of the docker container running this add-on.

gcoan commented 2 months ago

Ok so maybe the issue then is that the host name is shown on the add on page when all of the supervisor service calls (eg restart service) require the slug id not the host name.

This is inconsistent and causes confusion when determining parameters required for service calls.

rwjack commented 2 months ago

I just noticed this for an addon I maintain: https://github.com/rwjack/addon-snapserver-spotify/tree/main/snapserver

image

Why does the slug have that odd hash in front of it?

I want it to be like core mosquitto for example:

image

mib1185 commented 2 months ago

Why does the slug have that odd hash in front of it?

This is documented here https://developers.home-assistant.io/docs/add-ons/communication#network

home-assistant[bot] commented 2 months ago

Hey there @home-assistant/supervisor, mind taking a look at this issue as it has been labeled with an integration (hassio) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `hassio` 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 hassio` 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)


hassio documentation hassio source (message by IssueLinks)