Skip to content

v0.1.34

Choose a tag to compare

@mrebbert mrebbert released this 08 May 16:45

What's New

AI-driven binary sensor: optimization_battery_grid_charge

A new binary sensor that mirrors the Heartbeat AI's currently active BATTERY decision:

  • ON when the AI has decided BATTERY_CHARGE_FROM_GRID for the current 15-min slot
  • OFF otherwise (different decision active, or no active BATTERY event)

This is a more contextual "now is a good time to consume from the grid" signal than the existing cheap_electricity (which only compares the current price to today's daily average). The HEMS considers the full forecast horizon and battery state when making the call — it fires both at the absolute price minima and when the AI just wants to bridge upcoming high-price periods.

Attributes (when ON): decision, from, to, market_price, state_of_charge.

Example automation — start a load only when the AI itself is grid-charging:

trigger:
  - platform: state
    entity_id: binary_sensor.SYSTEM_NAME_optimization_battery_grid_charge
    to: "on"
action:
  - service: switch.turn_on
    target:
      entity_id: switch.dishwasher

Tooling

  • New CodeQL workflow scans the codebase weekly (and on every push/PR) for security and code-quality issues.
  • New ruff lint/format step in CI; matching pre-commit config available locally (pip install pre-commit && pre-commit install).
  • Resolved a handful of CodeQL findings (unused module-level loggers, an empty except block).

Dependencies

  • Bumped onekommafive minimum to >=0.1.20. This is an internal refactor of the API library (centralised authenticated requests, CLI cleanups) — no public API change for the integration, but users get the cleaner code.

Full changelog

See CHANGELOG.md.