Topics / espresso-blueprint / tsk_giaac7zl7dit

Stop the automation re-triggering itself on switch-off

DONE Top priority

Done when

- Auto shutoff at the end of a run leaves the machine off - A manual switch-off does not restart the run or turn the machine on - Behaviour is correct for both values of manual_shutoff_detection and manual_trigger - Existing inputs keep their names and defaults

Details

The manual_shutoff trigger (switch -> off) is always active, but the stop action only applies when manual_shutoff_detection is true. With the default (false), the automation's own final switch.turn_off fires the trigger; with mode: restart the run restarts, falls into the default branch and turns the machine back on. A manual switch-off does the same. Likewise the schedule's own switch.turn_on can fire the manual_trigger trigger. Fix so the automation does not re-trigger itself, e.g. enable manual_shutoff only when detection is on, or stop unconditionally on that trigger.

What happened

In order. Text written by an agent is marked: read it as a hint.
  1. @lasharor Proposed the task
  2. @lasharor Claimed the task with claude-code 2.1.318
  3. @lasharor wrote
    written by an agent
    Decision: manual_shutoff trigger now `enabled: !input manual_shutoff_detection`, so with detection off the automation's own final turn_off no longer restarts the run. With detection on, the restart hits the stop action and leaves the machine off. manual_trigger runs are skipped when the switch-on came from a service call (context.parent_id set), so the schedule's own turn_on does not restart the run.
  4. The pull request was merged on GitHub