GivTCP new release 1.1.4

172 comments started 2022-08-10 last 2022-10-25
Home AutomationHome Assistant
B
#1 Britkat

New update to GivTCP has dropped. Version 1.1.4 is here. I’ve tested as much as I can with my single invertor single battery plant. If you’re running the home assistant addon it “should” let you know there’s an update.

Be warned there is a breaking change for the entity and device names in Home Assistant, sorry about that but it’s there to help those with multiple invertors and batteries!

New features to check out include:

  • web dashboard courtesy of Dan Gallo. (Point your browser to the IP address of your home assistant machine usually at http://homeassistant.local:3000 )
  • rate tracking if you’re on a peak/off peak tariff.
  • Data filtering (no more zero values)
  • PV string current
  • rename home assistant device prefix (instead of always “GivTCP” at the start)

Make sure you review all the new config entries/ENV to set it up properly.

As always happy to help if people get stuck and please do feedback what does and doesn’t work!

L
#2 locked

looking foreward to trying it out over the weekend

#3 TheDragon (GivEnergy)

Britkat
Hi, had a look this AM. Doesnt report a newer version.
Will delete and re download. Had to do that with 1.1.1 to 1.1.3 for the multi battery addition you made

#4 TheDragon (GivEnergy)

Uninstalled 1.1.3
Trying to install 1.1.4 just sits with a circle over install and doesnt do anything. 🙁

#5 TheDragon (GivEnergy)

OK took ages and a rebuild. But got it installed. A few extra options to config.
So using the onling list I set them all. The SelfRun time, is this minutes, or seconds? As the data only seems to update once on Add-On Reboot.
I set the Inverter IP, MQTT user, pass.
Set the Host IP of container also to 192.168.0.100 (My Rasprry Pi IP)

The web broswer at 192.168.0.100:3000 says connetion refused.

Also loads of error's in teh error log
NoneType: None
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != ModbusIOException
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != ModbusIOException
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != ModbusIOException
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != ModbusIOException
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != ModbusIOException
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != ModbusIOException
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != ModbusIOException
ERROR:GivTCP_1:Error collecting registers: (<class 'KeyError'>, KeyError(HR:013), <traceback object at 0x7f92eb1700>)
ERROR:GivTCP_1:Removing lock file due to read error
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Transaction failed
ERROR:givenergy_modbus:Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 164 bytes (0 received)
NoneType: None
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != ModbusIOException
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode

#6 TheDragon (GivEnergy)

Have restored to a previous HA build.
Rebuilt the 1.1.4 GivTCP and it seems to be now running.
The web server at http://192.168.0.100:3000 doesnt connect.
So using teh usual 192.168.0.100:8123
Still has some errors, Below
Creating /app/GivTCP_1 folder
cp -r /app/GivTCP /app/GivTCP_1
/app/GivTCP_1/settings.py does not exist, creating.
/app/GivTCP_1/startup.sh exists, deleting and re-creating.
/app/GivEnergy-Smart-Home-Display/app.json exists, deleting and re-creating.
Creating settings.py for Invertor 1
Creating startup.sh file for Invertor 1
Running Invertor read loop every 20s...
Starting Mosquitto on port 1883
subscribing Mosquitto on port 1883
instance is 1
Starting Gunicorn on port 6345
1660216677: mosquitto version 2.0.11 starting
1660216677: Config loaded from /app/GivTCP_1/mqtt.conf.
1660216677: Opening ipv4 listen socket on port 1883.
1660216677: Error: Address in use
[2022-08-11 12:18:01 +0100] [21] [INFO] Starting gunicorn 20.1.0
[2022-08-11 12:18:01 +0100] [21] [INFO] Listening at: http://0.0.0.0:6345 (21)
[2022-08-11 12:18:01 +0100] [21] [INFO] Using worker: sync
[2022-08-11 12:18:01 +0100] [32] [INFO] Booting worker with pid: 32
[2022-08-11 12:18:01 +0100] [33] [INFO] Booting worker with pid: 33
[2022-08-11 12:18:01 +0100] [34] [INFO] Booting worker with pid: 34
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
/bin/sh: getconf: not found
child_process.js:790
err = new Error(msg);
^
Error: Command failed: getconf LONG_BIT
/bin/sh: getconf: not found
at checkExecSyncError (child_process.js:790:11)
at Object.execSync (child_process.js:863:15)
at arch (/usr/local/lib/node_modules/serve/node_modules/arch/index.js:52:21)
at file:///usr/local/lib/node_modules/serve/node_modules/clipboardy/lib/windows.js:8:22
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async Object.loadESM (internal/process/esm_loader.js:68:5)
at async handleMainPromise (internal/modules/run_main.js:59:12) {
status: 127,
signal: null,
output: [ null, '', '/bin/sh: getconf: not found\n' ],
pid: 35,
stdout: '',
stderr: '/bin/sh: getconf: not found\n'
}
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f9f91fc00>)
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f9f3f9d80>)
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f9f95e0c0>)
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f9f97b780>)
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f9f97bc80>)

#7 TheDragon (GivEnergy)

This site can’t be reachedhomeassistant.local:3000 refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

L
#8 lxalln

Unfortunately since running 1.1.4 from ~ midnight last night, the 0 readings have continued as before:

Those 3 drops are all to 0 and then back again to the correct level.

Logs (docker) from the latest drop:

2022-08-11 12:02:35 stdout ERROR:givenergy_modbus:Did not receive expected response type: ReadInputRegistersResponse != ModbusIOException
2022-08-11 12:02:35 stdout NoneType: None
2022-08-11 12:02:35 stdout ERROR:givenergy_modbus:Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
2022-08-11 12:02:34 stdout ERROR:givenergy_modbus:Did not receive expected response type: ReadInputRegistersResponse != ErrorResponse

#9 TheDragon (GivEnergy)

lxalln how often are you polling? I've set mine to 20s. Saved and rebooted the Addon.
Logs say it has accepted the 20s refresh. Dials seem to agree. To see if the crying graphs is any better
Battery data seems to be much less often which is perfectly fine. 5min refresh on detailed battery data is fine. Think this refresh is the inverter updating it not the GivTCP not asking for it.

L
#10 lxalln

TheDragon (GivEnergy) I'm polling whatever the default is, which I think is 5s. I'll see if I can set it to be longer and see if that affects the issue.

B
#11 Britkat

TheDragon (GivEnergy) there’s an error which says address in use, which suggests something else on your host is running on port 3000, is that true?
The other errors around getConf are new to me, not sure what they are! Are you using the addon?

B
#12 Britkat

TheDragon (GivEnergy) GivTCP does a “fullRefresh” every 1 in 20 calls, this may be why some data appears to update less frequently. This is to allow a quicker data read for the more time critical data points (power etc…)

B
#13 Britkat

lxalln That's annoying to see the 0 drops, the code (in theory) doesn't allow it, and I haven't seen any for 3 days now (was getting 4-5 a day). Can you leave it running and let me know if you get any more and if there is any pattern to it?

Also do you see any errors in the log related to Zero values?

Finally do they drop to zero or another value?

#14 TheDragon (GivEnergy)

Britkat That makes perfect sense.

Port 3000 isnt one in use by me. Maybe something else on the HA build is using it.
Sent you a PM with a screenshot of a full port scan of HA running on a RP3

Also seeing the odd 0 value too

L
#15 lxalln

Britkat it appears like updating to 1.1.4 hadn't worked properly, as when I finally got it to update, I see that you changed some of the environment variable names, so my connection didn't work. Notably, Inverter IP address.

Now I get a single reading from the inverter when starting up, but nothing after that.
I just get this error, over and over again:

ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f087dc80600>)

#16 hoggy

It may be a good idea (including Britkat) to add on what Inverter & Battery your running to help narrow down if it's an inverter/battery specific error or a global one)

#17 TheDragon (GivEnergy)

lxalln
I had that, did a rebuild, then reboot the Rasperry Pi. Been fine since

L
#18 lxalln

TheDragon (GivEnergy) a rebuild of what?
I'm running the docker container on a Synology box at the moment.

B
#20 Britkat

lxalln can you turn debug level to info and repast the logs. That will help me see where in the process it’s getting stuck.

Also perhaps a clean install in a new container (making sure original container isn’t running) could help rule out other issues

L
#21 lxalln

Britkat

After digging through, I found the error.
Right before it errors, it's reading Battery To Grid.

INFO:GivTCP_1:Getting Battery to House Power Flow
INFO:GivTCP_1:Getting Grid to Battery/House Power Flow
INFO:GivTCP_1:Getting Battery to Grid Power Flow
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f611947c400>)
INFO:GivTCP_1:Converting datetime to publish safe string

L
#22 lxalln

Britkat it appears to be working this morning. I wonder if that's because the battery is not being discharged at all at the moment. I'll see if it stops working later on this evening.

A
#23 anglefire

I pulled the new container and it didn't work - the log said it couldn't find the sh /app/GivTCP/startup.sh

I went back to the previous version and all working ok again - but get this error - even though its working in Node-red. (I do it the old way!)

ERROR:GivTCP:No serial_number available waiting for first read run to occur

L
#24 lxalln

lxalln @Britkat as suspected, now that I'm exporting from Battery to Grid, it's crashing again.

B
#25 Britkat

lxalln ok, will check that out, I did manage to replicate this, it’s an error in some of the logging code. I’ll specifically check out the battery to Grid code to check it’s not something else.

B
#26 Britkat

anglefire new container shouldn’t be looking there. New structure puts the code in GivTCP_1. The entry point to the container should be setup.sh
Best thing is to remove the container and starts fresh and there are a lot of changes.

If you already did that then I’ll take a look at it later

A
#27 anglefire

I was using the docker compose file from https://github.com/GivEnergy/giv_tcp
The name of the container in Portainer is givtcp_GivTCP_1
I'll see if that works!

A
#28 anglefire

Stopped and restarted the stack and get these errors:

pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != NoneType
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != NoneType
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != NoneType
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != NoneType
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != NoneType
ERROR:GivTCP_1:Error collecting registers: (<class 'KeyError'>, KeyError(HR:013), <traceback object at 0x7f3c60be4d80>)
ERROR:GivTCP_1:Removing lock file due to read error
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != NoneType
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != NoneType
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != NoneType
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != NoneType
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadHoldingRegistersResponse != NoneType
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:pymodbus.client.sync:Connection to (, 8899) failed: [Errno -2] Name does not resolve
ERROR:givenergy_modbus:Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
response = super().execute(request)
File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
ERROR:givenergy_modbus😃id not receive expected response type: ReadInputRegistersResponse != NoneType
ERROR:GivTCP_1:Error collecting registers: (<class 'KeyError'>, KeyError(HR:013), <traceback object at 0x7f3c60be5580>)
ERROR:GivTCP_1:Removing lock file due to read error
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur

A
#29 anglefire

Britkat Sorted it in the main - I hadn't spotted the ENV changes - are they published anywhere apart from looking through the container script?

Now I see this when it runs:
Creating /app/GivTCP_1 folder
cp -r /app/GivTCP /app/GivTCP_1
/app/GivTCP_1/settings.py does not exist, creating.
/app/GivTCP_1/startup.sh does not exist, creating.
/app/GivEnergy-Smart-Home-Display/app.json exists, deleting and re-creating.
Creating settings.py for Invertor 1
Creating startup.sh file for Invertor 1
subscribing Mosquitto on port 1883
instance is 1
Starting Gunicorn on port 6345
[2022-08-14 10:40:43 +0100] [16] [INFO] Starting gunicorn 20.1.0
[2022-08-14 10:40:43 +0100] [16] [INFO] Listening at: http://0.0.0.0:6345 (16)
[2022-08-14 10:40:43 +0100] [16] [INFO] Using worker: sync
[2022-08-14 10:40:43 +0100] [27] [INFO] Booting worker with pid: 27
[2022-08-14 10:40:43 +0100] [29] [INFO] Booting worker with pid: 29
[2022-08-14 10:40:43 +0100] [28] [INFO] Booting worker with pid: 28
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
INFO: Accepting connections at http://localhost:3000.
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur

The dash board doesn't connect - but that could be because I'm in REST mode and using NodeRed to get the data?

A
#30 anglefire

@"Britkat" Any reason why the HOSTIP is 192.168.2.10 ? I only ask because I have a 192.168.2.x range network (I'm double natted due to my provider having allsorts of VPN's in their router and I have a managed UniFi network and router) and that range is the provider local range which changes to .1 on my local network (Though their router is in the DMZ)

T
#31 Tim

anglefire HOSTIP is 192.168.2.10

If you set the hostname of a device with a particular MAC address in your DHCP router, you can specify the hostname in GivTCP at which point, it doesn't matter what the IP address is. It's a pain having to tell the router what every device is but once done, it's so much easier to identify devices and all your web URLs are to the hostname. You can set static IP addresses in the router, but setting hostname just makes it more friendly (IMHO).

A
#32 anglefire

Tim Most of the fixed kit in my house are on Fixed IP addresses, set by the router - UniFi is very good in that regard!
I've just actually cloned my VM as it was running on a VM for the unifi controller - and it took about a minute to get it up and running on a new VM and I then stripped the Unifi out of the new one and the GivTCp out of the other! And it has a Host name of GivTCP too!

#33 TheDragon (GivEnergy)

Tim I do this with all my Tasmona convert smart plugs. All have DHCP manual reservations addresses in a set range. All Called SmartPlug_DeviceName

A
#34 anglefire

And now got the dashboard to work - just had to expose port 3000 in the docker compose file 🙂

A
#35 anglefire

Wonder if the dashboard can have a light theme - as that would fit in better with my controls graphics 🙂

#36 TheDragon (GivEnergy)

anglefire I cant get the web server on port 3000 to be seen on my network using a Rasperry Pi and the Native HA OS version. Port is closed. Despite Mark now has a web server running on it with a web UI on it

A
#37 anglefire

TheDragon (GivEnergy) mine is effectively hassio - it’s just running on a vm. Givtcp is running on another vm running docker and docker compose with a revised compose file from the git repository.
I had to add the 3000 port to the config (amongst other env changes ) to make it all work.

I can always post that file on here with perhaps some additional comments as to what I’ve changed?

#38 TheDragon (GivEnergy)

anglefire

If yours is I docker, maybe a different issue.
Mine is running In native HA OS

A
#39 anglefire

TheDragon (GivEnergy) no the ha is an official install using proxmox and the hassio as the os. So yes it is docker but not implemented in the usual way.

The GIVTcp program is running on a separate vm on the same box which is running docker.

And it all works at the moment.

B
#40 Britkat

anglefire the host ip needs to be changed to the ip of the host machine running GivTCP, if you’re running it within HA OS as an addon then you can use homeassistant.local, otherwise use the IP address of the machine which runs docker

A
#41 anglefire

Britkat thanks for that. I’d sort of worked that out.
The only “error” I now see is the serial number one.

Everything else is working fine.

Thanks for your efforts with this it is very much appreciated

B
#42 Britkat

anglefire it’s normal to see then no serial number error a couple of times at the start, as long as it doesn’t persist then it should all be working

A
#43 anglefire

Britkat It repeats the same error - but all seems to work - MQTT works (Though I'm not using that in HA) Rest works, called from Node-red. dashboard works.

#44 TheDragon (GivEnergy)

@Britkat Have you had expierence is altering the commit_interval setting. To preserve SD card life.

Instead of default 1second, Ive edited my configuration.yaml to include
recorder:
commit_interval: 30

Seems to be ok, SO only writes to SD card 2x a min instead of 60. May save some write cycles

But the $$ question is, will this imact your GivTCP working normaly?

A
#45 anglefire

TheDragon (GivEnergy) I assume you are using a rpi? I was with a SSD drive rather than sd card due to the stories I heard of sd cards failing.

Very easy to do with the latest flash utilities.

Though I’ve now switched to an intel NUC - i5 processor and 240gb ssd - and then proxmox as a hyper visor running a number of VM’s for different things.

B
#46 Britkat

TheDragon (GivEnergy) I wouldn’t think it would affect GivTCP, but have never tested it. I run HA in a VM on a symbology NAS.

#47 TheDragon (GivEnergy)

Britkat
Seems to be ok with less writes to SDcard.
The RAM usage has gone up a bit, which would be expected

S
#48 SpeakToTheGeek

It would be great if we could configure a different TCP port for the web interface. TCP 3000 conflicts with the default TCP port for Z-Wave JS to MQTT. Took me ages of digging around to find the conflict 🙂 You can tweak the port exposed by the Z-wave add-on so it can be resolved, but it's not obvious unless you know what you're looking for

S
#49 SpeakToTheGeek

I've also noticed that these entries appear regularly in the logs. Are they anything to be concerned with? Does it possibly just needs some checking of data that might have come in as null instead of an expected value and handling appropriately, or is this the symptom of another problem?

ERROR:givenergy_modbus:Did not receive expected response type: ReadInputRegistersResponse != ModbusIOException
ERROR:GivTCP_1:Error collecting registers: (<class 'KeyError'>, KeyError(IR:000), <traceback object at 0x7f82d01340>)
ERROR:GivTCP_1:Removing lock file due to read error
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f8270b600>)
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f829c5980>)
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f8270a700>)
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f82d02680>)
ERROR:GivTCP_1:Error processing registers: (<class 'TypeError'>, TypeError('can only concatenate str (not "float") to str'), <traceback object at 0x7f829e2840>)
A
#50 anglefire

SpeakToTheGeek I think that was noted before - I'm sure Britkat will confirm.

A
#51 anglefire

SpeakToTheGeek Port 3000 is also the default Grafana port - not that that matters in my case because the GivTCP container is on a different VM and IP address.

S
#52 SpeakToTheGeek

anglefire ah ok cool thanks.

I’ve also been getting a problem with infrequent updates from GivTCP since upgrading to 1.1.4. I can’t figure out a pattern though, sometimes it’s updating power entities every few seconds, sometimes it takes a few hours, or anything in between. I know that the local network is working fine because the app reports live values, so it’s just GivTCP. Any ideas @Britkat or any logging I can enable to help diagnose it?!
http://www.speaktothegeek.co.uk/public/givtcp-drops.jpg

A
#53 anglefire

SpeakToTheGeek I've just looked at mine - and I can't see any dropouts since updating to 1.1.4 - except when I've been messing about!

#54 TheDragon (GivEnergy)

SpeakToTheGeek Have you set the run time in the settings, same place you entere the Inverter IP, but lower down. I have mine set to 30s.
Power refreshes every 30sec. Less critical, such as SoC reasing Britkak mention its a 1:20 poll.

S
#55 SpeakToTheGeek

TheDragon (GivEnergy) SELF_RUN_LOOP_TIMER? Got that set to the default of 5. It seems to work fine a lot of the time, but randomly decides to not update sometimes, like the new filtering is going a bit overboard 🙂 See this graph from this afternoon. After this it was fine, see this graph comparing GivEnergy with the actual inverter's data:

https://www.speaktothegeek.co.uk/public/givtcp_solaredge_compare.png

A
#56 anglefire

I have mine called from nodered every 10seconds rather than self running.
I personally think that 5 seconds is a bit quick - especially if you also use the givenergy app as that will be calling every 10 seconds.
The modbus baud rate is decent at 57600 so shouldn’t be a real issue but might if the two calls (three including the cloud) ask at the same time.

S
#57 SpeakToTheGeek

anglefire Possibly, but previous releases have been running just fine for a good few weeks. I have had three installations of GivTCP all talking to the inverter at the same time for several hours with no issues (just for testing purposes), but right now it's just the one instance.

A
#58 anglefire

SpeakToTheGeek ah ok. I’ve only ever run one at a time.

#59 TheDragon (GivEnergy)

SpeakToTheGeek
Previous it would call as soon as it had recieved the previous. Now the loop timer is respected. I set it to 10 and seems to be ok

#60 TheDragon (GivEnergy)

Picture

B
#61 Britkat

Some of these issues are already noted. Next release (1.1.5) should fix the str/float issues mentioned above, provide filtering of battery stats and hopefully resolve the hanging instance. @SpeakToTheGeek , if you’re happy to test I will probably have something ready early next week, when I get back from holiday!

#62 TheDragon (GivEnergy)

Combined GivTCP & Apex-Charts

B
#63 Britkat

SpeakToTheGeek those errors might explain your data “sticking”. If you can turn on debug level to INFO can you share the logs so I can see where it gets stuck?

#64 TheDragon (GivEnergy)

Hopefully once teh GE smart plugs arrive, there maybe some more entities discovered by GivTCP, to make things like this. These are Tasmota ones.
The GE ones should be easier to integrate if their data is also published out by the inverter

A
#65 anglefire

TheDragon (GivEnergy) I run Home assistant and have both Shelly and Tasmota devices - easy to integrate so I'm not really sure what GivEnergy ones will bring to the party really - apart from being a central hub which might appeal to some of course

#66 TheDragon (GivEnergy)

anglefire Think they will appeal more to Jo average, who doesnt need or want the details HA brings.

Yes the power will all be in one place in the GE portal, just like it is for us in HA.

I am hopeing GE will intergate some automation processes into them, as that seems to be asked a few times.

L
#67 lxalln

SpeakToTheGeek The sticking issue I was seeing was when I was exporting from battery to grid (which was causing the str/float issues. And whilst that's crashing, no data is reported to HA.

@Britkat Looking forward to the fix to that, for the time being I've turned off my automation for smart battery dumping, so that my charts stay working. Although missing out on some crazy high Octopus Agile Export prices at the moment!

S
#68 SpeakToTheGeek

Britkat no problem at all

A
#69 anglefire

Britkat I’ll give it a go. Though won’t be straight away as I’m away next week!

B
#70 Britkat

I’ve identified the issue with the str float, but can’t build a new image till I’m back home, would normally fix this kind of thing asap! If anyone is running in docker (not addon) and wants to test the wip, there is a “dev” build on dockerhub which has some of the fixes ready for next build. If anyone wants to try it out then let me know how you get on!

A
#72 anglefire

sparky77 You need to update the docker compose file for the latest ENV.

This is mine and it works - you will need to edit it to suit your install obviously!

version: "3.9"
services:
GivTCP:
image: britkat/giv_tcp-ma:latest
ports:
- "1883:1883"
- "6345:6345"
- "3000:3000"
environment:
- INVERTOR_IP_1=192.168.1.193 # Set this to the IP address of your Invertor on your local network
- NUMBATTERIES_1=1 # Number of battery modules installed and connected to the above invertor
- MQTT_OUTPUT=True # "True" if you want to publish your data to MQTT, "False" otherwise
- MQTT_ADDRESS=192.168.1.170 # IP address of an existing MQTT broker, or leave as "127.0.0.1" to use the internal broker
- MQTT_USERNAME=mqtt-user # Username of your existing broker, if needed. Not required for internal broker
- MQTT_PASSWORD=PASSWORD # Password of your existing broker, if needed. Not required for internal broker
- MQTT_TOPIC=GivEnergy/Data # Root topic to publish data to. 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=Error # Level of logs to be reported: "Error", "Info" or "Debug"
- DEBUG_FILE_LOCATION= # Location of log file stored inside the container, defalt location is /app/GivTCP
- PRINT_RAW=True # If True this will publish all inverotr data unprocessed as well as standard data
- SELF_RUN=False # 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=10 # Wait time between every read command to the invertor
- 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
- JSON_OUTPUT=True
- INFLUX_ORG= # Influx instance Organisation
- HA_AUTO_D=False # If True (and if MQTT_OUTPUT is True) this will publish Home Assistant Auto Discovery messages to the broker
- HADEVICEPREFIX=GivTCP
- HOSTIP=192.168.1.107
- DAYRATESTART=00:01
- NIGHTRATESTART=00:00
- DAYRATE=0.2422
- NIGHTRATE=0.2422
- EXPORTRATE=0.075


  
  
restart: always
privileged: true
S
#73 sparky77

here are the logs

Creating /app/GivTCP_1 folder
cp -r /app/GivTCP /app/GivTCP_1
/app/GivTCP_1/settings.py does not exist, creating.
/app/GivTCP_1/startup.sh does not exist, creating.
/app/GivEnergy-Smart-Home-Display/app.json exists, deleting and re-creating.
Creating settings.py for Invertor 1
Creating startup.sh file for Invertor 1
subscribing Mosquitto on port 1883
instance is 1
Starting Gunicorn on port 6345
/bin/sh: getconf: not found
[2022-08-19 09:30:08 +0100] [16] [INFO] Starting gunicorn 20.1.0
[2022-08-19 09:30:08 +0100] [16] [INFO] Listening at: http://0.0.0.0:6345 (16)
[2022-08-19 09:30:08 +0100] [16] [INFO] Using worker: sync
[2022-08-19 09:30:08 +0100] [28] [INFO] Booting worker with pid: 28
child_process.js:790
    err = new Error(msg);
          ^
Error: Command failed: getconf LONG_BIT
/bin/sh: getconf: not found
    at checkExecSyncError (child_process.js:790:11)
    at Object.execSync (child_process.js:863:15)
    at arch (/usr/local/lib/node_modules/serve/node_modules/arch/index.js:52:21)
    at file:///usr/local/lib/node_modules/serve/node_modules/clipboardy/lib/windows.js:8:22
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)
    at async handleMainPromise (internal/modules/run_main.js:59:12) {
  status: 127,
  signal: null,
  output: [ null, '', '/bin/sh: getconf: not found\n' ],
  pid: 27,
  stdout: '',
  stderr: '/bin/sh: getconf: not found\n'
}
[2022-08-19 09:30:08 +0100] [29] [INFO] Booting worker with pid: 29
[2022-08-19 09:30:08 +0100] [30] [INFO] Booting worker with pid: 30
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur

here is my docker-compose.yaml

version: '3.9'
services:

  filebrowser:
    image: hurlenko/filebrowser
    container_name: filebrowser 
    user: "${UID}:${GID}"
    ports:
      - 443:8080
    volumes:
      - ./:/data
      - ./volumes/filebrowser/config:/config
    environment:
      - FB_BASEURL=/filebrowser
    restart: always

  home_assistant:
    container_name: home_assistant
    image: ghcr.io/home-assistant/raspberrypi3-homeassistant:stable
    restart: unless-stopped
    network_mode: host
    volumes:
    - /etc/localtime:/etc/localtime:ro
    - ./volumes/home_assistant:/config


  GivTCP:
    image: britkat/giv_tcp-ma:latest
    ports:
#      - "1883:1883"
      - "6345:6345"
      - "3000:3000"
    environment:
      - INVERTOR_IP_1=Battery.lan # Set this to the IP address of your Invertor on your local network
      - NUMBATTERIES_1=1 # Number of battery modules installed and connected to the above invertor
      - MQTT_OUTPUT=True # "True" if you want to publish your data to MQTT, "False" otherwise
      - MQTT_ADDRESS=Diet-Pi.lan # IP address of an existing MQTT broker, or leave as "127.0.0.1" to use the internal broker
      - MQTT_USERNAME=mosquitto #mqtt-user # Username of your existing broker, if needed. Not required for internal broker
      - MQTT_PASSWORD=dee # Password of your existing broker, if needed. Not required for internal broker
      - MQTT_TOPIC=GivEnergy/Data # Root topic to publish data to. 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=Error # Level of logs to be reported: "Error", "Info" or "Debug"
      - DEBUG_FILE_LOCATION= # Location of log file stored inside the container, defalt location is /app/GivTCP
      - PRINT_RAW=True # If True this will publish all inverotr data unprocessed as well as standard data
      - SELF_RUN=False # 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=10 # Wait time between every read command to the invertor
      - 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
      - JSON_OUTPUT=True
      - INFLUX_ORG= # Influx instance Organisation
      - HA_AUTO_D=False # If True (and if MQTT_OUTPUT is True) this will publish Home Assistant Auto Discovery messages to the broker
      - HADEVICEPREFIX=GivTCP
      - HOSTIP=192.168.8.8
      - DAYRATESTART=00:01
      - NIGHTRATESTART=00:00
      - DAYRATE=0.2422
      - NIGHTRATE=0.2422
      - EXPORTRATE=0.075

    restart: always
    privileged: true 

mqtt has been installed on the same dietpi and is working in homeassistant & mqtt explorer
but no giv docker.
were am i going wrong

B
#74 Britkat

You have self run set to false. Do you trigger the script by using the REST interface?

Also, you seem to be missing the NUMINVERTORS ENV which should be set to 1
(Although so is anglefire, so not sure how that one works)

S
#75 sparky77

Britkat no i will set it to true, and try again

S
#76 sparky77

still the same

Creating /app/GivTCP_1 folder
cp -r /app/GivTCP /app/GivTCP_1
/app/GivTCP_1/settings.py does not exist, creating.
/app/GivTCP_1/startup.sh does not exist, creating.
/app/GivEnergy-Smart-Home-Display/app.json exists, deleting and re-creating.
Creating settings.py for Invertor 1
Creating startup.sh file for Invertor 1
Running Invertor read loop every 10s...
subscribing Mosquitto on port 1883
instance is 1
Starting Gunicorn on port 6345
[2022-08-19 09:56:25 +0100] [17] [INFO] Starting gunicorn 20.1.0
[2022-08-19 09:56:25 +0100] [17] [INFO] Listening at: http://0.0.0.0:6345 (17)
[2022-08-19 09:56:25 +0100] [17] [INFO] Using worker: sync
[2022-08-19 09:56:25 +0100] [28] [INFO] Booting worker with pid: 28
[2022-08-19 09:56:25 +0100] [29] [INFO] Booting worker with pid: 29
[2022-08-19 09:56:25 +0100] [30] [INFO] Booting worker with pid: 30
/bin/sh: getconf: not found
child_process.js:790
    err = new Error(msg);
          ^
Error: Command failed: getconf LONG_BIT
/bin/sh: getconf: not found
    at checkExecSyncError (child_process.js:790:11)
    at Object.execSync (child_process.js:863:15)
    at arch (/usr/local/lib/node_modules/serve/node_modules/arch/index.js:52:21)
    at file:///usr/local/lib/node_modules/serve/node_modules/clipboardy/lib/windows.js:8:22
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)
    at async handleMainPromise (internal/modules/run_main.js:59:12) {
  status: 127,
  signal: null,
  output: [ null, '', '/bin/sh: getconf: not found\n' ],
  pid: 31,
  stdout: '',
  stderr: '/bin/sh: getconf: not found\n'
}
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:givenergy_modbus:Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1:Error collecting registers: (<class 'KeyError'>, KeyError(HR:120), <traceback object at 0x7fa527edc0>)
ERROR:GivTCP_1:Removing lock file due to read error
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur

Docker compose bit

  GivTCP:
    image: britkat/giv_tcp-ma:latest
    ports:
#      - "1883:1883"
      - "6345:6345"
      - "3000:3000"
    environment:
      - INVERTOR_IP_1=Battery.lan # Set this to the IP address of your Invertor on your local network
      - NUMBATTERIES_1=1 # Number of battery modules installed and connected to the above invertor
      - MQTT_OUTPUT=True # "True" if you want to publish your data to MQTT, "False" otherwise
      - MQTT_ADDRESS=Diet-Pi.lan # IP address of an existing MQTT broker, or leave as "127.0.0.1" to use the internal broker
      - MQTT_USERNAME=mosquitto #mqtt-user # Username of your existing broker, if needed. Not required for internal broker
      - MQTT_PASSWORD=dee # Password of your existing broker, if needed. Not required for internal broker
      - MQTT_TOPIC=GivEnergy/Data # Root topic to publish data to. 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=Error # Level of logs to be reported: "Error", "Info" or "Debug"
      - DEBUG_FILE_LOCATION= # Location of log file stored inside the container, defalt location is /app/GivTCP
      - PRINT_RAW=True # If True this will publish all inverotr 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=10 # Wait time between every read command to the invertor
      - 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
      - JSON_OUTPUT=True
      - INFLUX_ORG= # Influx instance Organisation
      - HA_AUTO_D=False # If True (and if MQTT_OUTPUT is True) this will publish Home Assistant Auto Discovery messages to the broker
      - HADEVICEPREFIX=GivTCP
      - HOSTIP=Diet-Pi.lan
      - DAYRATESTART=00:01
      - NIGHTRATESTART=00:00
      - DAYRATE=0.2422
      - NIGHTRATE=0.2422
      - EXPORTRATE=0.075

    restart: always
    privileged: true 

after complete reboot logs

/app/GivTCP_1/settings.py exists, deleting and re-creating.
/app/GivTCP_1/startup.sh exists, deleting and re-creating.
/app/GivEnergy-Smart-Home-Display/app.json exists, deleting and re-creating.
Creating settings.py for Invertor 1
Creating startup.sh file for Invertor 1
Running Invertor read loop every 10s...
subscribing Mosquitto on port 1883
instance is 1
Starting Gunicorn on port 6345
[2022-08-19 10:04:21 +0100] [18] [INFO] Starting gunicorn 20.1.0
[2022-08-19 10:04:21 +0100] [18] [INFO] Listening at: http://0.0.0.0:6345 (18)
[2022-08-19 10:04:21 +0100] [18] [INFO] Using worker: sync
[2022-08-19 10:04:21 +0100] [29] [INFO] Booting worker with pid: 29
[2022-08-19 10:04:21 +0100] [30] [INFO] Booting worker with pid: 30
[2022-08-19 10:04:21 +0100] [31] [INFO] Booting worker with pid: 31
/bin/sh: getconf: not found
child_process.js:790
    err = new Error(msg);
          ^
Error: Command failed: getconf LONG_BIT
/bin/sh: getconf: not found
    at checkExecSyncError (child_process.js:790:11)
    at Object.execSync (child_process.js:863:15)
    at arch (/usr/local/lib/node_modules/serve/node_modules/arch/index.js:52:21)
    at file:///usr/local/lib/node_modules/serve/node_modules/clipboardy/lib/windows.js:8:22
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)
    at async handleMainPromise (internal/modules/run_main.js:59:12) {
  status: 127,
  signal: null,
  output: [ null, '', '/bin/sh: getconf: not found\n' ],
  pid: 32,
  stdout: '',
  stderr: '/bin/sh: getconf: not found\n'
}
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
ERROR:GivTCP_1_MQTT_client:No serial_number available waiting for first read run to occur
B
#77 Britkat

The error is thrown by the web dashboard, are you running something else on port 3000?

A
#79 anglefire

Britkat grafana uses port 3000 by default so if it’s on the same “computer” then it will error.

A
#80 anglefire

Britkat I wonder if it’s one that just gets created by default? I will have a look when I get back home as it would be good to have it included for completeness

B
#81 Britkat

Next update will allow changing default port for web dashboard

#82 TheDragon (GivEnergy)

Britkat That is a good idea. Despite ive nothing on 3000, i cant acces the web browser on that port. HA Add-On version

A
#83 anglefire

I've added NUMINVERTERS=1 into my compose file - but it had defaulted to that anyway.

S
#84 SpeakToTheGeek

Britkat The dev build appears to be working great so far. No familiar errors in the logs anymore. I'll run it for a few more hours to just judge the stability - normally I run the HA add-on, but I have Docker available on a NAS for testing purposes so am running it there and pushing MQTT through to Mosquitto on the HA box.

B
#85 Britkat

That’s good to hear, a few more bits to add to it before I push out 1.1.5 for the addon

#86 TheDragon (GivEnergy)

Britkat Awesome.

This weekend?

B
#87 Britkat

I'm back and working on it now... 😀

T
#88 Tim

@Britkat Hi, I updated to the latest package today but the containers are not running properly. The Portainer logs show "sh: can't open '/app/GivTCP/startup.sh': No such file or directory". Any ideas how to fix (Pi 3B and Bullseye). Ta

A
#89 anglefire

Tim at a rough guess you haven’t updated the environment variables to the newest set? Did you run 1.1.4 ok?

T
#90 Tim

anglefire I didn't especially want to update to 1.1.4 (don't use HA and what was there had been working fine) and only realised I had when there were more ENV variables than the previous container. I had been getting time outs from the inverter dongle and had gone in to check that SELF_RUN was set to false (I trigger it from a Node-Red flow when I want an update). I set the SELF_RUN_LOOP_TIMER to 60 just in case that might make a difference and then deployed the container, at which point it must have downloaded :Latest (as designed) and I had new ENV variables. Since then I've been getting the error above and am currently stumped. Any ideas on how to resolve the issue?

#91 TheDragon (GivEnergy)

1.1.5 is on there too, Im testing it on HA with Pi3B+ The filters for zero value causing a few issues, needing the Addon Stopping and reseting to get out of the loop. Think BrikKak is working on it still, hence not released to the world 1.1.5 is there

A
#92 anglefire

Tim did you look at my docker compose file ? That should at least give you the right env you need. It is what mine is.

B
#93 Britkat

Tim the best bet is to remove the container and create a fresh one. That will allow you to have the right entry point (which is what I think your problem is, should now point to /app/setup.sh) as well as the right ENV.
Give that a go and it should work OK. If not let me know

T
#94 Tim

Britkat @anglefire @TheDragon (GivEnergy) Thanks for responding. The :latest version doesn't yet support two inverters, so I went back to the July 22 version and that didn't work for me. I checked the images in portainer and I had one unused (because the containers that had been working had been deleted) dated 2022-03-21 14:02:32. I created a new container with britkat/giv_tcp-ma:2022.03.21 and saved this as a template (in case I need to go back to it again). This image is timestamped 2022-03-21 13:41:05, so about 90 minutes after the one I had previously used. Anyway I'm assuming this is close enough.

Info file

{
    "AppArmorProfile": "",
    "Args": [
        "/app/GivTCP/startup.sh"
    ],
    "Config": {
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": null,
        "Domainname": "",
        "Entrypoint": [
            "sh",
            "/app/GivTCP/startup.sh"
        ],
        "Env": [
            "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "LANG=C.UTF-8",
            "GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D",
            "PYTHON_VERSION=3.10.0rc2",
            "PYTHON_PIP_VERSION=21.2.4",
            "PYTHON_SETUPTOOLS_VERSION=57.5.0",
            "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/c20b0cfd643cd4a19246ccf204e2997af70f6b21/public/get-pip.py",
            "PYTHON_GET_PIP_SHA256=fa6f3fb93cce234cd4e8dd2beb54a51ab9c247653b52855a48dd44e6b21ff28b",
            "INVERTOR_IP=192.168.1.119",
            "NUM_BATTERIES=1",
            "MQTT_OUTPUT=True",
            "MQTT_ADDRESS=192.168.1.166",
            "MQTT_USERNAME=",
            "MQTT_PASSWORD=",
            "MQTT_TOPIC=home/Givenergy",
            "MQTT_PORT=1883",
            "LOG_LEVEL=Error",
            "DEBUG_FILE_LOCATION=",
            "PRINT_RAW=True",
            "SELF_RUN=False",
            "SELF_RUN_LOOP_TIMER=60",
            "INFLUX_OUTPUT=False",
            "INFLUX_URL=",
            "INFLUX_TOKEN=",
            "INFLUX_BUCKET=",
            "INFLUX_ORG=",
            "HA_AUTO_D=False",
            "GIVTCPINSTANCE=1",
            "PYTHONPATH=/app"
        ],
        "ExposedPorts": {
            "1883/tcp": {},
            "6345/tcp": {}
        },
        "Hostname": "192.168.1.104",
        "Image": "britkat/giv_tcp-ma:2022.03.21",
        "Labels": {},
        "OnBuild": null,
        "OpenStdin": false,
        "StdinOnce": false,
        "Tty": false,
        "User": "",
        "Volumes": null,
        "WorkingDir": "/app"
    },
    "Created": "2022-08-22T10:44:17.429241973Z",
    "Driver": "overlay2",
    "ExecIDs": null,
    "GraphDriver": {
        "Data": {
            "LowerDir": "/var/lib/docker/overlay2/f9e7acb5c54b943615b1e7c625f5c9509f01a4b4d32b60dfba7e1d4cbe2d194c-init/diff:/var/lib/docker/overlay2/3681f21f40c3b62c993a83d6f7823b5c3efb2af4c66aafac008b91631531af13/diff:/var/lib/docker/overlay2/0445ce7bd62149a2d2aba9fab89458903a2ffcaa930b0f9a72cb62a7ebead94e/diff:/var/lib/docker/overlay2/67b165fb16bbcc01f4667d6f7010b104c77a0d0fab0c7da6c47f412f4bef1c62/diff:/var/lib/docker/overlay2/8c52d57887d3c4c161e1bc3facfd39c80a8144df2ff8ed041ac701d9d01aa323/diff:/var/lib/docker/overlay2/8a2b24829c749624fa97035e16712146e53a7ca8e86ca7c76f1a0d81185fdf8e/diff:/var/lib/docker/overlay2/ba22c0ce4eb69df113f47a25ebeaccc5722d5f0abfd269a911c585eefdd3e449/diff:/var/lib/docker/overlay2/b091f9faaeb1f373d6008bce2479213c508986725190403d795ba8c44f5f7ed8/diff:/var/lib/docker/overlay2/d2e1592705d75dab0c3ac86209c9f54616499d3dec1e3dbb706f0b02f01db1c9/diff:/var/lib/docker/overlay2/4b7849a47dd54bd12f6e3407796381fa46e958986fc724366099d59a495e832e/diff:/var/lib/docker/overlay2/217bbe78917e1bf8e4e7486202d7e3b96e916644c13f86d54f0b20aec5b8e33e/diff:/var/lib/docker/overlay2/013e24baaaef942860b0493aea26f7254ff9819d8debc443fbb9b08e65aa8e46/diff",
            "MergedDir": "/var/lib/docker/overlay2/f9e7acb5c54b943615b1e7c625f5c9509f01a4b4d32b60dfba7e1d4cbe2d194c/merged",
            "UpperDir": "/var/lib/docker/overlay2/f9e7acb5c54b943615b1e7c625f5c9509f01a4b4d32b60dfba7e1d4cbe2d194c/diff",
            "WorkDir": "/var/lib/docker/overlay2/f9e7acb5c54b943615b1e7c625f5c9509f01a4b4d32b60dfba7e1d4cbe2d194c/work"
        },
        "Name": "overlay2"
    },
    "HostConfig": {
        "AutoRemove": false,
        "Binds": [],
        "BlkioDeviceReadBps": null,
        "BlkioDeviceReadIOps": null,
        "BlkioDeviceWriteBps": null,
        "BlkioDeviceWriteIOps": null,
        "BlkioWeight": 0,
        "BlkioWeightDevice": null,
        "CapAdd": [
            "AUDIT_WRITE",
            "CHOWN",
            "DAC_OVERRIDE",
            "FOWNER",
            "FSETID",
            "KILL",
            "MKNOD",
            "NET_BIND_SERVICE",
            "NET_RAW",
            "SETFCAP",
            "SETGID",
            "SETPCAP",
            "SETUID",
            "SYS_CHROOT"
        ],
        "CapDrop": [
            "AUDIT_CONTROL",
            "BLOCK_SUSPEND",
            "DAC_READ_SEARCH",
            "IPC_LOCK",
            "IPC_OWNER",
            "LEASE",
            "LINUX_IMMUTABLE",
            "MAC_ADMIN",
            "MAC_OVERRIDE",
            "NET_ADMIN",
            "NET_BROADCAST",
            "SYSLOG",
            "SYS_ADMIN",
            "SYS_BOOT",
            "SYS_MODULE",
            "SYS_NICE",
            "SYS_PACCT",
            "SYS_PTRACE",
            "SYS_RAWIO",
            "SYS_RESOURCE",
            "SYS_TIME",
            "SYS_TTY_CONFIG",
            "WAKE_ALARM"
        ],
        "Cgroup": "",
        "CgroupParent": "",
        "CgroupnsMode": "private",
        "ConsoleSize": [
            0,
            0
        ],
        "ContainerIDFile": "",
        "CpuCount": 0,
        "CpuPercent": 0,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpuShares": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "DeviceCgroupRules": null,
        "DeviceRequests": null,
        "Devices": [],
        "Dns": [],
        "DnsOptions": [],
        "DnsSearch": [],
        "ExtraHosts": [],
        "GroupAdd": null,
        "IOMaximumBandwidth": 0,
        "IOMaximumIOps": 0,
        "Init": false,
        "IpcMode": "private",
        "Isolation": "",
        "KernelMemory": 0,
        "KernelMemoryTCP": 0,
        "Links": null,
        "LogConfig": {
            "Config": {},
            "Type": "json-file"
        },
        "MaskedPaths": null,
        "Memory": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "MemorySwappiness": null,
        "NanoCpus": 0,
        "NetworkMode": "host",
        "OomKillDisable": null,
        "OomScoreAdj": 0,
        "PidMode": "",
        "PidsLimit": null,
        "PortBindings": {},
        "Privileged": true,
        "PublishAllPorts": false,
        "ReadonlyPaths": null,
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": "no"
        },
        "Runtime": "runc",
        "SecurityOpt": [
            "label=disable"
        ],
        "ShmSize": 67108864,
        "UTSMode": "",
        "Ulimits": null,
        "UsernsMode": "",
        "VolumeDriver": "",
        "VolumesFrom": null
    },
    "HostnamePath": "/var/lib/docker/containers/67edeeb9244ab23ff1a086ee3ae8c2e7f6f2c791661ca92035765de07e7cec9d/hostname",
    "HostsPath": "/var/lib/docker/containers/67edeeb9244ab23ff1a086ee3ae8c2e7f6f2c791661ca92035765de07e7cec9d/hosts",
    "Id": "67edeeb9244ab23ff1a086ee3ae8c2e7f6f2c791661ca92035765de07e7cec9d",
    "Image": "sha256:1df075f4c3a99aa876204908d7da05a8f9496c48df45e3e0afe415acaac05a5c",
    "LogPath": "/var/lib/docker/containers/67edeeb9244ab23ff1a086ee3ae8c2e7f6f2c791661ca92035765de07e7cec9d/67edeeb9244ab23ff1a086ee3ae8c2e7f6f2c791661ca92035765de07e7cec9d-json.log",
    "MountLabel": "",
    "Mounts": [],
    "Name": "/InverterL",
    "NetworkSettings": {
        "Bridge": "",
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "HairpinMode": false,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "MacAddress": "",
        "Networks": {
            "host": {
                "Aliases": null,
                "DriverOpts": null,
                "EndpointID": "",
                "Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "IPAMConfig": {},
                "IPAddress": "",
                "IPPrefixLen": 0,
                "IPv6Gateway": "",
                "Links": null,
                "MacAddress": "",
                "NetworkID": "76d239f669b6977caf13756ad2a9e06f00030003edc9c3acb6108545b9247d9f"
            }
        },
        "Ports": {},
        "SandboxID": "105318c55990e0e2170a7eb4c358452241c2516a2d3bce6686f9f7c0e10d107c",
        "SandboxKey": "/var/run/docker/netns/default",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null
    },
    "Path": "sh",
    "Platform": "linux",
    "Portainer": {
        "ResourceControl": {
            "Id": 39,
            "ResourceId": "67edeeb9244ab23ff1a086ee3ae8c2e7f6f2c791661ca92035765de07e7cec9d",
            "SubResourceIds": [],
            "Type": 1,
            "UserAccesses": [],
            "TeamAccesses": [],
            "Public": false,
            "AdministratorsOnly": true,
            "System": false
        }
    },
    "ProcessLabel": "",
    "ResolvConfPath": "/var/lib/docker/containers/67edeeb9244ab23ff1a086ee3ae8c2e7f6f2c791661ca92035765de07e7cec9d/resolv.conf",
    "RestartCount": 0,
    "State": {
        "Dead": false,
        "Error": "",
        "ExitCode": 3,
        "FinishedAt": "2022-08-22T10:44:23.854020945Z",
        "OOMKilled": false,
        "Paused": false,
        "Pid": 0,
        "Restarting": false,
        "Running": false,
        "StartedAt": "2022-08-22T10:44:18.513119005Z",
        "Status": "exited"
    }
}

Log File

2022-08-22T10:44:18.501350475Z /app/GivTCP/settings.py does not exist, creating.
2022-08-22T10:44:18.507238646Z subscribing Mosquitto on port 1883
2022-08-22T10:44:18.509366613Z Starting Gunicorn on port 6345
2022-08-22T10:44:20.797258691Z [2022-08-22 10:44:20 +0000] [9] [INFO] Starting gunicorn 20.1.0
2022-08-22T10:44:20.800733062Z [2022-08-22 10:44:20 +0000] [9] [INFO] Listening at: http://0.0.0.0:6345 (9)
2022-08-22T10:44:20.801251291Z [2022-08-22 10:44:20 +0000] [9] [INFO] Using worker: sync
2022-08-22T10:44:20.817289245Z [2022-08-22 10:44:20 +0000] [10] [INFO] Booting worker with pid: 10
2022-08-22T10:44:20.864501390Z [2022-08-22 10:44:20 +0000] [11] [INFO] Booting worker with pid: 11
2022-08-22T10:44:20.940778299Z [2022-08-22 10:44:20 +0000] [12] [INFO] Booting worker with pid: 12
2022-08-22T10:44:21.841964610Z ERROR:GivTCP:No serial_number available waiting for first read run to occur
2022-08-22T10:44:22.920492894Z [2022-08-22 10:44:22 +0000] [12] [ERROR] Exception in worker process
2022-08-22T10:44:22.920692946Z Traceback (most recent call last):
2022-08-22T10:44:22.920765237Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2022-08-22T10:44:22.920834612Z     worker.init_process()
2022-08-22T10:44:22.920897737Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process
2022-08-22T10:44:22.920961643Z     self.load_wsgi()
2022-08-22T10:44:22.921025966Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2022-08-22T10:44:22.921089925Z     self.wsgi = self.app.wsgi()
2022-08-22T10:44:22.921152424Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-08-22T10:44:22.921215081Z     self.callable = self.load()
2022-08-22T10:44:22.921278987Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2022-08-22T10:44:22.921342216Z     return self.load_wsgiapp()
2022-08-22T10:44:22.921404560Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2022-08-22T10:44:22.921468414Z     return util.import_app(self.app_uri)
2022-08-22T10:44:22.921531695Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/util.py", line 359, in import_app
2022-08-22T10:44:22.921594716Z     mod = importlib.import_module(module)
2022-08-22T10:44:22.921657424Z   File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
2022-08-22T10:44:22.921721018Z     return _bootstrap._gcd_import(name[level:], package, level)
2022-08-22T10:44:22.921786538Z   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2022-08-22T10:44:22.921851538Z   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2022-08-22T10:44:22.921916643Z   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
2022-08-22T10:44:22.922055965Z   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
2022-08-22T10:44:22.922124090Z   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
2022-08-22T10:44:22.922190757Z   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2022-08-22T10:44:22.922255548Z   File "/app/GivTCP/REST.py", line 5, in <module>
2022-08-22T10:44:22.922318778Z     import read as rd       #grab passthrough functions from main read file
2022-08-22T10:44:22.922383465Z ModuleNotFoundError: No module named 'read'
2022-08-22T10:44:22.922554663Z [2022-08-22 10:44:22 +0000] [12] [INFO] Worker exiting (pid: 12)
2022-08-22T10:44:22.958472859Z [2022-08-22 10:44:22 +0000] [10] [ERROR] Exception in worker process
2022-08-22T10:44:22.958679109Z Traceback (most recent call last):
2022-08-22T10:44:22.958746296Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2022-08-22T10:44:22.958814890Z     worker.init_process()
2022-08-22T10:44:22.958881348Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process
2022-08-22T10:44:22.958946088Z     self.load_wsgi()
2022-08-22T10:44:22.959009525Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2022-08-22T10:44:22.959073015Z     self.wsgi = self.app.wsgi()
2022-08-22T10:44:22.959135306Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-08-22T10:44:22.959198379Z     self.callable = self.load()
2022-08-22T10:44:22.959260619Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2022-08-22T10:44:22.959323900Z     return self.load_wsgiapp()
2022-08-22T10:44:22.959389317Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2022-08-22T10:44:22.959452754Z     return util.import_app(self.app_uri)
2022-08-22T10:44:22.959515671Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/util.py", line 359, in import_app
2022-08-22T10:44:22.959578171Z     mod = importlib.import_module(module)
2022-08-22T10:44:22.959640775Z   File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
2022-08-22T10:44:22.959703795Z     return _bootstrap._gcd_import(name[level:], package, level)
2022-08-22T10:44:22.959768379Z   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2022-08-22T10:44:22.959833222Z   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2022-08-22T10:44:22.959900514Z   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
2022-08-22T10:44:22.959964941Z   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
2022-08-22T10:44:22.960033431Z   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
2022-08-22T10:44:22.960320826Z   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2022-08-22T10:44:22.960419159Z   File "/app/GivTCP/REST.py", line 5, in <module>
2022-08-22T10:44:22.960484524Z     import read as rd       #grab passthrough functions from main read file
2022-08-22T10:44:22.960548065Z ModuleNotFoundError: No module named 'read'
2022-08-22T10:44:22.961406606Z [2022-08-22 10:44:22 +0000] [10] [INFO] Worker exiting (pid: 10)
2022-08-22T10:44:22.980850651Z [2022-08-22 10:44:22 +0000] [11] [ERROR] Exception in worker process
2022-08-22T10:44:22.981059193Z Traceback (most recent call last):
2022-08-22T10:44:22.981126797Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2022-08-22T10:44:22.981194401Z     worker.init_process()
2022-08-22T10:44:22.981258203Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process
2022-08-22T10:44:22.981322265Z     self.load_wsgi()
2022-08-22T10:44:22.981401953Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2022-08-22T10:44:22.981465963Z     self.wsgi = self.app.wsgi()
2022-08-22T10:44:22.981528411Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-08-22T10:44:22.981591640Z     self.callable = self.load()
2022-08-22T10:44:22.981656484Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2022-08-22T10:44:22.981719869Z     return self.load_wsgiapp()
2022-08-22T10:44:22.981783984Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2022-08-22T10:44:22.981847525Z     return util.import_app(self.app_uri)
2022-08-22T10:44:22.981913410Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/util.py", line 359, in import_app
2022-08-22T10:44:22.981977473Z     mod = importlib.import_module(module)
2022-08-22T10:44:22.982041692Z   File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
2022-08-22T10:44:22.982105806Z     return _bootstrap._gcd_import(name[level:], package, level)
2022-08-22T10:44:22.982169973Z   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2022-08-22T10:44:22.982234712Z   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2022-08-22T10:44:22.982300754Z   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
2022-08-22T10:44:22.982364920Z   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
2022-08-22T10:44:22.982432681Z   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
2022-08-22T10:44:22.982497056Z   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2022-08-22T10:44:22.982637941Z   File "/app/GivTCP/REST.py", line 5, in <module>
2022-08-22T10:44:22.982711431Z     import read as rd       #grab passthrough functions from main read file
2022-08-22T10:44:22.982777941Z ModuleNotFoundError: No module named 'read'
2022-08-22T10:44:22.982970493Z [2022-08-22 10:44:22 +0000] [11] [INFO] Worker exiting (pid: 11)
2022-08-22T10:44:23.506458867Z [2022-08-22 10:44:23 +0000] [9] [WARNING] Worker with pid 11 was terminated due to signal 15
2022-08-22T10:44:23.507541262Z [2022-08-22 10:44:23 +0000] [9] [WARNING] Worker with pid 10 was terminated due to signal 15
2022-08-22T10:44:23.594728578Z [2022-08-22 10:44:23 +0000] [9] [INFO] Shutting down: Master
2022-08-22T10:44:23.595280348Z [2022-08-22 10:44:23 +0000] [9] [INFO] Reason: Worker failed to boot.

@Britkat I don't want to distract you from your development work but if there's anything you or anyone else can see that's wrong, I'd appreciate a pointer.

T
#95 Tim

@sparky77 Thanks for using the three backticks code to create a code window. I've seen it on other forums but didn't know it would work here as it's not in the Post Reply pick list 😁

L
#96 lxalln

@Britkat I've updated to 1.1.5 (although this issue was still present in 1.1.4), I'm seemingly having a problem with the battery level:

INFO:GivTCP_1:Building battery output:
INFO:GivTCP_1:Building battery output:
ERROR:GivTCP_1:Error processing registers: (<class 'KeyError'>, KeyError('Battery_SOC'), <traceback object at 0x7feb1c925bc0>)

L
#97 lxalln

lxalln Okay, looks like I managed to resolve that issue by changing NUMBATTERIES_1 from 2, to 1. Even though I have 2 batteries.

S
#98 SB900

Struggling...everything was fine up until yesterday...using the Docker Britkat supplied sometime ago (docker-compose.yml).
Not sure whether it was a Windows update that stuffed Docker - it wouldn't start - so I had to re-install it.
Set everything up as before but now just get a load of error messages.

Help!

Can't I just use the previous version of GivTCP - it worked!

T
#99 Tim

SB900 I'm in the same boat. See posts above. You can go back to an older version of the image but it's still not working for me.

T
#100 Tim

SB900 @Britkat @anglefire @TheDragon (GivEnergy)

Don't know what I did but when I was looking at MQTT Explorer, I found that giv_tcp had been working for a short time this morning! I went back to the July-based images that had been showing errors, restarted them, and they're working OK now. I remember I did reboot the Docker Pi. Maybe it sprang into life after doing that. Really frustrating that something stopped working, then started working but I can't find out why it stopped in the first place! Aaargh! Never mind. Chill. All good now. And I've learnt my lesson. I'm going to backup the containers so if I'm in this situation again, I can go back to a container that had been working!

A
#101 anglefire

I use proxmox so can backup the vm. Restore it if necessary🙂

B
#102 Britkat

Hi all,
Apologies if there's been some hit and miss on recent docker containers. I've just released 1.1.6 after finding bugs in 1.1.4 and 1.1.5.
It has been reported to work with multiple invertors, but limited testing.

Please do try this and hopefully it will work for the majority.
Its a new start-up process and a couple of new ENVs so I recommend creating a new container, rather than just pulling down the latest image. (applies to the HA addon too)

B
#103 Britkat

Some errors are probably a result of docker-compose files using the latet tag, new releases are drastically different from the old ones, so I suggest not referencing "latest" tag, but rather 1.1.6 etc... that way if it gets recreated you know its pulling a compatible image for your compose file

T
#104 Tim

Britkat I'll give it a try tomorrow if the multiple inverter functionality is available. Thank you for developing this and sharing it. For those of us who want local control or more granular/timely data this is a real benefit. If Givenergy wanted to offer this as an "added value" sideline, it'd cost them dearly to support and certainly (IMO) the pace of change wouldn't be able to pass through all the QA as fast as your "just get it done" approach (I'm not suggesting you don't take care with version control and testing etc, just that sometimes a free-spirit achieves more quicker).

I just hope they're providing you with an inside track for queries and support. Well done Mark!

B
#105 Britkat

Tim, you’re spot on, my QA is definitely not up to scratch, but I try to make up for it with moving quickly to fix things!
Lots of help from GE in the early days, but they are pretty quiet these days!!

A
#106 anglefire

I shall wait till I’m back home - I can vpn into my home network and update it in theory. But whilst I like living on the edge - that’s a bit too far over it! 🤣

K
#107 Kryten

Desperately awaiting my install, but in the meantime a quick question regarding support for multiple inverters. Does this require multiple dockers or is the NUMINVERTORS and INVERTOR_IP_x environment variables working? so in theory could set NUMINVERTORS 3 and INVERTOR_IP_1 x.x.x.x and INVERTOR_IP_2 x.x.x.x and INVERTOR_IP_3 x.x.x.x for example?

Thanks!

#108 TheDragon (GivEnergy)

Kryten

Thats the plan yes

T
#109 Tim

Kryten In release 1.1.6, you can set NUMINVERTORS to 2 but the ENV still only enables INVERTOR_IP_1 currently. It does say that it will auto-discover inverters anyway. ATM It's not working for me and I've posted an error log to the 1.1.6 thread.

B
#110 Britkat

Thats a good point Tim... the addon doesn't allow you to have multiple invertor ip input. You can do it via docker, by adding your own ENVs as above. I can add in the config to allow up to three invertors by default.

Will that help people?

B
#111 Britkat

Britkat I've just done it for 1.1.7, so thta should help those using the addon to have multiple invertors (they are down the bottom of the list)

#112 TheDragon (GivEnergy)

Britkat Still stable. Updating regularly too.

Once you officially announce 1.1.7 I'll report tomorrow on it

L
#113 lxalln

I'm now on 1.1.7, and everything seems to be solid. No dips. No errors. 🤞it's all looking good!

#114 hoggy

@Britkat can you do BMS firmware next it'll probably be faster!

T
#115 Tim

Britkat Not using HA or web thingy but 1.1.7 is working, triggered by Node-RED as and when I want to pull data. I manually added the INVERTOR_IP_2=hostname and NUMBATTERIES_2=1 ENV variables. 😀

B
#116 Britkat

I said I would allow the dust to settle for a while to give some stability, but couldn't stop myself tinkering in the background...

Things I'm working on:

  • Incorporating Stephen Lewis's PALM capability (Auto set Target SOC based on Solcast forecast)
  • Tracking day/night/total costs based on Dual Tarrif details
  • Tracking the current pence per kwh of Energy stored in the Battery
  • Immediate Charge, Discharge and Export "Boost" control (with restore function)

I'm thinking of getting a few keen (foolhardy...) people who want to test emerging features who can help test updates on different Plant/scenarios before I release to the wild, any volunteers?

A
#117 anglefire

Britkat I’ll always volunteer!

My system is fairly simple though. Single tariff- single inverter ( hybrid 3.6) and battery ( 8.2kWh 100%dod)

I am hoping to switch to agile export - currently on fixed - but not heard back yet from octopus as I want to keep the fixed import tariff.

#118 TheDragon (GivEnergy)

anglefire you know me BK.
Always willing to be a pig of Guinea.
Single AC3 muti battery and can’t sleep

A
#119 anglefire

Really odd this morning. The soc and pv daily total has frozen this morning at yesterdays peak. But the current load is still reading.
Rebooted HA but is still the same. Updated nodered but is still the same

Looks like the givtcp has done a wobbly but I don’t have the password with me for portainer to log into that 🤷‍♂️

Oh well it will wait until later.
(The givenergy app is working so I know the system is ok!)

A
#120 anglefire

Oh and if I subscribe to the mqtt output then it’s reading what I’m seeing on nodered. Odd

I
#121 ispookie666

Really enjoying the GivTCP.
I'm fairly new to Home Assistant. Somehow managed to get this running on a home server and a lot of faffing. I seem to loose the information flow from the inverter/battery.
Following the recent update to 1.1.7, I can only have access to one battery.
Setup - AC coupled 3 and 2*8.2 battery

A
#122 anglefire

ispookie666 probably need to add some env to get the other battery to work. Tim may be able to help?

I
#123 ispookie666

anglefire my skills are limited in this area 😅

#124 TheDragon (GivEnergy)

ispookie666

Best to Uninstal Giv 1.1.7.
ReInstall and make sure you set the No of Inverters to 1. Number of batteries to 2

Also the entity names have changes for multi battery, they now contain the serial number

A
#125 anglefire

Rebooted givtcp and mine is working again. And updated to 1.1.7 and that worked too.

I
#126 ispookie666

Tried unistalling 1.1.7, restarted HA, reinstalled 1.1.7
Inverter set as 1
Battery set as 2

The sequence of errors
GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BGXXXXXXX'), <traceback object at 0x7f6000b67880>)

B
#127 Britkat

Can you post the full config page? And the logs from the very start, where it’s setting everything up?

I
#128 ispookie666

Britkat Sorry a bit new to all this. How do I do that? 😅

S
#129 SpeakToTheGeek

Britkat Just give me a shout when you have something you'd like testing. The Solcast forecast feature is of most interest to me out of that list. For tracking costs I just let Home Assistant take care of that natively.

L
#130 lxalln

Britkat Immediate charge/discharge would be amazing! Please. I'll test 🙂

L
#131 lxalln

ispookie666 Try setting your batteries to 1.

I have 2 batteries, but GivEnergy for some reason only see it as 1 big battery. Setting to 1, fixed that same issue for me.

T
#132 Tim

lxalln In setting NUMBATTERIES_1 = 1, do you still get cell details for each physical battery? If so, then the NUMBATTERIES parameter is not needed. If not, then @Britkat could do with the feedback so that he can make some changes.

T
#133 Tim

@Britkat I'm running Givtcp1.1.7 with two inverters OK. I set PRINT_RAW=False but I'm still getting raw data as well as the rest when using runAll. It's not a showstopper but again, it's either a parameter to remove, or fix. Ta.

L
#134 lxalln

Tim No, I don't think I can see info from the second physical battery. But this is likely due to GivEnergy being misconfigured somehow. My GivEnergy dashboard only lists 1 battery, so I'm not surprised to see only 1 battery working from GivTCP.

#135 TheDragon (GivEnergy)

lxalln Setting Calibration, The one thing we needed that Giv Took away

#136 TheDragon (GivEnergy)

lxalln

Try this
Stop the GivTCP Add-On
With File Editor Addon, go to /config/GivTCP/ and delete the 3 pkl files.
Go back to the GivTCP Addon, check the config page is correct, Inverter IP, batter count etcetc.
Start GivTCP

Should be good

#138 TheDragon (GivEnergy)

@Britkat Another victim of the cache files

L
#139 lxalln

TheDragon (GivEnergy) Unfortunately, that's not my problem.
I'm using docker, and have recently mounted the config directory so I can see it and I cleared the files out.
I think mine is related to GivEnergy only thinking there is 1 battery. I don't mind, everything is working smoothly at the moment.

B
#142 Britkat

It sounds like the invertor has been commissioned to see both batteries as a single one so there is no ability to separate them. It does beg the question as to what values are being reported in the Battery Details section of GivTCP? Cell voltages from just one?? Etc…

L
#143 lxalln

Britkat That wouldn't surprise me. The guy who commissioned the system said he'd never done a 2 battery system before and that he was 'winging' it.

Perhaps I'll get in touch with GivEnergy and see what they suggest.

#144 TheDragon (GivEnergy)

lxalln it's easy to do.
Number of packs 1.
Ah capacity the addition of 2
There seems to check on commissioning of 1 battery with 16.4kwh as Ah cant be true.
And ask it be checked. Are you sure there isnt 2 packs? Etc.
Easy enough to do. As each pack has a unique Ah capacity so adding them wouldnt be too hard to establish there was actually 2 packs of 8.2 not 1 of 16.4

T
#145 Tim

Britkat commissioned to see both batteries as a single one

@lxalln I can understand that it makes for easier programming if the two batteries are seen as a single entity, but I'd be surprised if the individual battery cell voltages weren't. Come to think of it, the Battery_Serial_Number would also be needed.

The values from each battery must be being sent via Modbus to the inverter (Battery Capacity ... 2 Packs?), so which registers would these data be held in? Maybe that's the issue? The relevant registers aren't being pulled back by Givtcp?

#146 TheDragon (GivEnergy)

Tim

The serial number of the battery is in the output of the JSON. I rekon it will be just reporting the 1st serial number, but the capacity of both. But the cell info of only the 1st, as was the case in the 1st engineer App

L
#147 lxalln

TheDragon (GivEnergy)

This is the battery output from the runAll command.

{
  "Battery_Capacity": 182.02,
  "Battery_Cell_10_Voltage": 3.351,
  "Battery_Cell_11_Voltage": 3.351,
  "Battery_Cell_12_Voltage": 3.351,
  "Battery_Cell_13_Voltage": 3.351,
  "Battery_Cell_14_Voltage": 3.353,
  "Battery_Cell_15_Voltage": 3.351,
  "Battery_Cell_16_Voltage": 3.353,
  "Battery_Cell_1_Temperature": 31.3,
  "Battery_Cell_1_Voltage": 3.351,
  "Battery_Cell_2_Temperature": 30.8,
  "Battery_Cell_2_Voltage": 3.346,
  "Battery_Cell_3_Temperature": 30.6,
  "Battery_Cell_3_Voltage": 3.348,
  "Battery_Cell_4_Temperature": 31.3,
  "Battery_Cell_4_Voltage": 3.349,
  "Battery_Cell_5_Voltage": 3.348,
  "Battery_Cell_6_Voltage": 3.349,
  "Battery_Cell_7_Voltage": 3.349,
  "Battery_Cell_8_Voltage": 3.358,
  "Battery_Cell_9_Voltage": 3.351,
  "Battery_Cells": 16,
  "Battery_Cycles": 44,
  "Battery_Design_Capacity": 0.0,
  "Battery_Firmware_Version": 3007,
  "Battery_Remaining_Capcity": 0.0,
  "Battery_SOC": 72,
  "Battery_Serial_Number": "DY...11",
  "Battery_Temperature": 35.4,
  "Battery_USB_present": true,
  "Battery_Voltage": 53.601,
  "Invertor_Serial_Number": "SD...53"
}
#148 TheDragon (GivEnergy)

lxalln
OOh loads missing from that, like all the other registers

Here is mine
Not bothered serial numbers are included, useless to anyone else
{ "Battery_Details": { "BE2138G124": { "Battery_Capacity": 104.73, "Battery_Cell_10_Voltage": 3.308, "Battery_Cell_11_Voltage": 3.309, "Battery_Cell_12_Voltage": 3.309, "Battery_Cell_13_Voltage": 3.311, "Battery_Cell_14_Voltage": 3.312, "Battery_Cell_15_Voltage": 3.308, "Battery_Cell_16_Voltage": 3.311, "Battery_Cell_1_Temperature": 21.8, "Battery_Cell_1_Voltage": 3.308, "Battery_Cell_2_Temperature": 21.3, "Battery_Cell_2_Voltage": 3.304, "Battery_Cell_3_Temperature": 21.4, "Battery_Cell_3_Voltage": 3.304, "Battery_Cell_4_Temperature": 21.8, "Battery_Cell_4_Voltage": 3.308, "Battery_Cell_5_Voltage": 3.308, "Battery_Cell_6_Voltage": 3.309, "Battery_Cell_7_Voltage": 3.309, "Battery_Cell_8_Voltage": 3.312, "Battery_Cell_9_Voltage": 3.309, "Battery_Cells": 16, "Battery_Cycles": 145, "Battery_Design_Capacity": 102.0, "Battery_Firmware_Version": 3007, "Battery_Remaining_Capcity": 40.6, "Battery_SOC": 39, "Battery_Serial_Number": "BE2138G124", "Battery_Temperature": 24.5, "Battery_USB_present": true, "Battery_Voltage": 52.912, "Invertor_Serial_Number": "CE2146G163" }, "BE2138G161": { "Battery_Capacity": 103.3, "Battery_Cell_10_Voltage": 3.314, "Battery_Cell_11_Voltage": 3.314, "Battery_Cell_12_Voltage": 3.316, "Battery_Cell_13_Voltage": 3.314, "Battery_Cell_14_Voltage": 3.316, "Battery_Cell_15_Voltage": 3.316, "Battery_Cell_16_Voltage": 3.316, "Battery_Cell_1_Temperature": 22.0, "Battery_Cell_1_Voltage": 3.309, "Battery_Cell_2_Temperature": 21.4, "Battery_Cell_2_Voltage": 3.308, "Battery_Cell_3_Temperature": 21.7, "Battery_Cell_3_Voltage": 3.309, "Battery_Cell_4_Temperature": 21.7, "Battery_Cell_4_Voltage": 3.309, "Battery_Cell_5_Voltage": 3.311, "Battery_Cell_6_Voltage": 3.311, "Battery_Cell_7_Voltage": 3.312, "Battery_Cell_8_Voltage": 3.316, "Battery_Cell_9_Voltage": 3.314, "Battery_Cells": 16, "Battery_Cycles": 135, "Battery_Design_Capacity": 102.0, "Battery_Firmware_Version": 3007, "Battery_Remaining_Capcity": 66.71, "Battery_SOC": 65, "Battery_Serial_Number": "BE2138G161", "Battery_Temperature": 24.3, "Battery_USB_present": true, "Battery_Voltage": 53.005, "Invertor_Serial_Number": "CE2146G163" }, "BE2138G184": { "Battery_Capacity": 108.21, "Battery_Cell_10_Voltage": 3.309, "Battery_Cell_11_Voltage": 3.308, "Battery_Cell_12_Voltage": 3.312, "Battery_Cell_13_Voltage": 3.309, "Battery_Cell_14_Voltage": 3.309, "Battery_Cell_15_Voltage": 3.311, "Battery_Cell_16_Voltage": 3.309, "Battery_Cell_1_Temperature": 24.6, "Battery_Cell_1_Voltage": 3.309, "Battery_Cell_2_Temperature": 24.1, "Battery_Cell_2_Voltage": 3.309, "Battery_Cell_3_Temperature": 23.9, "Battery_Cell_3_Voltage": 3.309, "Battery_Cell_4_Temperature": 24.8, "Battery_Cell_4_Voltage": 3.308, "Battery_Cell_5_Voltage": 3.308, "Battery_Cell_6_Voltage": 3.309, "Battery_Cell_7_Voltage": 3.311, "Battery_Cell_8_Voltage": 3.312, "Battery_Cell_9_Voltage": 3.314, "Battery_Cells": 16, "Battery_Cycles": 163, "Battery_Design_Capacity": 102.0, "Battery_Firmware_Version": 3007, "Battery_Remaining_Capcity": 77.33, "Battery_SOC": 71, "Battery_Serial_Number": "BE2138G184", "Battery_Temperature": 28.1, "Battery_USB_present": true, "Battery_Voltage": 52.955, "Invertor_Serial_Number": "CE2146G163" } }, "Control": { "Battery_Charge_Rate": 100, "Battery_Discharge_Rate": 100, "Battery_Power_Reserve": 4, "Enable_Charge_Schedule": "disable", "Enable_Discharge": "enable", "Enable_Discharge_Schedule": "disable", "Mode": "Eco", "Target_SOC": 100 }, "Energy": { "Rates": { "Average_ppkwh_today": 0.04166666666666349, "current_rate": "0.155", "day_cost": 0.5114999999999577, "day_energy": 3.299999999999727, "day_rate": "0.155", "day_start_energy": 3385.3, "export_rate": "0.04", "night_cost": 0.17599999999999, "night_energy": 3.199999999999818, "night_rate": "0.055", "night_start_energy": 3382.0 }, "Today": { "AC_Charge_Energy_Today_kWh": 8.1, "Battery_Charge_Energy_Today_kWh": 7.7, "Battery_Discharge_Energy_Today_kWh": 0.9, "Battery_Throughput_Today_kWh": 8.6, "Export_Energy_Today_kWh": 3.2, "Import_Energy_Today_kWh": 7.0, "Invertor_Energy_Today_kWh": 0.8, "Load_Energy_Today_kWh": 16.5, "PV_Energy_Today_kWh": 20.0, "Self_Consumption_Energy_Today_kWh": 16.8 }, "Total": { "AC_Charge_Energy_Total_kWh": 2031.1, "Battery_Charge_Energy_Total_kWh": 1951.8, "Battery_Discharge_Energy_Total_kWh": 1901.2, "Battery_Throughput_Total_kWh": 3853.0, "Export_Energy_Total_kWh": 559.8, "Import_Energy_Total_kWh": 3388.6, "Invertor_Energy_Total_kWh": 1633.5, "Load_Energy_Total_kWh": 7650.6, "PV_Energy_Total_kWh": 5219.4, "Self_Consumption_Energy_Total_kWh": 4659.599999999999 } }, "Invertor_Details": { "Battery_Capacity_kWh": 15.667200000000001, "Battery_Type": "Lithium", "Invertor_Serial_Number": "CE2146G163", "Invertor_Temperature": 36.4, "Invertor_Type": "AC", "Meter_Type": "EM115", "Modbus_Version": 1.4 }, "Last_Updated_Time": "2022-09-01T14:27:52.286470+00:00", "Power": { "Flows": { "Battery_to_Grid": 0, "Battery_to_House": 0, "Grid_to_Battery": 0, "Grid_to_House": 0, "Solar_to_Battery": 745, "Solar_to_Grid": 27, "Solar_to_House": 3997 }, "Power": { "AC_Charge_Power": 744, "Battery_Power": -726, "Charge_Power": 726, "Discharge_Power": 0, "EPS_Power": 0, "Export_Power": 27, "Grid_Power": 27, "Import_Power": 0, "Invertor_Power": -744, "Load_Power": 3997, "PV_Current_String_1": 19.8, "PV_Current_String_2": 0.0, "PV_Power": 4769, "PV_Power_String_1": 4769, "PV_Power_String_2": 0, "PV_Voltage_String_1": 240.6, "PV_Voltage_String_2": 0.0, "SOC": 55, "Self_Consumption_Power": 3997 } }, "Time_Since_Last_Update": 34.489881, "Timeslots": { "Charge_end_time_slot_1": "00:00:00", "Charge_end_time_slot_2": "00:04:00", "Charge_start_time_slot_1": "00:00:00", "Charge_start_time_slot_2": "00:01:00", "Discharge_end_time_slot_1": "00:00:00", "Discharge_end_time_slot_2": "00:00:00", "Discharge_start_time_slot_1": "00:00:00", "Discharge_start_time_slot_2": "00:00:00" }, "raw": { "batteries": {}, "invertor": { "active_power_rate": 100, "arm_firmware_version": 535, "battery_charge_limit": 50, "battery_discharge_limit": 50, "battery_discharge_min_power_reserve": 4, "battery_low_force_charge_time": 6, "battery_nominal_capacity": 306.0, "battery_percent": 55, "battery_power_mode": 1, "battery_soc_reserve": 4, "battery_type": 1, "battery_voltage_adjust": 0, "charge_and_discharge_soc": [ 0, 0 ], "charge_slot_1": [ "00:00:00", "00:00:00" ], "charge_slot_2": [ "00:01:00", "00:04:00" ], "charge_soc_stop_1": 0, "charge_soc_stop_2": 0, "charge_status": 2, "charge_target_soc": 100, "charger_warning_code": 0, "ct_adjust": 0, "dci_1_i": 0.0, "dci_1_time": 0, "dci_2_i": 0.0, "dci_2_time": 0, "device_type_code": "3001", "discharge_slot_1": [ "00:00:00", "00:00:00" ], "discharge_slot_2": [ "00:00:00", "00:00:00" ], "discharge_soc_stop_1": 0, "discharge_soc_stop_2": 0, "dsp_firmware_version": 535, "e_battery_charge_day": 7.7, "e_battery_charge_day_2": 0.0, "e_battery_charge_total": 0.0, "e_battery_discharge_day": 0.9, "e_battery_discharge_day_2": 0.0, "e_battery_discharge_total": 0.0, "e_battery_throughput_total": 3853.0, "e_discharge_year": 0.0, "e_grid_in_day": 7.0, "e_grid_in_total": 3388.6, "e_grid_out_day": 3.2, "e_grid_out_total": 559.8, "e_inverter_in_day": 8.1, "e_inverter_in_total": 2031.1, "e_inverter_out_day": 0.8, "e_inverter_out_total": 1633.5, "e_pv1_day": 20.0, "e_pv2_day": 0.0, "e_pv_total": 5219.4, "e_solar_diverter": 0.0, "enable_60hz_freq_mode": false, "enable_ammeter": true, "enable_auto_judge_battery_type": true, "enable_bms_read": true, "enable_buzzer": false, "enable_charge": false, "enable_charge_target": false, "enable_discharge": false, "enable_drm_rj45_port": false, "f_ac1": 49.92, "f_ac_high_c": 51.48, "f_ac_high_in": 51.48, "f_ac_high_in_time": 4670, "f_ac_high_out": 51.98, "f_ac_high_out_time": 25, "f_ac_low_c": 47.5, "f_ac_low_in": 47.5, "f_ac_low_in_time": 957, "f_ac_low_out": 47.0, "f_ac_low_out_time": 25, "f_eps_backup": 49.91, "fault_code": 0, "firmware_version": "D0.535-A0.535", "first_battery_bms_firmware_version": 3007, "first_battery_serial_number": "BE2138G184", "gfci_1_i": 0.0, "gfci_1_time": 0, "gfci_2_i": 0.0, "gfci_2_time": 0, "grid_power_adjust": 0, "grid_r_voltage_adjust": 0, "grid_s_voltage_adjust": 0, "grid_t_voltage_adjust": 0, "i_ac1": 0.39, "i_battery": -17.53, "i_grid_port": 2.05, "i_pv1": 1.98, "i_pv2": 0.0, "inverter_countdown": 0, "inverter_modbus_address": 17, "inverter_model": "AC", "inverter_module": 198686, "inverter_restart_delay_time": 30, "inverter_serial_number": "CE2146G163", "inverter_start_time": 30, "inverter_state": [ 0, 1 ], "inverter_status": 1, "island_check_continue": 0, "meter_type": 1, "modbus_version": 1.4, "num_mppt": 2, "num_phases": 1, "p_battery": -726, "p_eps_backup": 0, "p_grid_apparent": 496, "p_grid_out": 27, "p_grid_port_max_output": 5000, "p_inverter_out": -744, "p_load_demand": 3997, "p_pv1": 4769, "p_pv2": 0, "pf_inverter_out": 0.0719, "power_factor": -1, "pv1_power_adjust": 0, "pv1_voltage_adjust": 0, "pv2_power_adjust": 0, "pv2_voltage_adjust": 0, "reactive_power_rate": 0, "reverse_115_meter_direct": false, "reverse_418_meter_direct": false, "select_arm_chip": false, "soc_force_adjust": 0, "system_mode": 1, "system_time": "2022-09-01 15:27:47", "temp_battery": 24.0, "temp_charger": 35.2, "temp_inverter_heatsink": 36.4, "usb_device_inserted": 2, "v_ac1": 240.9, "v_ac_high_c": 259.0, "v_ac_high_in": 259.0, "v_ac_high_in_time": 55, "v_ac_high_out": 269.5, "v_ac_high_out_time": 35, "v_ac_low_c": 199.1, "v_ac_low_in": 199.1, "v_ac_low_in_time": 130, "v_ac_low_out": 182.5, "v_ac_low_out_time": 25, "v_battery": 53.13, "v_battery_over_protection_limit": 58.5, "v_battery_under_protection_limit": 43.2, "v_eps_backup": 239.9, "v_highbrigh_bus": 3068, "v_n_bus": 0.0, "v_p_bus": 370.2, "v_pv1": 240.6, "v_pv2": 0.0, "v_pv_input_start": 150.0, "work_time_total": 2946 } }, "status": "online" }

L
#149 lxalln

TheDragon (GivEnergy) Not quite that bad, I only select from inside the Battery Details part. The other registers are there.

Full data here:

{
    "Battery_Details": {
        "DY2217G411": {
            "Battery_Capacity": 182.02,
            "Battery_Cell_10_Voltage": 3.351,
            "Battery_Cell_11_Voltage": 3.351,
            "Battery_Cell_12_Voltage": 3.351,
            "Battery_Cell_13_Voltage": 3.351,
            "Battery_Cell_14_Voltage": 3.353,
            "Battery_Cell_15_Voltage": 3.351,
            "Battery_Cell_16_Voltage": 3.353,
            "Battery_Cell_1_Temperature": 31.3,
            "Battery_Cell_1_Voltage": 3.351,
            "Battery_Cell_2_Temperature": 30.8,
            "Battery_Cell_2_Voltage": 3.346,
            "Battery_Cell_3_Temperature": 30.6,
            "Battery_Cell_3_Voltage": 3.348,
            "Battery_Cell_4_Temperature": 31.3,
            "Battery_Cell_4_Voltage": 3.349,
            "Battery_Cell_5_Voltage": 3.348,
            "Battery_Cell_6_Voltage": 3.349,
            "Battery_Cell_7_Voltage": 3.349,
            "Battery_Cell_8_Voltage": 3.358,
            "Battery_Cell_9_Voltage": 3.351,
            "Battery_Cells": 16,
            "Battery_Cycles": 44,
            "Battery_Design_Capacity": 0.0,
            "Battery_Firmware_Version": 3007,
            "Battery_Remaining_Capcity": 0.0,
            "Battery_SOC": 72,
            "Battery_Serial_Number": "DY2217G411",
            "Battery_Temperature": 35.4,
            "Battery_USB_present": true,
            "Battery_Voltage": 53.601,
            "Invertor_Serial_Number": "SD2204G153"
        }
    },
    "Control": {
        "Battery_Charge_Rate": 100,
        "Battery_Discharge_Rate": 100,
        "Battery_Power_Reserve": 4,
        "Enable_Charge_Schedule": "enable",
        "Enable_Discharge": "disable",
        "Enable_Discharge_Schedule": "enable",
        "Mode": "Timed Export",
        "Target_SOC": 100
    },
    "Energy": {
        "Rates": {
            "Average_ppkwh_today": 0.3020666666666668,
            "current_rate": "0.155",
            "day_cost": 1.6275,
            "day_energy": 10.5,
            "day_rate": "0.155",
            "day_start_energy": 208.3,
            "export_rate": "0.04",
            "night_cost": 0.6380000000000012,
            "night_energy": 11.600000000000023,
            "night_rate": "0.055",
            "night_start_energy": 196.7
        },
        "Today": {
            "AC_Charge_Energy_Today_kWh": 20.0,
            "Battery_Charge_Energy_Today_kWh": 22.1,
            "Battery_Discharge_Energy_Today_kWh": 14.0,
            "Battery_Throughput_Today_kWh": 36.1,
            "Export_Energy_Today_kWh": 10.2,
            "Import_Energy_Today_kWh": 23.6,
            "Invertor_Energy_Today_kWh": 14.1,
            "Load_Energy_Today_kWh": 7.5,
            "PV_Energy_Today_kWh": 5.2,
            "Self_Consumption_Energy_Today_kWh": 0.0
        },
        "Total": {
            "AC_Charge_Energy_Total_kWh": 131.7,
            "Battery_Charge_Energy_Total_kWh": 621.3,
            "Battery_Discharge_Energy_Total_kWh": 602.7,
            "Battery_Throughput_Total_kWh": 1224.0,
            "Export_Energy_Total_kWh": 162.0,
            "Import_Energy_Total_kWh": 218.8,
            "Invertor_Energy_Total_kWh": 978.9,
            "Load_Energy_Total_kWh": 904.0,
            "PV_Energy_Total_kWh": 992.0,
            "Self_Consumption_Energy_Total_kWh": 835.0
        }
    },
    "Invertor_Details": {
        "Battery_Capacity_kWh": 8.192,
        "Battery_Type": "Lithium",
        "Invertor_Serial_Number": "SD2204G153",
        "Invertor_Temperature": 56.4,
        "Invertor_Type": "Hybrid",
        "Meter_Type": "EM115",
        "Modbus_Version": 1.4
    },
    "Last_Updated_Time": "2022-09-01T14:06:25.710727+00:00",
    "Power": {
        "Flows": {
            "Battery_to_Grid": 0,
            "Battery_to_House": 0,
            "Grid_to_Battery": 2422,
            "Grid_to_House": 192,
            "Solar_to_Battery": 0,
            "Solar_to_Grid": 0,
            "Solar_to_House": 339
        },
        "Power": {
            "AC_Charge_Power": 2215,
            "Battery_Power": -2422,
            "Charge_Power": 2422,
            "Discharge_Power": 0,
            "EPS_Power": 0,
            "Export_Power": 0,
            "Grid_Power": -2614,
            "Import_Power": 2614,
            "Invertor_Power": -2215,
            "Load_Power": 399,
            "PV_Current_String_1": 0.7000000000000001,
            "PV_Current_String_2": 0.0,
            "PV_Power": 339,
            "PV_Power_String_1": 339,
            "PV_Power_String_2": 0,
            "PV_Voltage_String_1": 443.6,
            "PV_Voltage_String_2": 45.1,
            "SOC": 74,
            "Self_Consumption_Power": 0
        }
    },
    "Time_Since_Last_Update": 10.74073,
    "Timeslots": {
        "Charge_end_time_slot_1": "16:00:00",
        "Charge_end_time_slot_2": "00:04:00",
        "Charge_start_time_slot_1": "10:30:00",
        "Charge_start_time_slot_2": "00:01:00",
        "Discharge_end_time_slot_1": "22:30:00",
        "Discharge_end_time_slot_2": "00:00:00",
        "Discharge_start_time_slot_1": "16:00:00",
        "Discharge_start_time_slot_2": "00:00:00"
    },
    "raw": {
        "batteries": {},
        "invertor": {
            "active_power_rate": 100,
            "arm_firmware_version": 451,
            "battery_charge_limit": 50,
            "battery_discharge_limit": 50,
            "battery_discharge_min_power_reserve": 4,
            "battery_low_force_charge_time": 6,
            "battery_nominal_capacity": 160.0,
            "battery_percent": 74,
            "battery_power_mode": 0,
            "battery_soc_reserve": 100,
            "battery_type": 1,
            "battery_voltage_adjust": 0,
            "charge_and_discharge_soc": [
                0,
                0
            ],
            "charge_slot_1": [
                "10:30:00",
                "16:00:00"
            ],
            "charge_slot_2": [
                "00:01:00",
                "00:04:00"
            ],
            "charge_soc_stop_1": 0,
            "charge_soc_stop_2": 0,
            "charge_status": 2,
            "charge_target_soc": 100,
            "charger_warning_code": 0,
            "ct_adjust": 3,
            "dci_1_i": 0.0,
            "dci_1_time": 0,
            "dci_2_i": 0.0,
            "dci_2_time": 0,
            "device_type_code": "2001",
            "discharge_slot_1": [
                "16:00:00",
                "22:30:00"
            ],
            "discharge_slot_2": [
                "00:00:00",
                "00:00:00"
            ],
            "discharge_soc_stop_1": 0,
            "discharge_soc_stop_2": 0,
            "dsp_firmware_version": 450,
            "e_battery_charge_day": 22.1,
            "e_battery_charge_day_2": 0.0,
            "e_battery_charge_total": 0.0,
            "e_battery_discharge_day": 14.0,
            "e_battery_discharge_day_2": 0.0,
            "e_battery_discharge_total": 0.0,
            "e_battery_throughput_total": 1224.0,
            "e_discharge_year": 0.0,
            "e_grid_in_day": 23.6,
            "e_grid_in_total": 218.8,
            "e_grid_out_day": 10.2,
            "e_grid_out_total": 162.0,
            "e_inverter_in_day": 20.0,
            "e_inverter_in_total": 131.7,
            "e_inverter_out_day": 14.1,
            "e_inverter_out_total": 978.9,
            "e_pv1_day": 5.2,
            "e_pv2_day": 0.0,
            "e_pv_total": 992.0,
            "e_solar_diverter": 0.0,
            "enable_60hz_freq_mode": false,
            "enable_ammeter": true,
            "enable_auto_judge_battery_type": true,
            "enable_bms_read": true,
            "enable_buzzer": false,
            "enable_charge": true,
            "enable_charge_target": false,
            "enable_discharge": true,
            "enable_drm_rj45_port": true,
            "f_ac1": 49.85,
            "f_ac_high_c": 52.0,
            "f_ac_high_in": 52.0,
            "f_ac_high_in_time": 28,
            "f_ac_high_out": 51.98,
            "f_ac_high_out_time": 28,
            "f_ac_low_c": 47.0,
            "f_ac_low_in": 47.45,
            "f_ac_low_in_time": 948,
            "f_ac_low_out": 47.0,
            "f_ac_low_out_time": 24,
            "f_eps_backup": 49.84,
            "fault_code": 0,
            "firmware_version": "D0.450-A0.451",
            "first_battery_bms_firmware_version": 3007,
            "first_battery_serial_number": "DY2217G411",
            "gfci_1_i": 0.0,
            "gfci_1_time": 0,
            "gfci_2_i": 0.0,
            "gfci_2_time": 0,
            "grid_power_adjust": 0,
            "grid_r_voltage_adjust": 0,
            "grid_s_voltage_adjust": 0,
            "grid_t_voltage_adjust": 0,
            "i_ac1": 0.96,
            "i_battery": -44.76,
            "i_grid_port": 12.02,
            "i_pv1": 0.07,
            "i_pv2": 0.0,
            "inverter_countdown": 0,
            "inverter_modbus_address": 17,
            "inverter_model": "Hybrid",
            "inverter_module": 198706,
            "inverter_restart_delay_time": 30,
            "inverter_serial_number": "SD2204G153",
            "inverter_start_time": 30,
            "inverter_state": [
                0,
                1
            ],
            "inverter_status": 1,
            "island_check_continue": 0,
            "meter_type": 1,
            "modbus_version": 1.4,
            "num_mppt": 2,
            "num_phases": 1,
            "p_battery": -2422,
            "p_eps_backup": 0,
            "p_grid_apparent": 2815,
            "p_grid_out": -2614,
            "p_grid_port_max_output": 6000,
            "p_inverter_out": -2215,
            "p_load_demand": 399,
            "p_pv1": 339,
            "p_pv2": 0,
            "pf_inverter_out": -0.93,
            "power_factor": -1,
            "pv1_power_adjust": 0,
            "pv1_voltage_adjust": 0,
            "pv2_power_adjust": 0,
            "pv2_voltage_adjust": 0,
            "reactive_power_rate": 0,
            "reverse_115_meter_direct": false,
            "reverse_418_meter_direct": false,
            "select_arm_chip": false,
            "soc_force_adjust": 0,
            "system_mode": 1,
            "system_time": "2022-09-01 15:06:05",
            "temp_battery": 31.0,
            "temp_charger": 55.8,
            "temp_inverter_heatsink": 56.4,
            "usb_device_inserted": 2,
            "v_ac1": 233.3,
            "v_ac_high_c": 283.7,
            "v_ac_high_in": 262.0,
            "v_ac_high_in_time": 52,
            "v_ac_high_out": 274.0,
            "v_ac_high_out_time": 27,
            "v_ac_low_c": 175.5,
            "v_ac_low_in": 184.0,
            "v_ac_low_in_time": 126,
            "v_ac_low_out": 184.0,
            "v_ac_low_out_time": 126,
            "v_battery": 54.25,
            "v_battery_over_protection_limit": 58.5,
            "v_battery_under_protection_limit": 43.2,
            "v_eps_backup": 229.2,
            "v_highbrigh_bus": 3177,
            "v_n_bus": 0.0,
            "v_p_bus": 440.3,
            "v_pv1": 443.6,
            "v_pv2": 45.1,
            "v_pv_input_start": 150.0,
            "work_time_total": 1417
        }
    },
    "status": "online"
}
#151 TheDragon (GivEnergy)

lxalln

Something weird here.

I would have GivSupport look at your commission. If when commissioned the installer entered 1 battery, this is why its not showing the rest, even though they are there. If there not showing in the RunAll, the 2nd is either not there, or communicating, or configured wrong. or a mixture of all.
@Adam-Reynolds
May have to delete and re-commission properly

L
#152 lxalln

TheDragon (GivEnergy) I concur. However, the 2nd battery is definitely charging/discharging. It's capacity is available. 🤷

I have emailed support.

T
#153 Tim

TheDragon (GivEnergy) Something weird here.

@Britkat Should be able to tell us if he needs to change Givtcp to include additional registers for additional batteries. Looking at the BMS Input Register data, there are registers (110-114) for Slave Battery Serial Number, but no clue as to how to access the cell voltages of the slave, nor is there any hint of how to chase down data for a third battery, which some people have.

B
#154 Britkat

Tim givenergy-modbus is able pull back multiple batteries, from a single invertor without problems. This is what GivTCP uses. Lots of users have it working. I think it’s a GE problem… if not then I’m happy to investigate after

#156 TheDragon (GivEnergy)

Britkat

The smart plugs will also be stuffing stuff out via the inverter too into GivTCP.

Once they test it, Dan mentioned he'll be in touch to add the SmartPlug stuff to your project.

So we can see and control the GivPlug via HA too.

P
#157 PhilS

Any ideas?

I've tried everything I can to get this to work. Using Windows 10, Docker, latest GivTCP image. I have no experience with Docker but as I understand it, it's essentially a VM platform with which I have extensive experience. I've installed the Linux kernel stuff. I've confirmed I can ping the inverter and I've tried turning Windows Defender off.

I know my inverter IP. I'm certain about this as I accidentally hacked the thing during a network test and reported the security issues. I have tried with and without specifying "INVERTOR_IP". I assume from the below it's trying to connect to OSPF-lite on port 8899, which I've checked and this service is running on the IP address I've given it.

My programming experience ends at BASIC and I think I once printed a willy on the screen in Assembly when I was at school. To me, the below is saying it can't establish a connection. I've no way of checking any of the Python stuff.

Output from Docker below.

2022-09-02 19:30:28,832 GivTCP_STARTUP - No config directory exists, so creating it...
2022-09-02 19:30:28,832 GivTCP_STARTUP - Instance is inv: 1/1
2022-09-02 19:30:28,837 GivTCP_STARTUP - Recreating settings.py for invertor 1
2022-09-02 19:30:28,837 GivTCP_STARTUP - GivTCP Instance is 1
2022-09-02 19:30:28,837 GivTCP_STARTUP - Running Invertor read loop every 5
2022-09-02 19:30:28,838 GivTCP_STARTUP - Subscribing Mosquitto on port 1883
2022-09-02 19:30:28,838 GivTCP_STARTUP - Starting Gunicorn on port 6345
2022-09-02 19:30:28,838 GivTCP_STARTUP - Starting Mosquitto on port 1883
1662143428: mosquitto version 2.0.11 starting
1662143428: Config loaded from /app/GivTCP_1/mqtt.conf.
1662143428: Opening ipv4 listen socket on port 1883.
1662143428: mosquitto version 2.0.11 running
[2022-09-02 19:30:28 +0100] [9] [INFO] Starting gunicorn 20.1.0
[2022-09-02 19:30:28 +0100] [9] [INFO] Listening at: http://0.0.0.0:6345 (9)
[2022-09-02 19:30:28 +0100] [9] [INFO] Using worker: sync
[2022-09-02 19:30:28 +0100] [11] [INFO] Booting worker with pid: 11
[2022-09-02 19:30:28 +0100] [12] [INFO] Booting worker with pid: 12
[2022-09-02 19:30:28 +0100] [13] [INFO] Booting worker with pid: 13
2022-09-02 19:30:28,998 - pymodbus.client.sync [ERROR] Connection to (, 8899) failed: [Errno -2] Name does not resolve
2022-09-02 19:30:28,998 - givenergy_modbus [ERROR] Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py", line 50, in execute
    response = super().execute(request)
  File "/usr/local/lib/python3.10/site-packages/pymodbus/client/sync.py", line 108, in execute
    raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]
2022-09-02 19:30:28,999 - givenergy_modbus [ERROR] Did not receive expected response type: ReadInputRegistersResponse != NoneType
2022-09-02 19:30:29,499 - pymodbus.client.sync [ERROR] Connection to (, 8899) failed: [Errno -2] Name does not resolve
2022-09-02 19:30:29,499 - givenergy_modbus [ERROR] Modbus Error: [Connection] Failed to connect[ModbusTcpClient(:8899)]

L
#158 lxalln

PhilS try setting the INVERTER_IP_1 environment variable, instead of INVERTER_IP.

The variable changed recently.
Also, auto discovery has never worked for me, needs to be manually specified.

P
#159 PhilS

Cheers, I shall try this. Muchos appreciated.

P
#160 PhilS

lxalln It VERKS! Cheers.

#161 dbt85

anglefire

Can I just say thanks a whole lot for this post. I'd not been paying attention as other things were going on and I noticed over the last few days that my HA that i spent a week learning how to drive was just not doing anything with my Inverter!

This compose file pointed me in the right direction of getting it all up and running again.

Not tried this new version with all 3 inverters running yet so we'll see if it falls over. Though tuth be told its far too many devices and stuff for my current usage. Is node red the way to just poll for the data I want at the interval I want, rather than having everything polled all the time?

Also I'm seeing this in the logs which seems odd, it appears to be saying that the new values are invalid and so is ignoring them? But they look fine

`2022-09-08 19:20:42,223 - GivTCP_Read_1 [ERROR] Self_Consumption_Energy_Total_kWh reported as: 5844.5kWh so using previous value of: 5844.9

2022-09-08 19:20:42,223 - GivTCP_Read_1 [ERROR] Self_Consumption_Energy_Today_kWh reported as: 14.8kWh so using previous value of: 15.2

2022-09-08 19:20:42,224 - GivTCP_Read_1 [ERROR] Load_Energy_Today_kWh reported as: 19.9kWh so using previous value of: 20.0

2022-09-08 19:20:58,715 - GivTCP_Read_1 [ERROR] Load_Energy_Total_kWh reported as: 15172.5kWh so using previous value of: 15172.6

2022-09-08 19:20:58,716 - GivTCP_Read_1 [ERROR] Self_Consumption_Energy_Total_kWh reported as: 5844.5kWh so using previous value of: 5844.9

2022-09-08 19:20:58,717 - GivTCP_Read_1 [ERROR] Self_Consumption_Energy_Today_kWh reported as: 14.8kWh so using previous value of: 15.2

`

A
#162 anglefire

Node red polls all the time too - don’t worry about it frankly it’s not a lot of data.

The consumption has gone backwards in some cases so I guess it’s using the “later” more upto date value.

T
#163 Tim

dbt85 poll for the data I want at the interval I want, rather than having everything polled all the time?

You can set the poll time in Givtcp ENV and with Node-RED you can choose what to poll and when.

#164 dbt85

Ah ok. Only reason it even occurred to me was because of the issues I've had getting 3 inverters working in HA. 2 seemed ok before but adding a 3rd and it got janky, could have been issues with givtcp I guess

Now with the changes I guess it should be easier, but it seems that maybe I have to put all 3 inverters into the same compose file rather than their own ones, meaning the ability to set your own HADEVICEPREFIX is moot as they'd all have the same prefix.

A
#165 anglefire

Tim When but not what- it will always pull all the data when its polled, you can't just ask for one element.
But yes polling less often is certainly possible.

#166 dbt85

So last night I left it alone eventually with 2 of my 3 inverters collecting data each from their own container, with the 3rd disabled because it just didn't seem to work despite having the exact same config apart from the obviously changed details specific to that inverter.

At some point there was a power cut and once everything came back up that 3rd inverter container was also running but for reasons mosquitto decided to not run so naturally there was no data being collected.

However the only way I could get my 1st inverter container to work again was to recreate it, as it was spitting out this as an error message, even when the other 2 containers were disabled.

022-09-09 08:54:39,837 GivTCP_STARTUP - Config directory already exists
2022-09-09 08:54:39,838 GivTCP_STARTUP - Instance is inv: 1/1
2022-09-09 08:54:39,838 GivTCP_STARTUP - Recreating settings.py for invertor 1
2022-09-09 08:54:39,842 GivTCP_STARTUP - GivTCP Instance is 1
2022-09-09 08:54:39,842 GivTCP_STARTUP - Running Invertor read loop every 10
2022-09-09 08:54:39,843 GivTCP_STARTUP - Subscribing Mosquitto on port 1883
2022-09-09 08:54:39,844 GivTCP_STARTUP - Starting Gunicorn on port 6345
2022-09-09 08:54:39,846 GivTCP_STARTUP - Creating web dashbaord config
2022-09-09 08:54:39,847 GivTCP_STARTUP - Serving Web Dashboard from port 3000
[2022-09-09 08:54:40 +0100] [9] [INFO] Starting gunicorn 20.1.0
[2022-09-09 08:54:40 +0100] [9] [INFO] Listening at: http://0.0.0.0:6345 (9)
[2022-09-09 08:54:40 +0100] [9] [INFO] Using worker: sync
[2022-09-09 08:54:40 +0100] [21] [INFO] Booting worker with pid: 21
[2022-09-09 08:54:40 +0100] [22] [INFO] Booting worker with pid: 22
[2022-09-09 08:54:40 +0100] [23] [INFO] Booting worker with pid: 23
INFO: Accepting connections at http://localhost:3000.
2022-09-09 08:54:46,116 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb6688288>)
2022-09-09 08:54:51,845 - givenergy_modbus [ERROR] Did not receive expected response type: ReadHoldingRegistersResponse != ErrorResponse
2022-09-09 08:54:52,575 - givenergy_modbus [ERROR] Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
2022-09-09 08:54:52,576 - givenergy_modbus [ERROR] Did not receive expected response type: ReadInputRegistersResponse != ModbusIOException
2022-09-09 08:54:53,826 - GivTCP_Read_1 [ERROR] Error collecting registers: (<class 'KeyError'>, KeyError(HR:120), <traceback object at 0xb5a6f0e8>)
2022-09-09 08:54:53,827 - GivTCP_Read_1 [ERROR] Removing lock file due to read error
2022-09-09 08:55:10,327 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5c9f9e8>)
2022-09-09 08:55:26,855 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5d00488>)
2022-09-09 08:55:41,640 - givenergy_modbus [ERROR] Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
2022-09-09 08:55:43,637 - GivTCP_Read_1 [ERROR] Error collecting registers: (<class 'KeyError'>, KeyError(HR:120), <traceback object at 0xb5c9f9c8>)
2022-09-09 08:55:43,638 - GivTCP_Read_1 [ERROR] Removing lock file due to read error
2022-09-09 08:56:00,209 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5c9fb68>)
2022-09-09 08:56:16,733 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5a4ace8>)
2022-09-09 08:56:33,240 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5a4af68>)
2022-09-09 08:56:49,751 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5a4af68>)
2022-09-09 08:57:06,250 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5a71888>)
2022-09-09 08:57:22,754 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5a4af68>)
2022-09-09 08:57:39,253 - GivTCP_Read_1 [ERROR] Error processing registers: (<class 'KeyError'>, KeyError('BG2112G123'), <traceback object at 0xb5c9f7a8>)
2022-09-09 08:57:51,535 - givenergy_modbus [ERROR] Did not receive expected response type: ReadInputRegistersResponse != ErrorResponse
2022-09-09 08:57:52,275 - givenergy_modbus [ERROR] Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
2022-09-09 08:57:52,276 - givenergy_modbus [ERROR] Did not receive expected response type: ReadHoldingRegistersResponse != ModbusIOException

Simply deleting the container and recreateing it made that key error disappear.

Also, now that it and the 2nd container are running, the 2nd is regularly spitting this
[2022-09-09 09:07:49 +0100] [44] [ERROR] Connection in use: ('', 6345)
[2022-09-09 09:07:49 +0100] [44] [ERROR] Retrying in 1 second.
[2022-09-09 09:07:50 +0100] [44] [ERROR] Connection in use: ('', 6345)
[2022-09-09 09:07:50 +0100] [44] [ERROR] Retrying in 1 second.
[2022-09-09 09:07:51 +0100] [44] [ERROR] Connection in use: ('', 6345)
[2022-09-09 09:07:51 +0100] [44] [ERROR] Retrying in 1 second.
[2022-09-09 09:07:52 +0100] [44] [ERROR] Connection in use: ('', 6345)
[2022-09-09 09:07:52 +0100] [44] [ERROR] Retrying in 1 second.
[2022-09-09 09:07:53 +0100] [44] [ERROR] Can't connect to ('', 6345)

Which feels like both it and the 1st are playing tug of war with 6345 maybe?

T
#167 Tim

dbt85 The latest version of Givtcp (1.1.7 I think) allows you to specify the number of inverters and increments the port used to query the inverter (port 6345 by default, 6346 for second inverter and I presume 6347 for third).

#168 dbt85

Tim Ah ok that mankes sense. Do you know if they are all supposed to be within a single container or whether they can have their own and in so doing also have their own HADEVICEPREFIX??

R
#169 rwbarrett

So I finally got GivTCP installed as the HASS addon but have a question - I have 2 batteries.

the inverter SOC is 90% (as per the GE app)
The 5.2 kW battery SOC is 92%
The 8.2 kW battery SOC is 82%

if I multiply the individual SOCs out I get (92x5.2 + 82x8.2)/13.4 = 85.9% i.e. not 90%

Any ideas whats going on? Is the inverter SOC taking into account the 4% reserve and the battery ones ignoring it?

T
#170 Tim

dbt85 @Britkat can answer that as I don't have HA. WRT the Givtcp 1.1.7, it's just a single Givtcp instance with NUM_INVERTERS set to 3 (in your case). If it doesn't find the inverters automatically, you can set the inverter IP addresses using ENV variables (you can also use host names if you've got them set in your router/DHCP server). The first address ENV is already available (INVERTOR_IP_1), you can manually add INVERTOR_IP_2 and INVERTOR_IP_3 to the ENV.

#171 dbt85

Tim Thanks Tim, I figured that was the case. The issue for me is that the 3 inverters are not on the same system as others might be, simply the same site on 3 different arrays in 3 different properties. So being able to set HADEVICEPREFIX is great as I thought I could set one to be "Property 1", one to "property 2" and the last one for the rather unimaginative "property 3".

Might I suggest HADEVICEPREFIX_1 HADEVICEPREFIX_2 and HADEVICEPREFIX_3 to the erstwhile @Britkat. Probably a niche problem in a niche field I suppose.

B
#172 Britkat

dbt85 Good suggestion, let me look at that and try to wrap it into the upcoming v2.0 release

C
#173 chrisinuk

Great Integration. Thank you