Why Isn't a Single Event Enough for a Good Home Assistant Automation?
The basis of an automation is often simple: if something happens, perform an action. In a household, however, events do not always occur in an orderly sequence. A sensor may report repeatedly, a device may be delayed, the user may step in manually, and a connection may even drop.
That is why it is worth designing automation in terms of states and conditions. Who triggers the process? What can prevent it? How does it stop? What happens after a restart? Is there a manual override? The answers are what produce reliable operation.
Example: presence-based lighting
Turning on a light on motion is simple. Turning it off, however, cannot be just a fixed timer if someone may be staying in the room without moving. Here, coordinating presence detection, timing and manual control is crucial. In every case, you need to measure how the given sensor behaves at the actual location.