Skip to content

Add vehicle charging & battery flow automation suite#13

Merged
Bre77 merged 1 commit into
mainfrom
fm/homey-flow-suite-b1
Jul 22, 2026
Merged

Add vehicle charging & battery flow automation suite#13
Bre77 merged 1 commit into
mainfrom
fm/homey-flow-suite-b1

Conversation

@Bre77

@Bre77 Bre77 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Intent

  • Add the curated vehicle charging & battery flow automation suite (the Disable quick action tap on devices #1 requested EV automation set):
    • Triggers: charging started, charging stopped, charging complete, plugged in, unplugged, battery below a configurable %, charge limit reached
    • Conditions: is charging, is plugged in
    • Actions: start charging, stop charging, set charge limit %, set charging amps
    • "Battery above X%" is already covered by the existing battery_level condition (it filters on measure_battery, which vehicles already have)
  • Trigger firing follows the same explicit, old-value-vs-new-value pattern R1 (Fix the 4 dead *_changed flow triggers #12) established for the *_changed cards, extended for cases a single capability comparison can't express:
    • DetailedChargeState transitions fan out to several differently-named cards (charging_started/charging_complete/charging_stopped/plugged_in/unplugged) depending on the specific old->new transition, tracked via a private field since "plugged in" has no capability of its own
    • battery_below carries a per-flow-card percentage argument, so it fires on every real battery change with {previous, current} state and a registerRunListener in app.ts decides whether that specific card's threshold was crossed; charge_limit_reached has no argument, so the crossing check happens directly in the device
  • Actions call the existing @teslemetry/api SDK commands (startCharging, stopCharging, setChargeLimit, setChargingAmps) already used by the capability listeners - no new SDK surface
  • Add test/vehicle-charging-flow.test.ts covering fire/no-fire for every trigger, the two conditions, and all four actions
  • Documents the three trigger-firing patterns (simple capability-changed, value-specific branching, threshold/argument-gated) in AGENTS.md for future flow-card work

Adds the curated B1 set of vehicle charging flow cards: triggers for
charging started/stopped/complete, plugged in/unplugged, battery
dropping below a configurable percentage, and reaching the charge
limit; conditions for is-charging and is-plugged-in; and actions to
start/stop charging and set the charge limit and charging amps.

Triggers fire off real DetailedChargeState/measure_battery transitions
(old != new), following the same explicit trigger-firing pattern R1
established for the *_changed cards - branching per transition where a
single capability comparison can't express it, and gating threshold
triggers with a registerRunListener state comparison for their
per-flow-card percentage argument. Actions call the existing SDK
commands directly.
@Bre77
Bre77 merged commit 5ecf25e into main Jul 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant