Is anyone creating a GivEnergy binding?

After docker pull what did you do? I only edit the compose file, then do docker compose up. No docker pull.

I wonder if you have a container already running, but with the wrong settings, which is then causing the new container to fail. I’m not sure if the commands to run, but find out how to see what containers are already running!

After docker pull britkat/giv_tcp-ma I get the following:

Using default tag: latest
latest: Pulling from britkat/giv_tcp-ma
Digest: sha256:bbda1186c616f6f546596057e230396393584d435f6c85116cf8c7191e9dd6a3
Status: Image is up to date for britkat/giv_tcp-ma:latest
docker.io/britkat/giv_tcp-ma:latest

Looks like it gets me the latest image, although I don’t know where its located.

docker ps shows the following:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0f544b8c5f81 openhab/openhab:3.4.3-debian “/entrypoint gosu op…” 9 hours ago Up 24 minutes (healthy) openhab

The openhab container is the one I set up following the info in the help pages.

Could this be the problem?.

Using docker stop openhab I stopped that container.

Running docker compose up gives me the same error message as before. I now have no containers running.

Using sudo netstat -pna | grep 1883 I get the following:

tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 645/mosquitto
tcp 0 0 192.168.61.250:1883 192.168.61.136:3151 ESTABLISHED 645/mosquitto
tcp 0 0 192.168.61.250:1883 192.168.61.250:55210 ESTABLISHED 645/mosquitto
tcp 0 0 192.168.61.250:1883 192.168.61.166:49154 ESTABLISHED 645/mosquitto
tcp 0 0 127.0.0.1:1883 127.0.0.1:37436 ESTABLISHED 645/mosquitto
tcp 0 0 127.0.0.1:37436 127.0.0.1:1883 ESTABLISHED 581/node
tcp6 0 0 :::1883 :::* LISTEN 645/mosquitto
tcp6 0 0 192.168.61.250:55210 192.168.61.250:1883 ESTABLISHED 824/java

I used sudo kill 645 to clear the processes.

Now docker compose up seems to be running up OK - load of messages etc. Then after about 5 mins it drops out (I didn’t do anything):

docker-giv-GivTCP-1  | 2023-05-06 18:03:59,313 - read - [CRITICAL] - Publishing Home Assistant Discovery messages
^CGracefully stopping... (press Ctrl+C again to force)
Aborting on container exit...
[+] Running 1/1
 ✔ Container docker-giv-GivTCP-1  Stopped                                                                    10.8s
canceled

Why is it doing anything with HA?
If I start mosquitto before the docker compose up command, I get the original error message.

Yep, because the giv_tcp container wants to listen on the MQTT port 1883, but Mosquitto is already using it. I’m not sure why the container is doing that - as mentioned it seems to want to setup another MQTT broker, but a quick glance over the docs don’t seem to show how to disable this.

What happens if you set MQTT to false for the container, and try using the HTTP binding instead, as in my last example?

What happens if you set MQTT to false for the container, and try using the HTTP binding instead, as in my last example?

I’ll try this and let you know.

Only way I can get docker compose up to run is with MQTT service stopped.
MQTT set to false in docker-compose.yml file.

Then I get this

docker compose up
[+] Running 1/1
 ✔ Container docker-giv-GivTCP-1  Recreated                                                                                                                                                               0.2s
Attaching to docker-giv-GivTCP-1
docker-giv-GivTCP-1  | 2023-05-07 12:57:01,516 - startup - [CRITICAL] - No config directory exists, so creating it...
docker-giv-GivTCP-1  | 2023-05-07 12:57:01,518 - startup - [CRITICAL] - Running Redis
docker-giv-GivTCP-1  | 2023-05-07 12:57:01,519 - startup - [CRITICAL] - Running RQ Dashboard on port 9181
docker-giv-GivTCP-1  | 2023-05-07 12:57:01,520 - startup - [CRITICAL] - Setting up invertor: 1 of 1
docker-giv-GivTCP-1  | 2023-05-07 12:57:01,630 - startup - [CRITICAL] - Recreating settings.py for invertor 1
docker-giv-GivTCP-1  | 2023-05-07 12:57:01,633 - startup - [CRITICAL] - Running RQ worker to queue and process givernergy-modbus calls
docker-giv-GivTCP-1  | 2023-05-07 12:57:01,634 - startup - [CRITICAL] - Running Invertor read loop every 5s
docker-giv-GivTCP-1  | 2023-05-07 12:57:01,636 - startup - [CRITICAL] - Starting Gunicorn on port 6345
docker-giv-GivTCP-1  | [2023-05-07 12:57:02 +0100] [14] [INFO] Starting gunicorn 20.1.0
docker-giv-GivTCP-1  | [2023-05-07 12:57:02 +0100] [14] [INFO] Listening at: http://0.0.0.0:6345 (14)
docker-giv-GivTCP-1  | [2023-05-07 12:57:02 +0100] [14] [INFO] Using worker: sync
docker-giv-GivTCP-1  | [2023-05-07 12:57:02 +0100] [17] [INFO] Booting worker with pid: 17
docker-giv-GivTCP-1  | [2023-05-07 12:57:02 +0100] [18] [INFO] Booting worker with pid: 18
docker-giv-GivTCP-1  | [2023-05-07 12:57:02 +0100] [19] [INFO] Booting worker with pid: 19
docker-giv-GivTCP-1  | RQ Dashboard version 0.6.0
docker-giv-GivTCP-1  |  * Running on 0.0.0.0:9181
docker-giv-GivTCP-1  |  * Serving Flask app 'rq_dashboard.cli'
docker-giv-GivTCP-1  |  * Debug mode: off
docker-giv-GivTCP-1  | 2023-05-07 12:57:08,183 - read - [INFO] - No day/Night rate info so reverting to day
docker-giv-GivTCP-1  | 2023-05-07 12:57:08,184 - read - [CRITICAL] - First time running so saving AC Charge status
^CGracefully stopping... (press Ctrl+C again to force)
Aborting on container exit...
[+] Running 1/1
 ✔ Container docker-giv-GivTCP-1  Stopped                                                                                                                                                                10.8s
canceled

This time it only took seconds to drop out. Previously took anything from 30 seconds to 20 mins (then I ctl C).
I’ll try the HTTP binding route now.