add manual_load option

This commit is contained in:
bohdan-s
2021-12-24 14:31:06 +11:00
parent e11cbbb81f
commit 89793fe94b
3 changed files with 11 additions and 4 deletions
+4 -3
View File
@@ -5,12 +5,13 @@ inverter:
# timeout: 10 # Default is 10 # timeout: 10 # Default is 10
# scan_interval: 30 # Default is 30 # scan_interval: 30 # Default is 30
connection: sungrow # options: modbus, sungrow, http connection: sungrow # options: modbus, sungrow, http
# model: "SG7.0RT" # This is autodected on startup, only needed if detection issues or for testing # model: "SG7.0RT" # This is autodetected on startup, only needed if detection issues or for testing
# See model list here: https://github.com/bohdan-s/SunGather#supported # See model list here: https://github.com/bohdan-s/SunGather#supported
# smart_meter: True # Default is False, Set to true if inverter supports reading grind / house consumption # smart_meter: True # Default is False, Set to true if inverter supports reading grind / house consumption
# use_local_time: False # Default False, Uses Inveter time, if try uses PC time when updating timestamps (e.g. PVOutput) # use_local_time: False # Default False, Uses Inventer time, if try uses PC time when updating timestamps (e.g. PVOutput)
# hybrid: False # Default false, if you have a Hybrid (battery) set to True # hybrid: False # Default false, if you have a Hybrid (battery) set to True
# logging: 30 # 10 = Debug, 20 = Info, 30 = Warnning (default), 40 = Error # manual_load: False # Manually calculate load total_active_power + meter_power if the inverter does not supply it
# logging: 30 # 10 = Debug, 20 = Info, 30 = Warning (default), 40 = Error
# level: 1 # 0 = Model and Solar Generation, # level: 1 # 0 = Model and Solar Generation,
# 1 (default) = Useful data, all required for exports, # 1 (default) = Useful data, all required for exports,
# 2 everything your Inverter supports, # 2 everything your Inverter supports,
+1 -1
View File
@@ -685,7 +685,7 @@ registers:
# - name: "Reserved" # - name: "Reserved"
# address: 5152 # address: 5152
# datatype: "U16" # datatype: "U16"
# Folling 2 registers are not in the documentation, but other projects are using them # Following 2 registers are not in the documentation, but other projects are using them
- name: "export_power" - name: "export_power"
level: 3 level: 3
address: 5216 address: 5216
+6
View File
@@ -282,6 +282,12 @@ def scrape_inverter():
inverter["import_from_grid"] = power inverter["import_from_grid"] = power
except Exception: except Exception:
pass pass
try:
if inverter.get('manual_load', False): # Inverter is returning no data, we need to calculate it manually
inverter["load_power"] = int(inverter.get('total_active_power')) + int(inverter.get('meter_power'))
except Exception:
pass
# See if the inverter is running, This is added to inverters so can be read via MQTT etc... # See if the inverter is running, This is added to inverters so can be read via MQTT etc...
# It is also used below, as some registers hold the last value on 'stop' so we need to set to 0 # It is also used below, as some registers hold the last value on 'stop' so we need to set to 0