GivTCP unable to connect

9 comments started 2023-11-22 last 2023-11-24
Home AutomationHome Assistant
J
#1 JRascagneres

I have attempted to setup GivTCP with my new install. Its unfortunately not working. Given this was my main reason for deciding on GivEnergy this is a little annoying.
Inverter Firmware: D0.305-A0.305
Battery Firmware: 3012

2023-11-22 00:27:54,845 - startup - [CRITICAL] - HA MQTT Service has been found at core-mosquitto
2023-11-22 00:27:54,860 - startup - [INFO] - Supervisor Timezone: Europe/London
2023-11-22 00:27:56,878 - startup - [CRITICAL] - Scanning network for inverters...
2023-11-22 00:27:59,305 - startup - [CRITICAL] - No inverters found...
2023-11-22 00:27:59,320 - startup - [CRITICAL] - Running Redis
2023-11-22 00:27:59,331 - startup - [CRITICAL] - Setting up invertor: 1 of 1
2023/11/22 00:27:59 [notice] 49#49: using the "epoll" event method
2023/11/22 00:27:59 [notice] 49#49: nginx/1.20.2
2023/11/22 00:27:59 [notice] 49#49: OS: Linux 6.1.21-v8
2023/11/22 00:27:59 [notice] 49#49: getrlimit(RLIMIT_NOFILE): 1073741816:1073741816
2023/11/22 00:27:59 [notice] 49#49: start worker processes
2023/11/22 00:27:59 [notice] 49#49: start worker process 54
2023/11/22 00:27:59 [notice] 49#49: start worker process 55
2023/11/22 00:27:59 [notice] 49#49: start worker process 56
2023/11/22 00:27:59 [notice] 49#49: start worker process 57
2023-11-22 00:27:59,459 - startup - [CRITICAL] - Running RQ worker to queue and process givernergy-modbus calls
2023-11-22 00:27:59,460 - startup - [CRITICAL] - Running Invertor read loop every 15s
2023-11-22 00:27:59,470 - startup - [CRITICAL] - Subscribing MQTT Broker for control
2023-11-22 00:27:59,502 - startup - [CRITICAL] - Starting Gunicorn on port 6345
[2023-11-22 00:28:00 +0000] [61] [INFO] Starting gunicorn 21.2.0
[2023-11-22 00:28:00 +0000] [61] [INFO] Listening at: http://0.0.0.0:6345 (61)
[2023-11-22 00:28:00 +0000] [61] [INFO] Using worker: sync
[2023-11-22 00:28:00 +0000] [64] [INFO] Booting worker with pid: 64
[2023-11-22 00:28:00 +0000] [65] [INFO] Booting worker with pid: 65
[2023-11-22 00:28:00 +0000] [66] [INFO] Booting worker with pid: 66
2023-11-22 00:28:03,912 - Inv1 - mqtt_client -  [CRITICAL] - Connecting to MQTT broker for control- core-mosquitto
2023-11-22 00:29:44,024 - Inv1 - mqtt_client -  [ERROR   ] - No serial_number found in MQTT queue. MQTT Control not available.
Traceback (most recent call last):
  File "/app/GivTCP_1/mqtt_client.py", line 402, in <module>
    client.loop_forever()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
    rc = self._loop(timeout)
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1164, in _loop
    rc = self.loop_read()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1556, in loop_read
    rc = self._packet_read()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 2439, in _packet_read
    rc = self._packet_handle()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3039, in _packet_handle
    return self._handle_connack()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3138, in _handle_connack
    on_connect(
  File "/app/GivTCP_1/mqtt_client.py", line 386, in on_connect
    client.subscribe(MQTT_Topic+"/control/"+GiV_Settings.serial_number+"/#")
AttributeError: type object 'GiV_Settings' has no attribute 'serial_number'
2023-11-22 00:31:10,272 - Inv1 - read        -  [ERROR   ] - 10 failed inverter reads in a row so removing regCache to force update...
#2 Cdent

JRascagneres did you enter your inverter IP address correctly in the config, along with all the other bits?

M
#3 morgs

I was also playing with this last night and have exactly the same issue with AIO configuration.
Logs also show no serial no from Inverter.
IP address is correct. LAN connected
I was following the YouTube speak to the Geek vid

#4 PianSom

On my AIO I could not get GivTCP v2.4.2 to work. I had the same error. I use a standalone Docker version.

After much experimenting I got it to work just fine by including the env variable

- INVERTOR_AC_1=False

It’s an easy fix - certainly worth a try.

Ref - https://github.com/britkat1980/giv_tcp/issues/134

J
#5 JRascagneres

Cdent yup, all correct

J
#6 JRascagneres

PianSom I'm not on an aio and yeah I saw your post and tried it. No dice

#7 PianSom

JRascagneres
🙁

Does v2.2.4 work for you? If not, what error does it throw?

J
#8 JRascagneres

PianSom Hrm not tried it, guess I could run it outside of home assistant and try to pull an older image

S
#9 sparky77

Docker compose this, change the
<HA_MQTT_USER>
<HA_MQTT_PASSWORD>
<YOUR INVERTER IP>
<YOUR DOCKER HOST IP>
to your details

version: '3.9'
services:

  GivTCP:
    image: britkat/giv_tcp-ma:2.2.2
    container_name: giv-battery
    ports:
#      - "1883:1883"                  # MQTT
      - "6345:6345"                   # REST (add increments for each inverter)
      - "3000:3000"                   # This should match the WEB_DASH_PORT ENV below
      - "6379:6379"                   # Redis port for job queueing
      - "9181:9181"                   # RQ Dashboard to view job scheduling
    environment:
## Critical to update
      - NUMINVERTORS=1                # Set this to the number of Inverters in your setup, then replicate the next two lines for each inverter (changing the last number of the ENV)
      - INVERTOR_IP_1=<YOUR INVERTER IP>     # Set this to the IP address of your Inverter on your local network
      - INVERTOR_AIO_1=False          # Set this to true if you have an AIO
      - INVERTOR_AC_1=False           # Set this to true if you have an AC on old firmware and don't have the new registers
      - NUMBATTERIES_1=1              # Number of battery modules installed and connected to the above inverter
      - INVERTOR_IP_2=                # Set this to the IP address of your Inverter on your local network
      - INVERTOR_AIO_2=False          # Set this to true if you have an AIO
      - INVERTOR_AC_2=False           # Set this to true if you have an AC on old firmware and don't have the new registers
      - NUMBATTERIES_2=1              # Number of battery modules installed and connected to the above inverter
      - INVERTOR_IP_3=                # Set this to the IP address of your Inverter on your local network
      - INVERTOR_AIO_3=False          # Set this to true if you have an AIO
      - INVERTOR_AC_3=False           # Set this to true if you have an AC on old firmware and don't have the new registers
      - NUMBATTERIES_3=1              # Number of battery modules installed and connected to the above inverter
      - MQTT_OUTPUT=True              # "True" if you want to publish your data to MQTT, "False" otherwise
      - MQTT_ADDRESS=DietPi.lan       # IP address of an existing MQTT broker, or leave as "127.0.0.1" to use the internal broker
      - MQTT_USERNAME=<HA_MQTT_USER>            # Username of your existing broker, if needed. Not required for internal broker
      - MQTT_PASSWORD=<HA_MQTT_PASSWORD>        # Password of your existing broker, if needed. Not required for internal broker
      - HOSTIP=<YOUR DOCKER HOST IP>            # External IP address of the docker host (needed for web dashboard)
      - CACHELOCATION=/config/GivTCP  # Location of cache data, this folder can be mapped to a persistence storage outside the container
      - TZ=Europe/London              # Set to your Timezone
## Optional
      - MQTT_TOPIC=battery            # Root topic to publish data to for Inverter 1. If left blank it will default to GivEnergy/<invertor_serial_number>
      - MQTT_TOPIC_2=                 # Root topic to publish data to for Inverter 2. If left blank it will default to GivEnergy/<invertor_serial_number>
      - MQTT_TOPIC_3=                 # Root topic to publish data to for Inverter 3. If left blank it will default to GivEnergy/<invertor_serial_number>
      - MQTT_PORT=1883                # Port of your existing broker, leave as "1883" for internal broker
      - LOG_LEVEL=Info                # Level of logs to be reported: "Error", "Info" or "Debug"
      - PRINT_RAW=True                # If True this will publish all inverter data unprocessed as well as standard data
      - SELF_RUN=True                 # If True the container will self-run and connect and publish data. If "False" the you will need to trigger externally via REST
      - SELF_RUN_LOOP_TIMER=15        # Wait time between every read command to the inverter
      - QUEUE_RETRIES=2               # The number of calls to the inverter when trying to set a register. A higher number improves the chance of inverter writes succeeding
      - INFLUX_OUTPUT=False           # "True" if you want to publish your data to InfluxDB, "False" otherwise
      - INFLUX_URL=                   # URL of an external Influx instance
      - INFLUX_TOKEN=                 # Access Token for your Influx instance
      - INFLUX_BUCKET=                # Data Bucket of your Influx instance you want data sent to
      - INFLUX_ORG=                   # Influx instance Organisation
      - HA_AUTO_D=True                # If True (and if MQTT_OUTPUT is True) this will publish Home Assistant Auto Discovery messages to the broker
      - HADEVICEPREFIX=GivTCP         # Defines the prefix for all entities in Home Assistant for inverter 1
      - HADEVICEPREFIX_2=GivTCP2      # Defines the prefix for all entities in Home Assistant for inverter 2
      - HADEVICEPREFIX_3=GivTCP3      # Defines the prefix for all entities in Home Assistant for inverter 3
      - PYTHONPATH=/app
      - DYNAMICTARIFF=False           # When set to true DAYRATESTART and NIGHTRATESTART times are ignored and tariff rates are changed by a dedicated entity/function
      - DAYRATE=0.395                 # Price in £/$ for your daytime electricity per kWh
      - NIGHTRATE=0.155               # Price in £/$ for your night time electricity per kWh
      - EXPORTRATE=0.04               # Price in £/$ for your export electricity per kWh
      - DAYRATESTART=05:30            # Time in HH:MM when your day time\expensive tariff kicks in
      - NIGHTRATESTART=23:30          # Time in HH:MM when your night time\cheap tariff kicks in
      - WEB_DASH=True #False          # Enable the web dashboard
      - WEB_DASH_PORT=3000            # Port to serve the web dashboard on. Should be the same as the private port (above), not the container port
      - SMARTTARGET=False             # Enables the PALM capability, requires the three ENV below to be set
      - GEAPI=                        # API Key for the GivEnergy Cloud
      - SOLCASTAPI=                   # API key for Solcast
      - SOLCASTSITEID=                # SiteID for Solcast site (first array)
      - SOLCASTSITEID2=               # SiteID for Solcast site (second array)
      - DATASMOOTHER=medium           # Set the data smoothing to most aggressive setting (High, medium, low, none)
      - PALM_WINTER=01,02,03,10,11,12 # Comma delimited list of the winter months (01=January, etc)
      - PALM_SHOULDER=04,05,09        # Comma delimited list of months in which consumption can vary so SOC calculation should be more cautious
      - PALM_MIN_SOC_TARGET=25        # Lower limit for state of charge (summertime)
      - PALM_MAX_SOC_TARGET=45        # Lower limit for SoC limit in shoulder months
      - PALM_BATT_RESERVE=4           # Battery reserve for power cuts (minimum of 4%)
      - PALM_BATT_UTILISATION=0.85    # Usable proportion of battery (100% less reserve and any charge limit) on a scale of 0-1
      - PALM_WEIGHT=35                # Weighting used for final target soc
      - LOAD_HIST_WEIGHT=1            # Load History Weighting
    restart: always
    privileged: true