[Blueprint Pack] Aqara Mega Blueprint Pack: Locks, Contact Sensors & Presence

Disclaimer
Blueprints aren’t exclusive to Aqara brand locks & sensors, they work with any smart lock, contact sensor, and or presence sensor with correct devices classes in home assistant. This mega pack is designed to get a novice up and running quickly with ease. Inspiration to make this was having to reset my entire home assistant server several times and the pain of remaking the basic automation over and over again. Highly recommend you flagged this and keep it handy. I’m also welcome to user improving this so all can benefit.


Quick import

Contact Sensors
For Windows & Doors Without Smart Locks

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.


Locks
For Doors With Smart Locks

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.


Locks & Contact Sensors
For Doors With Both Smart Locks & Contact Sensors

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.


Presence Sensors
General Purpose For Presence/Motion Based Automations

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.


Preview

Locks

1) Locks

  • Auto-lock after the door reports closed (delay slider) with “re-open” cancellation and final re-check.
  • Announcements for LOCKED/UNLOCKED (lock)—only after confirmed state changes.
  • Optional reminders while door lock UNLOCKED, repeating every X seconds until resolved.
  • Speech is queued (no overlap), with a small TTS pre-roll to prevent clipped words.

Mode: queued (max 2) — prevents overlapping TTS when multiple messages fire.


Locks & Contact Sensors

2) Locks & Contact Sensors

  • Auto-lock after the door reports closed (delay slider) with “re-open” cancellation and final re-check.
  • Announcements for OPENED/CLOSED (sensor) and LOCKED/UNLOCKED (lock)—only after confirmed state changes.
  • Optional reminders while door OPEN or lock UNLOCKED, repeating every X seconds until resolved.
  • Optional action on OPEN: turn on chosen lights/switches.
  • Speech is queued (no overlap), with a small TTS pre-roll to prevent clipped words.

Mode: queued (max 2) — prevents overlapping TTS when multiple messages fire.


Contact Sensors

3) Contact Sensors

  • OPENED/CLOSED announcements using the entity’s Area name for natural phrases.
  • Optional “still open” reminder every X seconds until the sensor closes.
  • Optional action on OPEN: turn on selected lights/switches.
  • Clean queueing and TTS pre-roll for reliable, non-clipped speech.

Mode: queued (max 2).


Presence Sensors

4) Presence Sensors)

  • Announces “Presence detected in .” and “ cleared.”
  • Optional mobile notifications to selected Home Assistant Companion App devices.
  • Device control: turn ON after presence holds X seconds; turn OFF after clear holds Y seconds (0 = instant).
  • TTS pre-roll for clean speech; actions are fast, holds configurable.

Mode: restart — the newest presence state wins immediately.


Why these blueprints?

Why these blueprints?

  • Snappy & dependable: Guarded flows (re-open cancels auto-lock, final checks, optional stability windows).
  • Natural speech: All phrasing is Area-aware (e.g., “Bedroom door was closed.” / “Presence detected in Hallway.”).
  • TTS that doesn’t clip: Optional pre-roll (150–200 ms typical).
  • Engine-agnostic speech: Works with standard tts.speak. If your engine supports options.voice (e.g., Piper, Edge TTS, Polly), a voice can be used; engines like Google Translate are called without unsupported options—no errors.
  • Zero overlap: mode: queued (locks/sensors) ensures messages play in order; presence uses restart for urgency.

Setup (quick start)

Setup (quick start)

Contact Sensors / Locks & Contact Sensors

  1. Pick your contact sensor (ON = open, OFF = closed).
  2. For the combo blueprint, also pick your lock.
  3. Enable Speak announcements, choose your TTS engine (e.g., tts.piper, tts.google_translate_*) and speakers.
  4. Tune Auto-lock delay; optionally set a closed stability window.
  5. (Optional) Enable reminders and choose interval; set actions on OPEN if you want lights to turn on.

Presence Sensors

  1. Select the presence/occupancy sensor.
  2. (Optional) Enable Speak presence announcements (+ TTS + speakers).
  3. (Optional) Enable mobile notifications and pick your Companion App devices.
  4. (Optional) Choose turn ON/OFF entities and hold timers (0–10 s).

Tip: Assign your devices to Areas (Settings → Areas). The Area name is used in all default speech.


Options & defaults (highlights)

Options & defaults (highlights)

  • Auto-lock delay: 0–60 s (typical 8–15 s).
  • Closed stability window: 0–10 s (default 2 s) to filter sensor bounce.
  • Reminder interval: 15–120 s (default 30 s).
  • TTS pre-roll: 0–300 ms (default 150 ms).

Compatibility notes

Compatibility notes

  • Works with Aqara and standard HA entities:
    • binary_sensor (device classes: door/opening/window, occupancy/motion)
    • lock
    • media_player (for TTS)
  • TTS engines tested include Piper and Google Translate. If an engine doesn’t support a voice option, the call is sent without it—no errors.

Feedback / Issues

If anything’s unclear or you’ve got ideas for improvements (extra guards, additional TTS engines, presence zones), drop a comment. Enjoy!

3 Likes

Aqara Mega Blueprint Pack — now even more mega :rocket:

New: a dedicated Lock-Only blueprint joins the pack! Plus crisp TTS, smarter reminders, faster device control, and UI polish across the board.

PLEASE RE-IMPORT ALL BLUEPRINTS, THO THEY WERE NICE BEFORE I REMOVED ALL ERRORS AND THEY ARE NOW FANTASTIC!


What’s new tonight

  • :new: Blueprint: Aqara: Locks (time-based auto-lock, no sensor required)
  • :loud_sound: TTS Volume control added (per-message) to all relevant blueprints
  • :speaking_head: Cleaner announcements: only say what matters, no clipped words
  • :brain: Reminders that stop immediately when conditions resolve
  • :zap: Snappier actions (turn on/off) with minimal delay
  • :soap: Lots of YAML/validation fixes to squash “Message malformed” errors

Per-blueprint changelog

:closed_lock_with_key: Aqara: Locks & Contact Sensors

  • Improved auto-lock reliability: waits exactly your delay and cancels if the door re-opens during that window.
  • Announcements split: choose Sensor OPEN/CLOSE and/or Lock LOCKED/UNLOCKED (no “locking/unlocking/jammed” chatter).
  • TTS polish: pre-roll to avoid clipping + per-message volume control.
  • Reminders (optional): repeat while OPEN and/or while UNLOCKED at your interval; stop the instant the state is resolved.
  • Optional actions: turn on when door opens; turn off when door closes; turn on when lock unlocks; turn off when lock locks.
  • UI cleanup: “Bedroom/Hallway” merged to Standard for simpler, natural phrasing.

:window: Aqara: Contact Sensors

  • Turn OFF on close (new) to pair with the existing “turn ON on open”.
  • Added TTS volume control; OPEN/CLOSE TTS uses area-based phrasing with pre-roll.
  • Open reminder repeats at your interval and stops instantly on close.
  • Inputs clarified; retains queued mode (max 2) for neat audio sequencing.

:bust_in_silhouette: Aqara: Presence Sensors

  • TTS volume control added; presence announcements use area-based phrasing (“Presence detected in …” / “… cleared.”).
  • Per-direction holds: wait X seconds before ON; wait Y seconds before OFF.
  • Faster device control (turn on/off) with restart semantics so newest state wins.
  • Mobile notifications fixed: sends via each device’s notify.mobile_app_* service (removed invalid notify.notify target usage).
  • Still cleanly supports Piper/Edge TTS/etc. voice options when available.

:lock: Aqara: Locks (NEW)

  • Time-based auto-lock (works without a contact sensor).
  • Announcements for LOCKED/UNLOCKED only (no transitional spam).
  • TTS volume control + pre-roll for clear speech.
  • Optional actions on lock state: turn on when UNLOCKED, turn off when LOCKED.
  • Matches the UI/logic style of the pack for a seamless experience.


oh and be sure to setup tts section even if you don’t want announcements and just toggle off annoucements else blueprint wont work.

Not trying to rude or anything, but why then have Aqara branding all over your Blueprints? It might put people off who read the heading and not the above quoted fine print. People might not even click the thread.

That’s a fair point actually. Although, I initially only looked at the thread because it had Aqara in the title and I own some Aqara sensors, I realised from the Blueprint descriptions that they would be universal.

:grin: I own Aqara stuff, adding Aqara to the name would make people peak in i feel. But fine ill change it to what it truly is some time in the future “Starter Pack” or something like that. Give it a try regardless.

I’ll be giving them a try, for sure.

1 Like

Door & Locks

Not sure if anyone caught this but if you have Reminders set to unlocked in the Aqara: Doors & Locks Blueprint the lock never auto locks which was an unintentional yet smart feature. You don’t need a reminder to lock a door that locks it self, however i still plan to change this because i didn’t code it with the intention for it to behave this way but the blueprint runs makes it behave that way:

Why it happens (exactly):

  • The unlocked reminder starts on the lock_changed → unlocked trigger and then runs a repeat while the lock is unlocked (it waits, speaks, waits, speaks…).
  • The automation is in mode: queued. A run that’s doing the reminder loop never finishes until the lock becomes locked.
  • When you close the door, the sensor_closed branch (the one that calls lock.lock after the delay) starts a new run but because we’re in queued mode, that run waits behind the still-running reminder loop.
  • Result: the auto-lock call never executes until you manually lock (which ends the reminder run). So it looks like auto-lock is disabled whenever “unlocked” reminders are on.