# Automation Examples

# Automation Examples

**Create simple, reliable automations with Everything Presence One in Home Assistant.**

## Prerequisites

* EP1 added to Home Assistant and entities available (see [Home Assistant Entities Overview](/doc/b5e0e5b8-82ab-488f-856f-ce5fa1643637))
* At least one light or scene controllable in Home Assistant

## Automation Basics

* **Trigger**: when something happens (e.g., Occupancy turns on)
* **Condition** (optional): only at certain times or if a device is off
* **Action**: what to do (e.g., turn on a light)

## Example 1: Turn on a light when room is occupied


1. Go to **Settings → Automations & Scenes → Create Automation**
2. Click **Add Trigger** → **State**
3. Select your EP1 **Occupancy** entity
4. Set **To**: `on`
5. (Optional) Add a **Condition** → **Sun** → **After sunset**
6. Click **Add Action** → **Device** → Select your light → **Turn on**
7. Save the automation

## Example 2: Turn off the light when room is clear


1. Create a new automation
2. **Trigger**: State → EP1 Occupancy → **To**: `off` → **For**: 2 minutes
3. (Optional) **Condition**: State → Your light → is `on`
4. **Action**: Turn off the same light


:::tip
Start with a 2-5 minute delay ("For" duration) to avoid lights turning off when people are sitting still. Adjust based on your needs.

:::

## Example 3: Presence-based climate control

Turn off heating/cooling when room is empty:


1. **Trigger**: State → EP1 Occupancy → **To**: `off` → **For**: 10 minutes
2. **Action**: Climate → Set HVAC mode → Off (or set to away temperature)

Create a second automation to restore when occupied:


1. **Trigger**: State → EP1 Occupancy → **To**: `on`
2. **Action**: Climate → Set HVAC mode → Heat/Cool

## Example 4: Notification when room occupied (security)


1. **Trigger**: State → EP1 Occupancy → **To**: `on`
2. **Condition**: Time → After 11:00 PM, Before 6:00 AM
3. **Action**: Send notification to your phone

## Verify Your Automation

* Walk in front of the EP1 and watch the automation run
* Check **Settings → Automations → [Your Automation] → Traces** if it didn't fire
* Verify the entity name matches exactly (check in Developer Tools → States)

## Troubleshooting

| Symptom | Likely Cause | Fix |
|---------|--------------|-----|
| Automation never triggers | Wrong entity or state | Confirm entity ID matches your device name |
| Lights turn off too quickly | No delay or short timeout | Increase the "For" duration (try 2-5 minutes) |
| Automation triggers randomly | False positives from sensor | See [How to Tune Your EP1 Sensor](/doc/c35cc882-bdcb-4c4d-b665-6394255673ab) |


---

## Next Steps

* [Home Assistant Entities Overview](/doc/b5e0e5b8-82ab-488f-856f-ce5fa1643637) - All available sensors and controls
* [How to Tune Your EP1 Sensor](/doc/c35cc882-bdcb-4c4d-b665-6394255673ab) - Optimize detection for your room
* [Troubleshooting](/doc/4f786924-2ca6-4c7b-99e0-5c31478d6909) - Common issues and solutions

---

**Documents**

- [EP1 vs EPL: Which Sensor is Right for You?](https://docs.everythingsmart.io/s/products/doc/ep1-vs-epl-which-sensor-is-right-for-you-5B3RxiY3Kp)
- [Everything Presence One (EP1)](https://docs.everythingsmart.io/s/products/doc/everything-presence-one-ep1-3R178yZSUP)
- [Everything Presence Pro](https://docs.everythingsmart.io/s/products/doc/everything-presence-pro-nh3fIXmow9)
- [Everything Presence Lite (EPL)](https://docs.everythingsmart.io/s/products/doc/everything-presence-lite-epl-ZVnBzYzuX2)
- [Zone Configurator](https://docs.everythingsmart.io/s/products/doc/zone-configurator-93b9scGsa2)
- [Knowledge Base Articles](https://docs.everythingsmart.io/s/products/doc/knowledge-base-articles-KnRRmk4zvt)