HA-DOCKERMON error

Can’t make this custom component work

Error while setting up platform hadockermon
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 149, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 442, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/hadockermon/switch.py”, line 53, in setup_platform
from pydockermon import Dockermon
ModuleNotFoundError: No module named ‘pydockermon’

It’s not a custom component though. It’s a docker container that can manage docker.

How exactly are you trying to set it up?

wrong link, the correct one

Last update: 1 year ago… aka not usable with current HA.

Just use the docker image

I see.

I use the docker image succesfully, the component is for having switches in home assistant

You don’t need a component. Just create switches like the documentation says to do…

If you followed the instructions for the component from the github page then it won’t work.

As noted above the structure required for custom components has changed since “the great migration” a few months back.

you need to set the component directory and files for the new structure.

at a minimum you need to use the files from here:

https://github.com/custom-components/switch.hadockermon/tree/master/custom_components/hadockermon

or better see the link provided at the docs page:

https://github.com/custom-components/switch.hadockermon

But you don’t need custom components at all.

You just add a rest switch and configure it.

This repository has been archived by the owner. It is now read-only.

Deprecated in favor of GitHub - Sanderhuisman/home-assistant-custom-components: 🏡 Custom components for Home-Assistant

Yup, that’s why I posted the link to the newer repo.

I agree. That’s what I actually use.

I was just trying to add more information to the OP for completeness.

And it looks like the second component linked to above might provide additional information in an easier way than having to set up REST sensors/switches for everything. I don’t use it so i really don’t know if it works well or not.

either way, it’s just more info…:slightly_smiling_face:

I’m using the dockermon to control all other dockers on my server for a while now, all worked well.
I’m running a 0.112.4 supervised docker on an Ubuntu 20.04.
Since the new fast startup feature in HA couple versions ago (which is great by the way),
most of the time after restart of the HA it fails to load the dockermon switches.
From the logs it seems like it tries to connect to the dockermon docker and fails because there’s no route?

ERROR (MainThread) [homeassistant.components.rest.switch] No route to resource/endpoint: http://XXX.XXX.XX.3:8126/container/<name>
ERROR (MainThread) [homeassistant.components.rest.switch] No route to resource/endpoint: http://XXX.XXX.XX.3:8126/container/<name>

Most of the time if I restart the HA again it will solve the issue, at least until next restart…

1 Like