dewet22 / givenergy-modbus

A python library to access GivEnergy inverters via Modbus TCP on a local network, with no dependency on the GivEnergy Cloud.
Other
19 stars 15 forks source link

Fix for odd f/w #7

Closed britkat1980 closed 2 years ago

britkat1980 commented 2 years ago

Update to allow access to alternative battery charge and discharge energy totals on some versions of f/w

codecov[bot] commented 2 years ago

Codecov Report

Merging #7 (9148bb0) into main (f37b366) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
+ Coverage   90.10%   90.11%   +0.01%     
==========================================
  Files          17       17              
  Lines        1667     1669       +2     
  Branches      155      155              
==========================================
+ Hits         1502     1504       +2     
  Misses        142      142              
  Partials       23       23              
Impacted Files Coverage Δ
givenergy_modbus/model/battery.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f37b366...9148bb0. Read the comment docs.

dewet22 commented 2 years ago

Thanks for this. What's the difference between these registers (IR 105 & 106) and the other batterytotal(dis)charge registers (IR 180 & 181)? My gut feeling is the former is the total for the battery pack and should be equal to the latter for single battery systems. In multi-battery systems, do the latter indicate the cumulative totals across all battery packs?

britkat1980 commented 2 years ago

For some users registers 180&181 don't return data (0 values), so they need to get battery energy details from 105&106. Not sure why, its due to variances in the firmware. GE haven't been able to really confirm what versions have which registers... So I use some logic in GivTCP to fetch from second register set if the "usual" ones don't return values

dewet22 commented 2 years ago

Thanks! Do you remember off-hand which models return which values?

britkat1980 commented 2 years ago

This is the problem... its not specific to any one model, in theory applies to f/w prior to 449 (but even that's not consistent afaik)

dewet22 commented 2 years ago

Understood. Thanks for the contribution!