Skip to content

v0.1.33

Choose a tag to compare

@mrebbert mrebbert released this 05 May 14:13

What's New

Bus event for optimization decisions

The integration now fires an HA bus event whenever the Heartbeat AI announces a new optimization decision:

event_type: onekommafive_optimization_decision
event_data:
  system_id: <system uuid>
  asset: BATTERY | HEATPUMP
  decision: BATTERY_CHARGE_FROM_GRID | HEATPUMP_RECOMMEND_ON | …
  from: ISO-8601 start of the slot
  to:   ISO-8601 end of the slot
  market_price: float | null  # EUR/MWh
  market_price_currency: string | null
  state_of_charge: int | null

This unlocks pure HA automations directly tied to the AI — no polling sensor attributes, no template gymnastics. Example: switch on the dishwasher whenever the AI plans grid charging:

trigger:
  - platform: event
    event_type: onekommafive_optimization_decision
    event_data:
      decision: BATTERY_CHARGE_FROM_GRID
action:
  - service: switch.turn_on
    target:
      entity_id: switch.dishwasher

The first refresh after a Home Assistant restart fires one event for the most recent decision — so the wiring is immediately verifiable in Developer Tools → Events. The day's earlier decisions are not replayed.

Debug logging around the event path

Three debug log lines make it easy to verify the feature without listening on the bus first:

  • No optimization events from API; nothing to fire
  • First refresh — firing 1 event for the latest decision (from_time=…)
  • Refresh — N/M events newer than last_fired_from_time=… will fire
  • Plus a Firing onekommafive_optimization_decision: … line per actually fired event.

Enable with:

logger:
  logs:
    custom_components.onekommafive: debug

Full changelog

See CHANGELOG.md.