Conditional Gates

Virtual "circuit breakers" for your flows that act as advanced latches.

What are Conditional Gates?

Conditional Gates are virtual logic gates (Go / No Go circuits) that exist purely in memory. They allow you to pause flows until a specific "Gate" is opened (set to GO).

Think of them as a traffic light for your flows:

⏱️ Waiting longer than 55 seconds

Homey stops every app Flow card after 60 seconds. A card that is still waiting at that point fails with Timeout after 60000ms, no matter which timeout you configured.

Flow Cards

Conditional Gate (Wait for GO)

Type: CONDITION

Pauses the flow until the specified gate becomes GO.

Parameters:

  • Default State: The initial state if this gate hasn't been used before (usually NO GO).
  • Timeout: How long to wait for the gate to open. (Set to 0 for instant check without waiting). The card waits at most 55 seconds - see below.
  • Gate Name / ID: The unique name of your circuit (e.g., "KitchenMode", "NightLatch").
Note: Gates persist in memory! If you set "Default: GO", the gate will remain GO until you explicitly close it using the Modify card. The "Default" setting only applies the very first time the gate is created.
60-second limit: If the gate is still NO GO after 55 seconds, the card stops with the error "Homey stops app Flow cards after 60 seconds. For waits longer than 55 seconds, use "Start waiting for Conditional Gate GO" together with the "Conditional Gate wait finished" trigger." Timeouts of 55 seconds or less behave as before (NO path when the timeout expires).

Start waiting for Conditional Gate GO

Type: ACTION

Starts a background wait for the gate and lets the flow continue immediately. When the gate becomes GO or the timeout expires, the Conditional Gate wait finished trigger fires. Use this for anything longer than 55 seconds.

Parameters:

  • Gate Name / ID: The gate to wait for.
  • Default State: The initial state if this gate hasn't been used before.
  • Timeout: Seconds, minutes or hours (maximum 24 hours). 0 = wait until GO without a timeout; such a wait is ended as TIMEOUT after 24 hours.

Behaviour:

  • Gate already GO → the trigger fires right away (result GO).
  • Starting again for the same gate while a background wait is pending restarts it (new timeout from now). The replaced wait does not fire the trigger.
  • Modify Conditional Gate works exactly as for in-card waits: GO/Toggle releases the wait, and a new timeout replaces the pending one.
  • The background wait has the waiter ID gate_<name>_background (e.g. gate_Razor_background) and can be enabled, disabled or stopped with Control waiter gate. Stopping it never fires the trigger.

Conditional Gate wait finished

Type: TRIGGER

Fires when a wait started with Start waiting for Conditional Gate GO for the selected gate ends.

Parameters:

  • Gate Name / ID: The gate (matched exactly).

Tags:

  • Gate opened (GO): Yes/No - true if the gate became GO.
  • Result (GO/TIMEOUT): Text - GO or TIMEOUT.
  • Waited (seconds): Number - how long the background wait ran.

Check Gate State

Type: CONDITION

Instantly checks if a gate is currently GO or NO GO without waiting.

Parameters:

  • Gate Name / ID: Select the gate to check.
  • State: The state to check for (GO or NO GO).
Use case: Use this card when you need to branch your flow based on current gate state without waiting. Perfect for "if gate is open, do X, otherwise do Y" scenarios.

Modify Conditional Gate

Type: ACTION

Changes the state of a gate (Open/Close) or updates the timeout of active waiters (in-card and background waits).

Parameters:

  • Gate Name / ID: Select the gate to modify.
  • New State: Set to GO (releases waiting flows and background waits), NO GO (stops future flows), Toggle, or Don't change.
  • New Timeout: Update the timeout for currently waiting flows and background waits (counted from now, maximum 24 hours). Set to -1 to leave unchanged.

Output Tag:

  • Gate State (GO): Boolean - true if the gate is GO after the action, false if NO GO.
Tip: To read the current gate state without changing it, use "Don't change" for New State and -1 for New Timeout. The output tag will give you the current state.

Examples

1. Manual Approval (The "Ask Permission" Flow)

Trigger a flow, but wait up to an hour for manual confirmation (e.g., via a button or app) before proceeding. An hour is far beyond Homey's 60-second card limit, so this uses a background wait.

Flow 1: The Request

WHEN: Washing Machine finished
THEN: Start waiting for Conditional Gate GO "EmptyWasher" (Default: NO GO, Timeout: 1 hour)

Flow 2: The Approval

WHEN: Virtual Button "Washer Emptied" pressed
THEN: Modify Conditional Gate "EmptyWasher" -> Set to GO

Flow 3: The Result

WHEN: Conditional Gate wait finished "EmptyWasher"
THEN: Modify Conditional Gate "EmptyWasher" -> Set to NO GO (Reset for next time)
THEN: Send push notification "Washer: [Result]"   (GO = emptied, TIMEOUT = still waiting after 1 hour)

2. Turn something off after 2 minutes (Advanced Flow)

A common pattern: when the razor is turned on, turn it off again after 2 minutes - or earlier if something opens the gate. A Wait for GO condition with a 2 minute timeout fails after 60 seconds (Timeout after 60000ms), because Homey stops app Flow cards after one minute. Split it into a start card and a trigger instead. In an Advanced Flow both parts can live on the same canvas:

WHEN: Razor turned on
THEN: Modify Conditional Gate "Razor" -> Set to NO GO   (re-arm the gate)
THEN: Start waiting for Conditional Gate GO "Razor" (Default: NO GO, Timeout: 2 minutes)

WHEN: Conditional Gate wait finished "Razor"
THEN: Turn off Razor

WHEN: <whatever should end the wait early>
THEN: Modify Conditional Gate "Razor" -> Set to GO
  • If the razor is turned on again while the wait is running, the start card restarts the 2 minute countdown; the replaced wait does not fire the trigger.
  • Use the Result tag (GO / TIMEOUT) or Gate opened (GO) tag if the two outcomes need different actions.
  • Modify Conditional Gate with a new timeout (e.g. 1 second) shortens a running background wait, exactly like it does for in-card waits.

3. "Latch" Logic

Prevent a flow from running until a specific condition (Latch) is set, and queue up requests.

WHEN: Motion Detected
AND: Conditional Gate "NightModeLatch" (Default: NO GO, Timeout: 0)
THEN: Turn on hallway lights dimly

Here, Timeout 0 acts as a filter. If "NightModeLatch" is NO GO, the flow stops immediately. If it is GO, lights turn on.

⚠️ Known Limitations