custom-components / grocy

Custom Grocy integration for Home Assistant
Apache License 2.0
158 stars 48 forks source link

Attempted every possible combination I can think of, integration will not configure #286

Open arretx opened 1 year ago

arretx commented 1 year ago

I've installed the add-on, it works.

I've installed the HACS custom component, but I don't know at this point...

I'm stuck at adding/configuring the integration. There's no combination of URL, API, and Port that works. I have a valid API that I created, and I'm able to open the Grocy interface using multiple methods, including ingress.

My HA is running on 192.168.1.101:8123 and SSL is handled by Apache on 192.168.1.200. It is a reverse proxy. The instructions indicate that I need to use port 9192. How does that work?

If I point to http://192.168.1.101:9192 (which is my HA virtual machine) I get 400 bad request. However, if I go to http://192.168.1.101:8123/a0d7b954_grocy/ingress I get the grocy interface.

According to the instruction, we're supposed to enter "our" instance of the Grocy URL. I have no idea what that is supposed to be as I'm able to pull up multiple URLS that all access the same instance of Grocy.

Not sure what to do at this point.

arretx commented 1 year ago

I also removed the add-on from Home Assistant and installed Grocy in a docker container on my server, which also works and is at 192.168.1.140:9192, but then when I try to configure the integration in HA, I get nowhere.

The prompt is a bit misleading as it asks for the API-URL, which in my case is http://192.168.1.140:9192/api, but also says not to use the port number in the URL.

When I submit the configuration, an entry is added to the log file on the Grocy docker container so I know that HA is reaching the instance of Grocy, but I either get "something went wrong" or if I use http with "veriy ssl" checked, I get a spinning wheel of death.

Stuck. Any help appreciated.

arretx commented 1 year ago

I'm attempting this again, and this is the error that I see when I try to install the integration:

2023-08-31 15:42:46.906 ERROR (MainThread) [custom_components.grocy.config_flow] No connection adapters were found for ':/:9192/192.168.1.140/api/system/info'

That address definitely doesn't look right.

karwosts commented 1 year ago

If it helps, when I configure grocy (which I have standalone install, not the addon in HACS), I just use the following. I don't include "/api" in the url.

url: http://192.168.1.12 port: 80 ssl: no

arretx commented 1 year ago

There's confusion here. There's a Grocy Add-on and there's a HACS custom component. I ditched the add-on and run Grocy in a Docker container on my other server. The HACS component is the part that I need, i.e., this repo. The suggested URL and port combination above do not work. Mine is:

http://192.168.1.140 and the port that it's listening on is 9192, not 80. It's on port 80 in the container, but not the host. Same issue. "Something went wrong."

Every time I try, the Grocy log adds the following line to the access log:

192.168.1.101 - - [31/Aug/2023:19:07:22 -0700] "GET /api/system/info HTTP/1.1" 499 0 "-" "python-requests/2.31.0"

karwosts commented 1 year ago

Ah you're right I mispoke. I meant I was using a standalone Grocy install on a separate server, not using the grocy addon.

arretx commented 1 year ago

Is your install listening on port 80? Mine is on 9192. I'm getting a 104 connection reset by peer in my HA logs.

2023-08-31 19:30:09.927 ERROR (MainThread) [custom_components.grocy.config_flow] ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

karwosts commented 1 year ago

Yes I believe it's on port 80, regular http. Did you check the nginx error log?

Looks like you're maybe getting response 499 which I guess is client closed connection, though I couldn't speculate why. My logs just look like this:

192.168.1.31 - - [31/Aug/2023:20:57:12 -0700] "GET /api/chores/21 HTTP/1.1" 200 1043 "-" "python-requests/2.31.0"
192.168.1.31 - - [31/Aug/2023:20:57:12 -0700] "GET /api/chores/22 HTTP/1.1" 200 1043 "-" "python-requests/2.31.0"
192.168.1.31 - - [31/Aug/2023:20:57:12 -0700] "GET /api/chores/23 HTTP/1.1" 200 874 "-" "python-requests/2.31.0"
192.168.1.31 - - [31/Aug/2023:20:57:12 -0700] "GET /api/chores/24 HTTP/1.1" 200 874 "-" "python-requests/2.31.0"
192.168.1.31 - - [31/Aug/2023:20:57:12 -0700] "GET /api/tasks HTTP/1.1" 200 1955 "-" "python-requests/2.31.0"

Sorry couldn't be more helpful.