Skip to content

Predbat uses 21% less memory, GE Cloud controls re-read after a failure, Sigenergy AC EV charger, Axle VPP in Compare

Latest

Choose a tag to compare

@springfall2008 springfall2008 released this 27 Nov 20:37
6442166

Predbat now uses about 21% less memory and plans are unchanged. On our benchmark install, steady memory fell from 105 MB to 83 MB (−21%), and the peak fell from 138 MB to 92 MB (−33%). The first plan cycle after a restart takes 1.2 seconds instead of 4.3. A 100-cycle soak test found no new leak. GE Cloud now re-reads an inverter's controls when a command doesn't take effect. Before, it could wait up to 12 hours, leaving the battery idle at a peak rate. The GE Cloud Restart Inverter switch also works now.

For Sigenergy, Predbat now reads a Sigen AC EV charger's energy and uses it as car_charging_energy. On the Compare tab, Axle VPP events now count for every tariff compared, not just your current one.

Upgrade notes

  • Octopus: the rate cache is now stored in a new file format. On the first start after upgrading, Predbat reads the old cache file once and saves it in the new format, so your cached rates carry over, even if Octopus can't be reached at that moment. Only a cache saved in the last 8 hours is used.
  • Sigenergy with a Sigen AC EV charger: load_today now includes the charger's energy, which matches what grid import already counts. If you haven't set car_charging_energy, it is set to the charger for you. If you have set it, your setting is kept and the log names the sensor to add.
  • apps.yaml duplicate keys: the warning about a key written twice now names the key and both lines. yes:, true: and on: all count as the same key, because that is how Predbat reads them.

What's Changed

Memory and speed

Each PR's figure below was measured on its own; the totals above come from one run of main before and after all seven.

  • perf(memory): release plan search caches, lazy-load web pages and libraries, smaller SQLite cache (~-11% steady RSS) by @springfall2008 in #6384
    • If you never open the web UI, its pages and the libraries behind them are no longer loaded. Predheat's code is loaded only when Predheat is configured.
  • perf(octopus): store the Octopus URL cache as compact JSON instead of per-minute YAML (-8.4% peak RSS, first cycle -1 s) by @springfall2008 in #6385
  • fix(octopus): read the old YAML URL cache once when there is no JSON cache by @springfall2008 in #6398
    • On the first start after upgrading, the old cache is read once and converted, so a failed first download still has rates to fall back on. Every later start reads the new format only.
  • perf(octopus): hold the cached Octopus rate series packed (steady -3.5 MB, peak -3.8 MB) by @springfall2008 in #6391
  • perf(ha): hold history attributes as shared keys plus packed values (steady RSS -3.3 MB) by @springfall2008 in #6390
  • perf(fetch): hold the finished per-minute rate series packed (steady RSS -2.1 MB) by @springfall2008 in #6389
  • perf(config): check apps.yaml secrets with PyYAML so ruamel isn't loaded at startup (steady RSS -2.5 MB) by @springfall2008 in #6394
  • perf(debug): write plain data in the debug dump directly instead of through yaml.dump by @springfall2008 in #6386
    • Debug dumps, including the debug-history snapshot taken every 3 hours, are written about 7x faster, and the memory peak while writing one is about 11 MB lower. Dumps replay exactly as before.

GE Cloud

  • fix(gecloud): re-read controls after a real failure, and again if it persists by @springfall2008 in #6397
    • An inverter's control settings could change back after Predbat wrote them. One case was the reserve returning to a held value during an export. Predbat logged the control failure but kept trusting its cached settings until the 12-hourly re-read. A failure now triggers a re-read, and another one 30 minutes later if the slot is still failing. The normal control cycle then rewrites whatever doesn't match.
    • Fixed a start-up bug: a restart could count all previous failures as new ones, which then blocked re-reads for the next 4 hours.
  • fix(gecloud): write a write-only register's exact value from its switch by @springfall2008 in #6396
    • The Restart Inverter switch was always rejected by GivEnergy with "There were validation errors". It now sends the value the API requires. Turning the switch off does nothing, because a restart has nothing to turn off.

Sigenergy

  • feat(sigenergy): read the AC EV charger's lifetime energy and bind it to car_charging_energy by @springfall2008 in #6392
    • New sensor sensor.<prefix>_sigenergy_<system>_ac_ev_charge_lifetime. Until now, Predbat had no record of a Sigen AC charger's energy, so its load history and its live load readings disagreed about whether the car was charging.
  • feat(sigenergy): oauth auth method that takes the token from a refresh service by @mgazza in #6377
    • New sigenergy_auth_method option, for predbat.com only. With oauth, predbat.com provides and refreshes the access token, so installs that share an app key stop running into Sigenergy's login rate limit. Self-hosted installs keep the default, api_key.
  • docs(sigenergy): enable the Remote EMS mode select and import limit by @chalfontchubby in #6359
    • The Sigenergy Local Modbus integration ships two entities switched off, and the setup docs didn't say to switch them on. Without them, the Remote EMS mode automation fails, and the plant charges the battery from solar while the house runs from the grid. The automation now carries on past that step if it fails. Fixes #6357.

Bug fixes

  • fix(compare): apply Axle VPP sessions to every compared tariff by @C-G-White in #6294
    • On an Axle event day, only your current tariff was credited with the event payment, so it beat the other tariffs by about the event's value. That also skewed the rolling averages. Fixes #4042.
  • fix(inverter): say when battery_power has the wrong sign in the battery size and rate grid warnings by @springfall2008 in #6378
    • If battery_power has the wrong sign, the battery size and charge/discharge rate warnings now suggest battery_power_invert instead of just reporting no usable data. Refs #6375.
  • fix(plan): publish soc_kw_best_h12 with unit_of_measurement kWh by @springfall2008 in #6395
    • predbat.soc_kw_best_h12 had no unit in Home Assistant because of a typo. Fixes #6388.
  • Preserve Gemini thought_signature (extra_content) on tool calls by @capsel22 in #6383
    • Gemini 3 models now work with tool calls in the Predbat chat. Before, they failed with HTTP 400 "Function call is missing a thought_signature".

Maintenance

New Contributors

Full Changelog: v9.10.1...v9.10.2