Triggers:
- Motion alarm turned on → FP2 motion detected.
- Motion alarm turned off → FP2 motion stopped.
- Zone became occupied → FP2 detects someone in the living room.
- Zone became free → FP2 sees no one anymore.
- Timer Living Room reaches 0 → Long countdown ended.
- Timer Living Room² reaches 0 → Short fade-out countdown ended.
Conditions (green blocks):
- Temperature > 76°F → decides when to run the ceiling fan.
- Light Turned on = yes → checks whether the living room light was already on.
Actions (blue blocks):
- Fan ON (motion detected + temp > 76°F).
- Fan OFF (motion cleared).
- Light dim to 100% (zone occupied, but only if light is already on).
- Stop both countdown timers (when zone occupied).
- Start Living Room timer (300s) (when zone free, but only if light was on).
- When Living Room timer = 0 → Light dims to 20%, then starts Living Room² timer (20s).
- When Living Room² timer = 0 → Light turns off.
Flow Logic (sequence):
- Person enters room
- Motion detected → If hot (>76°F) → Fan turns ON.
- Zone occupied → If light is on → brighten to 100%.
- Zone occupied → Both timers reset/stopped (so lights don’t shut off while someone’s there).
- Person leaves room
- Zone becomes free → If light is on → start Living Room 300s timer.
- After 5 minutes (300s)
- Light dims to 20%.
- Starts Living Room² 20s timer .
- After 20s
- Light turns off completely.
- Motion alarm off (extra trigger)
- Fan turns off right away (not tied to zone free).
Strengths:
- Fan control based on temp + motion = efficient.
- Dual countdown system → gives smooth transition: On → Dim → Off.
- Timers reset on re-entry → prevents false shutoffs.
- Zone occupancy prioritized over raw motion → more reliable for seated activity.