Skip to content

Fox Cloud forced export fails #3063

@davidjwood

Description

@davidjwood

Describe the bug
Forced exports usually fail on my Fox Cloud inverter.

The log extract below shows multiple issues, the first of which is probably the root cause:

  • The discharge target percentage is calculated at 10.0, when it should be 17.51 / 23.04 = 76.0 rounded to the nearest 1.0. This ultimately causes Fox Cloud to return a 40257 error code, presumably because fdSoc < minSocOnGrid for the export slot
  • fdPwr for the export slot is formatted without a trailing .0 - this is probably just a cosmetic bug, but could conceivably lead to a Fox Cloud error code, and
  • fdPwr for the export slot is set to 6000, when this should arguably be clamped to the configured export limit on the inverter (5000.0; I am G99 limited to 5kW export).

Expected behaviour
Forced exports should work!

Predbat version

v8.29.11

Environment details

  • Fox ESS H1-6.0-E-G2 with WLan-WW module and two EP12 Plus batteries (23.04 kWh combined capacity), cloud connection to Predbat
  • HAOS 16.3 running Home Assistant 2025.12.3 on an x64 virtual machine

Log file (extract, inverter SN masked)

The full masked log file is in predbat.log

2025-12-14 03:55:14.931462: Include original export start 12-14 03:55:00 with our start which is 12-14 03:55:00 (charge start 12-16 00:00:00 end 12-16 00:00:00)
2025-12-14 03:55:14.931608: Next export window will be: 2025-12-14 03:55:00+00:00 - 2025-12-14 04:30:00+00:00 at reserve 76.0
2025-12-14 03:55:14.931715: Exporting now - current SoC 20.736kWh and target 17.51kWh and power adjust 1.0
2025-12-14 03:55:14.932052: Inverter 0 Adjust force export to True, change times from 03:55:00 - 04:30:00 to 03:55:00 - 04:30:00
2025-12-14 03:55:14.932105: Adjust idle time, charge 00:00:00-00:00:00 discharge 03:55:00-04:30:00
2025-12-14 03:55:14.932903: Adjust demand (idle) time computed is 04:30:00-23:59:00
2025-12-14 03:55:14.933036: Inverter 0 Current discharge target is already set to 10.0
2025-12-14 03:55:14.936834: Inverter 0 adjust target SoC for export to 0% based on requested all inverter SoC 0%
2025-12-14 03:55:14.936983: Inverter 0 Current charge limit is 100% and new target is 63%
2025-12-14 03:55:15.268166: Warn: Fox: Invalid parameter Parameters do not meet expectations. Please reenter:40257 from https://www.foxesscloud.com/op/v1/device/scheduler/enable
2025-12-14 03:55:15.269068: Fox: API Response failed after 10 retries for /op/v1/device/scheduler/enable
2025-12-14 03:55:17.060511: Inverter 0 write_and_poll_value: Wrote 63 to charge_limit, successfully now 63
2025-12-14 03:55:17.122782: Fox: New schedule for FoxInverterSN: [{'enable': 1, 'startHour': 0, 'startMinute': 0, 'endHour': 3, 'endMinute': 54, 'workMode': 'SelfUse', 'fdSoc': 63, 'maxSoc': 100, 'fdPwr': 6000.0, 'minSocOnGrid': 63}, {'enable': 1, 'startHour': 3, 'startMinute': 55, 'endHour': 4, 'endMinute': 29, 'workMode': 'ForceDischarge', 'fdSoc': 10, 'maxSoc': 63, 'fdPwr': 6000, 'minSocOnGrid': 63}, {'enable': 1, 'startHour': 4, 'startMinute': 30, 'endHour': 23, 'endMinute': 59, 'workMode': 'SelfUse', 'fdSoc': 63, 'maxSoc': 100, 'fdPwr': 6000.0, 'minSocOnGrid': 63}]
2025-12-14 03:55:17.123203: Fox: Debug: Setting scheduler for FoxInverterSN same=False current_enable=1 current_groups=[{'endHour': 3, 'fdPwr': 6000, 'minSocOnGrid': 63, 'workMode': 'SelfUse', 'fdSoc': 63, 'enable': 1, 'startHour': 0, 'maxSoc': 100, 'startMinute': 0, 'endMinute': 29}, {'endHour': 3, 'fdPwr': 6000, 'minSocOnGrid': 63, 'workMode': 'ForceCharge', 'fdSoc': 100, 'enable': 1, 'startHour': 3, 'maxSoc': 63, 'startMinute': 30, 'endMinute': 54}, {'endHour': 23, 'fdPwr': 6000, 'minSocOnGrid': 63, 'workMode': 'SelfUse', 'fdSoc': 63, 'enable': 1, 'startHour': 3, 'maxSoc': 100, 'startMinute': 55, 'endMinute': 59}, {'endHour': 0, 'fdPwr': 0, 'minSocOnGrid': 10, 'workMode': 'SelfUse', 'fdSoc': 100, 'enable': 0, 'startHour': 0, 'maxSoc': 100, 'startMinute': 0, 'endMinute': 0}, {'endHour': 0, 'fdPwr': 0, 'minSocOnGrid': 10, 'workMode': 'SelfUse', 'fdSoc': 100, 'enable': 0, 'startHour': 0, 'maxSoc': 100, 'startMinute': 0, 'endMinute': 0}, {'endHour': 0, 'fdPwr': 0, 'minSocOnGrid': 10, 'workMode': 'SelfUse', 'fdSoc': 100, 'enable': 0, 'startHour': 0, 'maxSoc': 100, 'startMinute': 0, 'endMinute': 0}, {'endHour': 0, 'fdPwr': 0, 'minSocOnGrid': 10, 'workMode': 'SelfUse', 'fdSoc': 100, 'enable': 0, 'startHour': 0, 'maxSoc': 100, 'startMinute': 0, 'endMinute': 0}, {'endHour': 0, 'fdPwr': 0, 'minSocOnGrid': 10, 'workMode': 'SelfUse', 'fdSoc': 100, 'enable': 0, 'startHour': 0, 'maxSoc': 100, 'startMinute': 0, 'endMinute': 0}] new_groups=[{'enable': 1, 'startHour': 0, 'startMinute': 0, 'endHour': 3, 'endMinute': 54, 'workMode': 'SelfUse', 'fdSoc': 63, 'maxSoc': 100, 'fdPwr': 6000.0, 'minSocOnGrid': 63}, {'enable': 1, 'startHour': 3, 'startMinute': 55, 'endHour': 4, 'endMinute': 29, 'workMode': 'ForceDischarge', 'fdSoc': 10, 'maxSoc': 63, 'fdPwr': 6000, 'minSocOnGrid': 63}, {'enable': 1, 'startHour': 4, 'startMinute': 30, 'endHour': 23, 'endMinute': 59, 'workMode': 'SelfUse', 'fdSoc': 63, 'maxSoc': 100, 'fdPwr': 6000.0, 'minSocOnGrid': 63}]
2025-12-14 03:55:17.123306: Fox: API Requesting POST /op/v1/device/scheduler/enable - data {'deviceSN': 'FoxInverterSN', 'groups': [{'enable': 1, 'startHour': 0, 'startMinute': 0, 'endHour': 3, 'endMinute': 54, 'workMode': 'SelfUse', 'fdSoc': 63, 'maxSoc': 100, 'fdPwr': 6000.0, 'minSocOnGrid': 63}, {'enable': 1, 'startHour': 3, 'startMinute': 55, 'endHour': 4, 'endMinute': 29, 'workMode': 'ForceDischarge', 'fdSoc': 10, 'maxSoc': 63, 'fdPwr': 6000, 'minSocOnGrid': 63}, {'enable': 1, 'startHour': 4, 'startMinute': 30, 'endHour': 23, 'endMinute': 59, 'workMode': 'SelfUse', 'fdSoc': 63, 'maxSoc': 100, 'fdPwr': 6000.0, 'minSocOnGrid': 63}]}
2025-12-14 03:55:17.123461: Fox: API Request: path /op/v1/device/scheduler/enable post True datain {'deviceSN': 'FoxInverterSN', 'groups': [{'enable': 1, 'startHour': 0, 'startMinute': 0, 'endHour': 3, 'endMinute': 54, 'workMode': 'SelfUse', 'fdSoc': 63, 'maxSoc': 100, 'fdPwr': 6000.0, 'minSocOnGrid': 63}, {'enable': 1, 'startHour': 3, 'startMinute': 55, 'endHour': 4, 'endMinute': 29, 'workMode': 'ForceDischarge', 'fdSoc': 10, 'maxSoc': 63, 'fdPwr': 6000, 'minSocOnGrid': 63}, {'enable': 1, 'startHour': 4, 'startMinute': 30, 'endHour': 23, 'endMinute': 59, 'workMode': 'SelfUse', 'fdSoc': 63, 'maxSoc': 100, 'fdPwr': 6000.0, 'minSocOnGrid': 63}]}
2025-12-14 03:55:17.140509: Pressed toggle button switch.predbat_fox_FoxInverterSN_battery_schedule_charge_write on Inverter 0
2025-12-14 03:55:17.141027: Inverter 0 Current reserve is 63%, already at target
2025-12-14 03:55:17.143792: Inverter 0 count register writes 2

Metadata

Metadata

Labels

bugSomething isn't workingfixed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions