Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Home Assistant Alarm System: Sensors & Automations Guide

· 7 min read · Home Security

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide walks you through building a DIY alarm system with Home Assistant, using motion sensors, door/window sensors, and automations to trigger sirens, notifications, and lights. You'll learn how to set up the sensors, create alarm modes (home/away), and automate responses—all without a paid monitoring service. Before starting, ensure you have a working Home Assistant installation (on a Raspberry Pi, NUC, or similar) and at least one compatible sensor (Zigbee, Z-Wave, or Wi-Fi).

What You'll Need

  • Home Assistant instance (installed and running, preferably version 2023.1 or later)
  • At least one sensor: door/window contact sensor, motion sensor, or both
  • If using Zigbee: a Zigbee coordinator (e.g., ConBee II, Sonoff Zigbee 3.0 USB dongle) and the ZHA integration
  • If using Z-Wave: a Z-Wave stick (e.g., Aeotec Z-Stick) and the Z-Wave JS integration
  • If using Wi-Fi sensors: ensure they are supported by a Home Assistant integration (e.g., Tuya, Shelly)
  • Optional: a siren or smart plug to control a loud device, and a mobile phone with the Home Assistant app for push notifications

Step-by-Step

  1. Add your sensors to Home Assistant. For Zigbee: go to Settings → Devices & Services → Add Integration → ZHA and follow the pairing instructions (put the coordinator in pairing mode, then trigger the sensor's pairing mode). For Z-Wave: add the Z-Wave JS integration and use the “Add Device” button. For Wi-Fi sensors: install the corresponding integration (e.g., Tuya, Shelly) and follow its setup. After pairing, verify each sensor appears as a device with entities (e.g., binary_sensor.front_door).
  2. Create an alarm control panel entity. Home Assistant has a built-in alarm_control_panel integration. Go to Settings → Devices & Services → Add Integration → Manual Alarm and configure it. Set the “armed home” and “armed away” modes. This gives you a central entity (e.g., alarm_control_panel.manual_alarm) that you can arm/disarm via the UI, automations, or voice assistants.
  3. Define your alarm modes. In the Manual Alarm configuration, you can set delay times (e.g., exit delay 30 seconds, entry delay 15 seconds) and choose which sensors trigger the alarm. For now, leave the trigger list empty—you'll add automations later.
  4. Create a helper for “home/away” status (optional but recommended). Go to Settings → Devices & Services → Helpers → Add Helper → Toggle and name it “House Mode” with options “Home” and “Away”. This will be used to decide which sensors are active.
  5. Build an automation to arm the alarm when you leave. Go to Settings → Automations → Create Automation. Use a device trigger: when your phone's location leaves the home zone (requires the Home Assistant app with location tracking), or when you press a button. Then add an action: alarm_control_panel.alarm_arm_away with the entity ID of your alarm. Set a condition that the alarm is not already armed.
  6. Build an automation to disarm when you return. Create another automation with a trigger: when your phone enters the home zone. Add an action: alarm_control_panel.alarm_disarm. For security, you may want to require a code (set in the Manual Alarm configuration) or use a presence detection that is reliable.
  7. Create automations to react to sensor triggers. For each sensor you want to be part of the alarm, create an automation. Example for a door sensor: Trigger: binary_sensor.front_door changes to on (or open). Condition: alarm_control_panel.manual_alarm is armed_away (or armed_home). Action: alarm_control_panel.alarm_trigger on the alarm entity. Also send a notification to your phone: use the notify.mobile_app_ service with a message like “Front door opened while armed!”
  8. Add a siren or light strobe as a deterrent. If you have a smart siren (e.g., a Zigbee siren) or a smart plug with a loud device, add an automation that turns it on when the alarm triggers. Trigger: alarm_control_panel.manual_alarm state changes to triggered. Action: turn on the siren or plug. Also consider flashing lights: turn on all light bulbs or a specific light group.
  9. Set up a “home” mode for when you're inside. Create an automation that arms the alarm in “home” mode when you're present but sleeping, e.g., at 11 PM. Use a time trigger and a condition that the house mode is “Home”. Arm with alarm_control_panel.alarm_arm_home. This way, motion sensors inside are ignored, but door/window sensors are active.
  10. Test the system thoroughly. Arm the alarm in each mode, then trigger each sensor (open a door, walk past a motion sensor) to verify the alarm triggers and notifications are sent. Check the exit/entry delays work as expected. Adjust delays if needed.
  11. Add a keypad or remote control (optional). You can use the Home Assistant app as a remote, or add a physical keypad (e.g., a Zigbee keypad) that can arm/disarm. For the app, you can add an alarm panel card to your dashboard for quick control.
  12. Set up a backup battery for critical components. If you rely on Wi-Fi sensors or a hub, consider a UPS for the Raspberry Pi or NUC, and battery-powered sensors should have low-battery alerts. Create an automation to notify you when any sensor battery drops below 20%.

Common Mistakes

  • Not adding a condition to sensor automations. Without checking the alarm state, your motion sensor will trigger the alarm even when you're home and the alarm is disarmed. Always add a condition that the alarm is armed.
  • Ignoring exit/entry delays. If you set delays to 0, you'll have no time to leave or enter without triggering the alarm. Set at least 15-30 seconds.
  • Using unreliable presence detection. If your phone's location is inaccurate, the alarm may arm while you're still inside or disarm when you're not home. Use a combination of presence detection (e.g., phone + router presence) and add a manual override.
  • Forgetting to test battery sensors. A dead sensor will not trigger the alarm. Set up low-battery notifications and test sensors monthly.
  • Overcomplicating with too many automations. Start simple; you can always add more later. Too many automations can cause conflicts and make troubleshooting hard.

Tips

  • Use groups for sensors. Create a group of all door/window sensors (e.g., group.doors_windows) so you can reference them in one automation instead of duplicating.
  • Set up a “panic” button. Create a script that triggers the alarm immediately, and add it to your phone's home screen or a physical button (e.g., a smart button).
  • Integrate with cameras. If you have cameras, add an automation to start recording when the alarm triggers, or take a snapshot and send it to your phone.
  • Use the “alarmo” custom integration for advanced features. The built-in Manual Alarm is basic; Alarmo (a popular custom integration) offers more options like multiple codes, per-sensor bypass, and better UI.
  • Keep a logbook. Home Assistant's logbook will show alarm events; use it to review what happened after an incident.

Troubleshooting

  • Sensor not showing up after pairing. Check the device's battery, put the coordinator in pairing mode again, and try re-pairing. For Zigbee, sometimes you need to remove the device first (in ZHA, go to the device and delete it, then re-add).
  • Automation not triggering. Check the trigger and condition logic. Use the “Run” button in the automation editor to test the action. Also check that the sensor entity ID is correct (go to Settings → Devices & Services → Entities to find the exact ID).
  • Alarm triggers immediately after arming. This is usually because a sensor is open or active. Check each sensor's state; if a door is open, close it before arming. You can also add a condition to the sensor automation to ignore if the alarm was just armed (e.g., wait 30 seconds after arming).
  • Notifications not sending. Ensure the mobile app is installed and the device is registered. Test the notification service in the developer tools. Also check that the notification service name is correct (e.g., notify.mobile_app_iphone).
  • Alarm disarms itself. This can happen if you have an automation that disarms on presence detection that is too sensitive. Review your presence automations and add a condition that the alarm is armed.

Frequently Asked Questions

Can I use any sensor with Home Assistant?

Most sensors that work with Zigbee, Z-Wave, or popular Wi-Fi protocols are supported. Check the Home Assistant integrations page for compatibility. Some proprietary sensors (like certain Ring or SimpliSafe) require a hub and may not integrate directly.

Do I need a paid monitoring service?

No, Home Assistant alarm is self-monitored. You get notifications and can trigger sirens, but there is no central station calling the police. You can integrate with services like Noonlight for paid monitoring, but it's optional.

How do I set up a keypad to arm/disarm?

You can add a Zigbee or Z-Wave keypad (e.g., a keypad from a smart home brand) and use its buttons to call services like alarm_control_panel.alarm_arm_away. Alternatively, use a tablet or phone with a dashboard as a virtual keypad.

Can I use the alarm with voice assistants?

Yes, if you have Alexa or Google Home integrated, you can create routines to arm/disarm via voice commands. For example, “Alexa, turn on alarm” can trigger an automation that arms the alarm.

What happens if the internet goes down?

Home Assistant continues to work locally, so your alarm will still function as long as the device running Home Assistant has power. However, remote notifications and cloud-based voice control will not work. Consider a UPS for your Home Assistant hardware.

How do I avoid false alarms with pets?

Use pet-friendly motion sensors (they are less sensitive to small animals) or place sensors at a height that avoids pet detection. In “home” mode, you can disable motion sensors and only rely on door/window sensors.