Swing

Outcome

Create predictable smart swing behavior with timed control, safety limits, and manual override.

Audience and Scope

Audience: Home automation builder with intermediate Home Assistant and Docker experience
Estimated Time: 1-4 hours
Difficulty: intermediate

Before You Start

  • Actuator/controller installed and electrically safe.
  • Emergency stop method validated.
  • Manual control tested without automation.

Hardware and Software

Hardware

  • Smart relay/switch controlling swing system.
  • Timer helper in Home Assistant.
  • Dashboard controls for start/stop.

Software

  • Smart relay/switch controlling swing system.
  • Timer helper in Home Assistant.
  • Dashboard controls for start/stop.

Step-by-Step

Step 1: Create swing control entity

Objective: Expose a single switch/button for swing run state.

Actions:

  • Implement create swing control entity according to your environment.

Verification:

  • Confirm expected state in Home Assistant and logs.
  • Run a manual test to verify expected behavior.

Common failure and fix: If auto-stop fails: verify timer trigger and entity IDs.

Step 2: Add max runtime timer

Objective: Create an automatic stop action when runtime limit is reached.

Actions:

  • Implement add max runtime timer according to your environment.

Verification:

  • Confirm expected state in Home Assistant and logs.
  • Run a manual test to verify expected behavior.

Common failure and fix: If auto-stop fails: verify timer trigger and entity IDs.

Step 3: Add operating windows

Objective: Restrict operation to approved hours and occupancy conditions.

Actions:

  • Implement add operating windows according to your environment.

Verification:

  • Confirm expected state in Home Assistant and logs.
  • Run a manual test to verify expected behavior.

Common failure and fix: If auto-stop fails: verify timer trigger and entity IDs.

Step 4: Add manual override

Objective: Provide one-tap stop and temporary disable for automation.

Actions:

  • Implement add manual override according to your environment.

Verification:

  • Confirm expected state in Home Assistant and logs.
  • Run a manual test to verify expected behavior.

Common failure and fix: If auto-stop fails: verify timer trigger and entity IDs.

Step 5: Add state notifications

Objective: Notify on start/stop and abnormal extended run.

Actions:

  • Implement add state notifications according to your environment.

Verification:

  • Confirm expected state in Home Assistant and logs.
  • Run a manual test to verify expected behavior.

Common failure and fix: If auto-stop fails: verify timer trigger and entity IDs.

Step 6: Validate and stress test

Objective: Run three cycles and confirm timer stop + manual stop always work.

Actions:

  • Implement validate and stress test according to your environment.

Verification:

  • Confirm expected state in Home Assistant and logs.
  • Run a manual test to verify expected behavior.

Common failure and fix: If auto-stop fails: verify timer trigger and entity IDs.

Validation Checklist

  • Starts and stops reliably.
  • Auto-stop triggers at max runtime.
  • Manual stop works at all times.

Operations and Maintenance

  • Document update cadence for packages and containers.
  • Schedule backup verification.
  • Record service health baselines and alert thresholds.

Troubleshooting and Rollback

  • If auto-stop fails: verify timer trigger and entity IDs.
  • If starts unexpectedly: tighten automation conditions.
  • If commands race: serialize actions and add short delays.

Source Links