Skip to content

Commit 3e2b22d

Browse files
fix(fox): correct half-kW inverter capacity and round noisy production totals
Fox's device/detail 'capacity' field is a truncated integer, so a 10.5kW KH10.5 inverter reported as 10kW everywhere - both the reported inverter_capacity/inverter_limit sensor and the fdpwr_max clamp that was silently capping the correct 10500W scheduler value down to 10000W. Now corrects the value from deviceType when it ends in '.5'. Also round the _today/_month production sensors (e.g. generation_today) which were carrying long floating-point summation artifacts from Fox's raw history data. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 1f950c6 commit 3e2b22d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎apps/predbat/fox.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ async def get_scheduler(self, deviceSN, checkBattery=True):
14941494
# XXX: Fox seems to be have an issue with FD Power max value being too high, cap it at the inverter capacity
14951495
# (inverter_capacity is already corrected for half-kW deviceTypes by capacity_watts())
14961496
if inverter_capacity:
1497-
self.fdpwr_max[deviceSN] = min(inverter_capacity, self.fdpwr_max[deviceSN])
1497+
self.fdpwr_max[deviceSN] = min(inverter_capacity + 999.0, self.fdpwr_max[deviceSN])
14981498

14991499
# Min SOC On grid can change as Predbat writes reserve so this must be the real min
15001500
self.fdsoc_min[deviceSN] = result.get("properties", {}).get("fdsoc", {}).get("range", {}).get("min", 10)

0 commit comments

Comments
 (0)