Closed elRadix closed 5 years ago
I just noted the same today. I updated a container using portainer and restarted that container, the new container wasn´t picked-up by docker_monitor. When restarting HA it got monitored again.
@pprazzi - yes this is the 'current' coded behavior.
The master branch uses an old version of my docker monitor. This version connects at startup to the docker API and is for example not able to reconnect or to reinitialize when a container is recreated.
In a different branch, I've rewritten the sensor completely but I need more testing to merge it to the stable master branch;) I've been busy last months finishing my master thesis, but due to illness I've got some time to work a bit on this sensor.
@Sanderhuisman - maybe it is an option to create 1 dev branch, then we can test with it and submit pull request against that one too?
I've moved the docker monitor component to its own repository. The rewritten sensor is available in the develop branch. Warning: the configuration is different. You can now specify the sensors and switch for each individual container ;)
In this way, the component is compatible with HACS
.
@Sanderhuisman thank you. I've tried the dev component and works great. container doesnt "unlink" from HA on recreation. However, I tried different configuration permutations and the only way for the component to work is to list each container. The document says it defaults to all, but If i dont specify a container, it doesnt load. Can this be unspecified so it loads all containers? Thank you
With the rewrite, I made the component such that it can reconnect to the docker host after lost connection. Therefore, it can be that the host is not available when home-assistant starts.
I will make a new bug report and I will look in the direction of auto-discovery of containers. See #16 .
thank you for your response and consideration
Your component should use the container name instead of the image name.
When my image gets auto updated by Ouroboros in this case for plex then the switch does not recognize it anymore. Can you have it linked as dockermon did to the container name ie. plex which never change.
Workaround is to restart HA inorder to get the switch linked again to correct image.
Failed to call service switch/turn_on. 404 Client Error: Not Found ("No such container: e3fd618dcb2ede9a1f1dcba69e0e175b96be576d6065482fccc63b84a81295e0")