Skip to content

Commit

Permalink
2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
britkat1980 committed Jul 29, 2023
1 parent 2ae0a7b commit 082d8fd
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@ MQTT_TEST.py
REST_TEST.py
test.py
settings.py
__pycache__
givenergy_modbus/model/__pycache__/inverter.cpython-310.pyc
givenergy_modbus/model/__pycache__/plant.cpython-310.pyc
givenergy_modbus/model/__pycache__/register_cache.cpython-310.pyc
givenergy_modbus/model/__pycache__/register_getter.cpython-310.pyc
givenergy_modbus/model/__pycache__/register.cpython-310.pyc
givenergy_modbus/__pycache__/client.cpython-310.pyc
givenergy_modbus/__pycache__/decoder.cpython-310.pyc
givenergy_modbus/__pycache__/modbus.cpython-310.pyc
givenergy_modbus/__pycache__/pdu.cpython-310.pyc
givenergy_modbus/__pycache__/transaction.cpython-310.pyc
givenergy_modbus/__pycache__/util.cpython-310.pyc
2 changes: 1 addition & 1 deletion GivTCP/GivLUT.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class InvType:
def __init__(self,ph,md,pw,mr,gn):
self.phase=ph
self.model=md
self.power=pw
self.invmaxrate=pw
self.batmaxrate=mr
self.generation=gn

Expand Down
9 changes: 6 additions & 3 deletions GivTCP/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def getData(fullrefresh): # Read from Inverter put in cache
inverterModel.model=GEInv.inverter_model
inverterModel.generation=GEInv.inverter_generation
inverterModel.phase=GEInv.inverter_phases
inverterModel.power=GEInv.inverter_maxpower
inverterModel.invmaxrate=GEInv.inverter_maxpower

if GEInv.device_type_code=="8001": # if AIO
batteryCapacity=GEInv.battery_nominal_capacity*307
Expand Down Expand Up @@ -201,7 +201,7 @@ def getData(fullrefresh): # Read from Inverter put in cache
# Inverter Power
logger.debug("Getting PInv Power")
inverter_power = GEInv.p_inverter_out
if -6000 <= inverter_power <= 6000:
if -inverterModel.invmaxrate <= inverter_power <=inverterModel.invmaxrate:
power_output['Invertor_Power'] = inverter_power
if inverter_power < 0:
power_output['AC_Charge_Power'] = abs(inverter_power)
Expand Down Expand Up @@ -348,6 +348,9 @@ def getData(fullrefresh): # Read from Inverter put in cache
elif GEInv.battery_power_mode == 0 and GEInv.enable_discharge == True:
# Storage (export) r27=0 r59=1
mode = "Timed Export"
elif GEInv.battery_power_mode == 0 and GEInv.enable_discharge == False:
# Dynamic r27=1 r110=4 r59=0
mode = "Eco (Paused)"
else:
mode = "Unknown"

Expand Down Expand Up @@ -581,7 +584,7 @@ def getData(fullrefresh): # Read from Inverter put in cache
metertype = "EM418"
inverter['Meter_Type'] = metertype
inverter['Invertor_Type'] = inverterModel.generation + " " + inverterModel.model
inverter['Invertor_Max_Inv_Rate'] = inverterModel.power
inverter['Invertor_Max_Inv_Rate'] = inverterModel.invmaxrate
inverter['Invertor_Max_Bat_Rate'] = inverterModel.batmaxrate
inverter['Invertor_Temperature'] = GEInv.temp_inverter_heatsink

Expand Down
6 changes: 3 additions & 3 deletions GivTCP/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def smd():
temp={}
try:
client.set_mode_dynamic()
updateControlMQTT("Mode","Eco")
#updateControlMQTT("Mode","Eco")
temp['result']="Setting dynamic mode was a success"
except:
e = sys.exc_info()
Expand All @@ -252,7 +252,7 @@ def sbdmd():
temp={}
try:
client.set_battery_discharge_mode_demand()
updateControlMQTT("Mode","Timed Demand")
#updateControlMQTT("Mode","Timed Demand")
temp['result']="Setting demand mode was a success"
except:
e = sys.exc_info()
Expand All @@ -263,7 +263,7 @@ def sbdmmp():
temp={}
try:
client.set_battery_discharge_mode_max_power()
updateControlMQTT("Mode","Timed Export")
#updateControlMQTT("Mode","Timed Export")
temp['result']="Setting export mode was a success"
except:
e = sys.exc_info()
Expand Down
4 changes: 2 additions & 2 deletions buildx.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t britkat/giv_tcp-dev:2.2.120 -t britkat/giv_tcp-dev:latest --push .
::docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t britkat/giv_tcp-dev:2.2.122 -t britkat/giv_tcp-dev:latest --push .
::docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t britkat/giv_tcp-dev:latest --push .
::docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t britkat/giv_tcp-ma:latest -t britkat/giv_tcp-ma:2.2.0 --push .
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t britkat/giv_tcp-ma:latest -t britkat/giv_tcp-ma:2.3.0 --push .
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "GivTCP"
description: "TCP Modbus connection to MQTT/JSON for Givenergy Battery/PV Invertors"
version: "2.2.4"
version: "2.3.0"
image: britkat/giv_tcp-ma
slug: "givtcp"
homeassistant_api: true
Expand Down
Binary file modified givenergy_modbus/__pycache__/client.cpython-310.pyc
Binary file not shown.
Binary file modified givenergy_modbus/__pycache__/decoder.cpython-310.pyc
Binary file not shown.
Binary file modified givenergy_modbus/__pycache__/modbus.cpython-310.pyc
Binary file not shown.
Binary file modified givenergy_modbus/__pycache__/pdu.cpython-310.pyc
Binary file not shown.
Binary file modified givenergy_modbus/__pycache__/transaction.cpython-310.pyc
Binary file not shown.
Binary file modified givenergy_modbus/__pycache__/util.cpython-310.pyc
Binary file not shown.
Binary file modified givenergy_modbus/model/__pycache__/inverter.cpython-310.pyc
Binary file not shown.
Binary file modified givenergy_modbus/model/__pycache__/plant.cpython-310.pyc
Binary file not shown.
Binary file modified givenergy_modbus/model/__pycache__/register.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 13 additions & 1 deletion translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ configuration:
INVERTOR_AIO_1:
name: Inverter 1 - Is it an AIO?
description: >-
Does this firmware need the new modubs connection to work, only applies to AIO and future firmware releases. If unsure, leave it as False/off
Does this Inverter need the new modbus connection to work, only applies to AIO and future firmware releases. If unsure, leave it as False/off
INVERTOR_AC_1:
name: Inverter 1 - Is it an AC on old firmware?
description: >-
Does this Inverter need the old modbus connection to work, only applies to AC and old firmware releases. If unsure, leave it as False/off
HADEVICEPREFIX:
name: Inverter 1 - Home Assistant Entity Prefix
description: >-
Expand All @@ -32,6 +36,10 @@ configuration:
name: Inverter 2 - Is it an AIO?
description: >-
Does this firmware need the new modubs connection to work, only applies to AIO and future firmware releases. If unsure, leave it as False/off
INVERTOR_AC_2:
name: Inverter 2 - Is it an AC on old firmware?
description: >-
Does this Inverter need the old modbus connection to work, only applies to AC and old firmware releases. If unsure, leave it as False/off
HADEVICEPREFIX_2:
name: Inverter 2 - Home Assistant Entity Prefix
description: >-
Expand All @@ -48,6 +56,10 @@ configuration:
name: Inverter 3 - Is it an AIO?
description: >-
Does this firmware need the new modubs connection to work, only applies to AIO and future firmware releases. If unsure, leave it as False/off
INVERTOR_AC_3:
name: Inverter 3 - Is it an AC on old firmware?
description: >-
Does this Inverter need the old modbus connection to work, only applies to AC and old firmware releases. If unsure, leave it as False/off
HADEVICEPREFIX_3:
name: Inverter 3 - Home Assistant Entity Prefix
description: >-
Expand Down

0 comments on commit 082d8fd

Please sign in to comment.