Not sure this is the right place, but HAOS container access question

I’m trying to access the HA docker container in an HAOS install. From the shell (used via the terminal add-on) this command does not work.

docker exec -it homeassistant bash

Seems like I need to be logged in as a different user, but not sure which user or how to do that. How do I get inside that container?

Thanks.

Short answer: You don’t! :slight_smile: What is it, that you want to achieve?

When logging in via the Terminal & SSH Add-on, you are inside the SSH docker container. There you have access to the /config folder of HA and to the HA-CLI (limited commands). This is not a root shell or something else, it is a shell in that container, with access to one mounted folder in the HA container!

1 Like

Thanks Patrick. Ya. I’m trying to temporarily resolve the ongoing issue related to the MyQ integration, which involved editing a bit of python. I’m next to certain this is something I could do in the past … but now it seems unreachable.

As I’ve recently learned that I need to access that SSH container with protection mode turned off. But the popular Terminal and SSH add-on doesn’t have that option (I vaguely recall that it did at one point). There’s an add-on that’s named “advanced terminal and ssh” which does have the protection mode toggle, yet that one won’t start. Anyway t’s probably been at least a couple of years since I’ve tried to do something similar. Is all of this completely locked down via the HAOS these days?

Mostly! :slight_smile: The less users are able to tinker on that system level, the better. :rofl: You seem to know how these stories go. :laughing:

I’m not familiar with the MyQ integration, just have seen there are som etopics and posts about it. If I get you right, you need to change some of the (python) code of that integration, right? Then I’d suggest to make that integration a custom_component. There are some topics around, where you can read up on how to do this (sorry, don’t remember the exact way).

In a nutshell, you clone the component, change some things and you can then copy the files to the custom_components folder inside /config. There you always have them available and can change things as you like. You’d temporarily disable the original integration, until the issues are resolved upstream and then simply go back to the native integration.

Would that be enough for you? :slight_smile:

1 Like

In this case, the bug is in a library used by the integration.

If you put the library in your /config folder, it will override the regular one. You can use these instructions to do that with the pymyq library.

Please note, however, that the fix linked there is apparently not a “real” fix, although it does work for many people. The problem is apparently in the load balancer from Chamberlain. The fix above adds a User-Agent header to the requests. This seems to fix things for many people, but not all, and is likely not really required by the API, but is needed due to some misconfiguration of the Azure load balancer.

2 Likes

Though you should not do it the way you intended to, in answer to your question, use the Community Addon Advanced SSH & Web Terminal addon with protection mode disabled.

Thanks folks! David’s suggestion worked.