Summary
In many common automations, the user must manually define triggers and define conditions that describe the exact same state change.
This leads to duplicated logic and unnecessary complexity.
I propose a new feature:
Automatically infer triggers from conditions, so that an automation can be written using only conditions, and Home Assistant determines when the conditions become true and executes the actions.
Problem Description
Currently, Home Assistant requires explicitly defined trigger blocks in automations.
However, in many real-world cases, the necessary trigger is already implicitly defined by the conditions.
Example:
triggers:
- platform: state
entity_id: switch.bathroom_light
from: "off"
to: "on"
- platform: time
at: "21:00:00"
conditions:
- condition: time
after: "21:00:00"
before: "05:30:00"
Both the trigger and the condition express the same logic:
- The light becomes on
- Or the time becomes 21:00
- And the action should run only between 21:00 and 05:30
This duplication is error-prone and makes simple automations more complicated than necessary.
Proposed solution
Allow automations without explicit triggers
A user could define:
conditions:
- condition: state
entity_id: switch.bathroom_light
state: "on"
- condition: time
after: "21:00:00"
before: "05:30:00"
actions:
- service: switch.turn_off
target:
entity_id: switch.bathroom_light
Home Assistant should then automatically:
- Determine which state or time changes could make the conditions become true
- Register the necessary triggers internally (state, time, sun, numeric_state, etc.)
- Execute the automation when the condition set becomes satisfied
The user only writes the logic once.
Note: writing a lengthy trigger template is not the same, as it is not selectable in the UI and less maintainable.
Benefits
-
Eliminates duplicate logic
-
Makes automations significantly easier for beginners
-
Reduces mistakes from mismatched triggers and conditions
-
Conditions become the single source of truth
-
More powerful, high-level logic without extra YAML
Example Use Case
“Turn off the guest bathroom light 5 minutes after it was turned on, but only during the night.”
Today this requires multiple triggers and redundant conditions.
With this feature, the user writes only the actual logic:
conditions:
- condition: state
entity_id: switch.guest_bathroom
state: "on"
- condition: time
after: "21:00:00"
before: "05:30:00"
actions:
- delay: "00:05:00"
- service: switch.turn_off
target:
entity_id: switch.guest_bathroom
No manual triggers required, as they can be derived from the condition.