tomaae / homeassistant-portainer Goto Github PK
View Code? Open in Web Editor NEWPortainer integration for Home Assistant
License: Apache License 2.0
Portainer integration for Home Assistant
License: Apache License 2.0
Title is clear ;)
A extra attribute when there is an update.
Maybe a update entity so you can update the container from inside of HA
HA shows both Endpoints as offline if one Endpoint is offline.
Steps to reproduce the behavior:
HA Portainer integration shows only the offline Endpoint as offline.
Home Assistant version:
Core 2024.3.3
Supervisor 2024.03.1
Operating System 12.1
Frontend 20240307.0
Portainer integration version: v1.0.2
Portainer software version:
Endpoint Homeserver 24.0.5
Endpoint PBS 25.0.3
The second integration is on another system, witch is online only every 3 days.
Hi, I followed the steps, also with the access token in Portainer.
When I add the integration configuration it works fine, but I don't see any sensors in HA.
Am I missing something or does the integration perhaps not (yet) work with the latest HA/Portainer versions?
There are no logs generated in HA.
Thanks
Versions
HA: 2019.1
Portainer 1.25.0
When using SSL, the "visit device" link is lacking of https
This is my pretty standard configuration ^_^
So the correct link should be https://192.168.178.90:9412/
Thank you
If you are interested in testing, let me know here.
Integration wont be added to HACS until it is in decent functionality stage and well tested. So all testing will be done by pulling from github directly.
You can also let me know bit about your setup and what would you like to monitor/automate using HA. It will help with development, as my own requirements for this integration are quite basic.
After adding integration, all entities are unavailable when using portainer-agent
Steps to reproduce the behavior:
Working entities that are on docker1, when integration is configured to use portainer1.
Weird is that if I start portainer-agent on docker2, it will immedialy start working for both, docker1 and docker2 containers.
Hello,
Thank you very much for your work.
Do you think it would be possible to add the ability to start/stop/restart a container?
Thank you very much,
Gaeku
Please add spanish
I have 5 environments, i connect 4 of them using portainer agent to portainer installed on my main environment.
So 4 portainer agents installs and 1 portainer install.
I connected the portainer install to the integration.
To make it easy to explain the issue lets name my 5 environments a b c d e
The integration created 2 devices and named them Portainer Endpoints and Portainer a
It added all the container entities under Portainer a which is not a big deal for me.
But inside every container entity there is a attribute called environment that is set to e on all of them.
That is the issue i wanted to point out because i have the same container running on more than 1 endpoint and i can not differentiate.
On initial install
Each container entity to have the correct environment name
config_entry-portainer-e16601bca67a2762bd40d71edfa86a23.json.txt
Hi, I would like to start/stop but mostly restart my containers.
This is because it sometimes happens, for example, that Zigbee2mqtt needs a restart when some devices stop responding correctly.
The best thing would be if the "recreate" function were also included, allowing updates to the containers directly from Home Assistant.
a bunch of services:
all of them should accept the sensor entity created by this integration to know which container should be the target.
portainer documentation: https://app.swaggerhub.com/apis/portainer/portainer-ce/2.19.4
the docker endpoints shold be wrapped in this portainer endpoint:
https://[[HOSTNAME]]/api/endpoints/2/docker/containers/
{ "Id": "54f592b3e7ce49afe649bb0cf7aafbb0a00113233e6eb0535b2abbc7e5c55305", "Portainer": { "ResourceControl": { "Id": 294, "ResourceId": "54f592b3e7ce49afe649bb0cf7aafbb0a00113233e6eb0535b2abbc7e5c55305", "SubResourceIds": [], "Type": 1, "UserAccesses": [ { "UserId": 1, "AccessLevel": 1 } ], "TeamAccesses": [], "Public": false, "AdministratorsOnly": false, "System": false } }, "Warnings": [] }
My favorite Language ist not aviable in lokalise.
I want to have a list of my containers and their environments visible in home assistant.
An attribute value for every entity called environment
which would match the environment name the container is in
Hello together,
I'm running my Homeassistant as an Container and installed HACS.
Now I want to control my other containers with Homeassistant and found your Addon.
When I tried to connect to docker, it says:
unable to fetch data "endpoints" (no_response)
So I activated the debug and he says:
query: endpoints, get, {}
and in the second line:
unable to fetch data "endpoints" (no_response)
I've tried to use https and without, tried to add "/api/endpoints/2/" and other things.
I even removed the docker from the swarm and it didn't helped.
I have no clue how i could go further.
Hopefully, somebody could help me.
Thanks, before.
Greetings
Ralf
Getting KeyError: errors in log
unknown
no error
none
2024-07-16 18:01:34.262 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 255, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 411, in _async_refresh
self.async_update_listeners()
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 165, in async_update_listeners
update_callback()
File "/home/homeassistant/.homeassistant/custom_components/portainer/entity.py", line 114, in _handle_coordinator_update
self._data = self.coordinator.data[self.description.data_path][self._uid]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'bd807a5a7ce5d0b970d12819dd796593f9d9668a9e9faa3b370cbfa1c58aa372'
none
Adding more than one portainer entry results in messed up integration entries list.
In my case portainers running on hosts frigate:9000 and dtake:9000
All devices and entities are there but all are listed under first added host (frigate:9000 in my case).
Please, see attached pictures.
Just add more than one portainer entry.
I thought this was supposed to add portainer as a menu item on the left side, but maybe this plugin just makes entities.
Home Assistant 2023.9.1
I am getting an error, I followed the :
2023-09-14 15:43:59.575 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.portainer
2023-09-14 15:43:59.582 ERROR (MainThread) [homeassistant.components.sensor] portainer: Not adding entity with invalid device info: Invalid device info {'configuration_url': 'http://192.168.0.46:9443', 'connections': {('portainer', 'Portainer_Endpoints')}, 'default_manufacturer': 'Portainer', 'default_name': 'Portainer Endpoints', 'identifiers': {('portainer', 'Portainer_Endpoints')}, 'sw_version': ''} for 'portainer' config entry: device info needs to either describe a device, link to existing device or provide extra information.
When attempting to connect to my remote box via portainer.mywebsite.com and issuing the access token the setup screen replies with 200 and doesn't move forward.
Cannot configure Integration through a FQDN, I get a "No response from host" error
Initial configuration
Host : https://<Fully Qualified Domain Name/ (Tried with or without 443 port)
Use SSL : true (tried with or without)
Verify SSL : true (tried with or without)
Sucesfull configuration
All fields in this sections are required.
Portainer is running in a docker container
I can acccess it with no issue through the Fully Qualified Domain on the local network and from internet.
I have multple environments in Portainer, each for different endpoints.
There are common containers across all these endpoints, for example telegraf/glances/etc.
For containers with the same names across different environments, this integration creates similar name sensors, like
sensor.telegraf_xx_1, sensor.telegraf_xx_2, etc. This becomes difficult to maintain in HA.
Append environment name to the sensor entity,
sensor.environment_one_telegraf, sensor.environment_two_telegraf, etc
I have implemented health-checks for most of my containers, which is really helpful when trying to solve problems before they affect production. This feature is not available via the integration, thus making it impossible to reflect the actual status in home assistant (running ≠ healthy).
Implement (if possible) health status, so that the dashboard for example could show all containers that are unhealthy.
I have multiple containers shown as sensors, and most of them are unavailable and could only be deleted manually - the problem is that I noticed it late and now I have ~1400 sensors listed in HA and it slows things down a bit.
To be clear: this is connected to Portainer with 2 docker standalone environments and running around 30 containers - definitely not in the thousands.
🤷♂️
Containers as sensors don't get duplicated
🤷♂️
🤷♂️
I am runnig Portainer Business Edition - the problem seems to be is that when I update a stack using Portainer BE and select Re-pull image and redeploy
The number of entities goes up by the number of containers in the stack - indicating that this is caused by portainer stopping containers, pulling the latest image and then re deploying them. It also seems that additional container senors in the integration get a new index when they get recreated. For example:
Hello, please add french
It would be nice to have a way to monitor the availability of a new image for a stack/container and trigger the update from Home Assistant.
I don't know if it's feasible, but maybe it could be possible to introduce an update.
entity in Home Assistant that senses whether or not there is a new image available and sends a POST request to a specific stack webhook, triggering the image pull and the stack re-deployment.
I can't find it in the HACS repositories
Go to HACS and try to find it.
Hi,
Did your integration works with CE (community édition= free)
I'm not sur because in CE you can't attaché token to user.
Tks
Both healthy and unhealthy container count seems to always be 0 even though I have some healthy containers running. See pics below
Look at attributes in HA
Numbers should match
I would like a switch to start/stop the stack, that also would tell if the stack is running or "inactive".
There are other ways to start/stop containers from HA, but I think this integration is in a unique position to take advantage of Portainer's stack concept.
Hello,
i've just installed Portainer with HACS and after restarting HA and cleaning cache there is no portainer showed up in der add-on Menu.
any hints?
regards
peter
going to HACS and searching 'Portainer', i get "No repositories found matching your filter"
Sometimes (usually after a restart of homeassistant) the list of entities will have duplicates. So I'll have two containers:
sensor.portainer_myserver_watchtower_2
sensor.portainer_myserver_watchtower_3
When I click into sensor.portainer_myserver_watchtower_2
it says the entity is no longer in use by the integration:
This means my list of entities keeps growing until I manually remove old entities.
Hard to reproduce, seems to happen randomly when I restart homeassistant or the machine itself.
Container entities should always be the same and new ones should not be created:
There should only ever be one entity:
sensor.portainer_myserver_watchtower
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.