Charge period doesn't start when immediately after an export period using Solar Assistant
When Predbat discharges before a free electric session, or in the evening before a cheap period, if the charge period is immediately following the discharge period, it fails to enable the charge period. If I artificially add a delay between the discharge and charge, by adding rate overrides, it works fine.
When changing from Discharge to Charge, Predbat first changes Work Mode Priority from Grid First, to Load First, and then to Battery First. I think this change is too quick, and I often see an error saying "Skipped". Perhaps it could just change from Grid First directly to Battery First?
Here is the log file where you can see the skipped problem. No actual errors appear anywhere though.
2025-09-11 12:01:34.185177: Inverter 0 Current charge limit is 22% and new target is 100% 2025-09-11 12:01:44.191411: Inverter 0 write_and_poll_value: Wrote 100 to charge_limit, successfully now 100 2025-09-11 12:01:44.191514: Current SOC 27% is less than Target SOC 100. Grid charging enabled with charge current set to 65.00 2025-09-11 12:01:44.191570: Inverter 0 Calling service charge_stop_service domain discharge service_name select/select_option with data {'entity_id': 'select.growatt_sph_work_mode_priority', 'option': 'Load first'} 2025-09-11 12:01:44.198237: Inverter 0 Calling service charge_start_service domain charge service_name select/select_option with data {'entity_id': 'select.growatt_sph_work_mode_priority', 'option': 'Battery first'} 2025-09-11 12:01:44.202754: Inverter 0 Skipped service charge_stop_service domain discharge service_name select.select_option as it was previously called. 2025-09-11 12:01:44.202775: Inverter 0 count register writes 0
These are the only changes on the device around that period. I have noticed another issue relating to the refresh timeout though, #2580. I have added the sleep timeout line to the apps.yaml, so will see if that helps tomorrow. Still means it is doing 2 writes, when 1 would suffice though.
Happened again. Why is it skipping the service to enable the charge? Then also saying that it completed and changes the status to Charging when it isn't?
Last night it didn't charge correctly either, even with a gap between the export and import slot. This is the log from just now
5658 | 2025-09-18 14:00:36.298527: Inverter 0 Adjust force export to False, change times from 00:00:00 - 00:00:00 to 00:00:00 - 00:00:00 5659 | 2025-09-18 14:00:36.298534: Adjust idle time, charge 14:00:00-15:00:00 discharge 00:00:00-00:00:00 5660 | 2025-09-18 14:00:36.298574: Adjust demand (idle) time computed is 15:00:00-23:59:00 5661 | 2025-09-18 14:00:36.298614: Setting charging SOC to 100 as per target 5662 | 2025-09-18 14:00:36.298632: Inverter 0 adjust target soc for charge to 100.0% based on requested all inverter soc 100% 5663 | 2025-09-18 14:00:36.298645: Inverter 0 Current Target SOC is 100%, already at target 5664 | 2025-09-18 14:00:36.298683: Current SOC 22% is less than Target SOC 100. Grid charging enabled with charge current set to 65.00 5665 | 2025-09-18 14:00:36.298731: Inverter 0 Skipped service charge_stop_service domain discharge service_name select.select_option as it was previously called. 5666 | 2025-09-18 14:00:36.298760: Inverter 0 Skipped service charge_start_service domain charge service_name select.select_option as it was previously called. 5667 | 2025-09-18 14:00:36.298780: Inverter 0 Skipped service charge_stop_service domain discharge service_name select.select_option as it was previously called. 5668 | 2025-09-18 14:00:36.298787: Inverter 0 count register writes 0 5669 | 2025-09-18 14:00:36.314999: Total inverter register writes now 95 5670 | 2025-09-18 14:00:36.331170: Completed run status Charging 5671 | 2025-09-18 14:00:36.565407: Info: record_status Charging target 22%-100%