Closed elcanux closed 3 months ago
Hey there @hacf-fr, @quentame, mind taking a look at this issue as it has been labeled with an integration (freebox
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
freebox documentation freebox source (message by IssueLinks)
Hey !
Oh thanks ! I've had the same issue several times but did not notice how to reproduce 😅😅😅
I can take a look then.
Any news on that one ?
I think you miss something like
if os.path.exists(token_file):
with open(token_file, "r") as f:
data = json.load(f)
APP_DESC["device_name"] = data["device_name"]
in the get_api function, just before the return.
(My very first python code ever ^^)
I even went a step further : when giving the freebox address, I added an optional field for the service name, defaulted to the hostname. Works for my case, absolutly no idea about non docker installs...
The problem seems to be that on startup, the freebox component (in fact the freebox-api here) is re-requesting a new app Token to the freebox in case the device_name part of app_desc has changed. The freebox ha component is taking device_name from "socket.gethostname()", which in case you are running ha in a docker container is by default the ID of the container, and then is changing when the container is re created.
An easy workaround to this issue is to give your docker container a fixed hostname, as for instance in docker compose:
hostname: ha_raspberrypi
You will need to re create the container to have the change take effect, and re authorize the app on the freebox when HA will restart / reload the freebox component with this new fixed hostname.
Please note you could also re authorize the app on the freebox each time a newly created container is started, but it would be a pain at the end...
No news sorry
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
[...] The freebox ha component is taking device_name from "socket.gethostname()", which in case you are running ha in a docker container is by default the ID of the container, and then is changing when the container is re created. An easy workaround to this issue is to give your docker container a fixed hostname, as for instance in docker compose:
hostname: ha_raspberrypi
[...]
@NicoIIT there are some environments where the hostname may not be able to be modified as easily (for exemple when using charts on Kubernetes), nor is it a good solution.
However the fix for @Xavinoo is a better solution. But maybe using the name of the premises could be a better way instead of using socket.getsockethostname()
or directly asking the user like @Xavinooo proposal.
I also have this issue, but using Kubernetes to orchestrate Docker containers. I have as of now to way to bypass it easily.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
When updating the docker image or recreating the container, the container ID is taken into account on authentication and no longer works. It does not seem to take from the configuration file.
Example
: in .sensor/freebox/xxx.conf, the device_name is 41275ee166b5
On freebox application authentifcation, we can see the last device_name and the new id container created after update
The last contenair id :
What version of Home Assistant Core has the issue?
2023.1.6
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
freebox
Link to integration documentation on our website
https://www.home-assistant.io/integrations/freebox
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