Skip to content

Commit

Permalink
Merge pull request snaptec#1951 from benderl/bugfix
Browse files Browse the repository at this point in the history
catch extprod readiing error in wr_solaredge
  • Loading branch information
benderl authored Jan 21, 2022
2 parents 2869589 + 900989c commit ac9009f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/wr_solaredge/solaredgeall.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ def update_solar_edge(client: ModbusClient,
total_currents[i] += currents[i] * currents_scale
if extprodakt == 1:
# 40380 = "Meter 2/Total Real Power (sum of active phases)" (Watt)
total_power -= client.read_holding_registers(40380, ModbusDataType.INT_16, unit=slave_ids[0])
try:
total_power -= client.read_holding_registers(40380, ModbusDataType.INT_16, unit=slave_ids[0])
except Exception:
# catch wrong configured "extprodakt"
log.error("Unable to read secondary SmartMeter! Check configuration!")
if subbat == 1:
total_power -= sum(min(p, 0) for p in storage_powers)
else:
Expand Down

0 comments on commit ac9009f

Please sign in to comment.