Homebridge Raspberry Pi

Create an alarm system using Homebridge devices on a Raspberry Pi

It is very important to mention that this is a DIY alarm solution and relies on internet connectivity and constant power to ensure you get remote notifications. You’ll also have to be sure you physically secure your Raspberry Pi so that it is not simply disconnected by evil doers.

  1. Install Homebridge
  2. Configure alarm switches
    • Create a “dummy” switch by installing the dummy switch plugin. This switch will be used to arm the alarm.
      Here’s the config info (See the steps to setup Homebridge at the first link above if you don’t know what to do with this)…

              {
                "accessory": "DummySwitch",
                "name": "Alarm (Arm)",
                "stateful": true
              }
      			
    • Create a dummy “delay switch” by installing the delay switch plugin. This switch should be triggered by your devices used to sense intruders.
      Here’s the config info (See the steps to setup Homebridge at the first link above if you don’t know what to do with this)…

              {
                "accessory": "DelaySwitch",
                "name": "Alarm Pending",
                "disableSensor": false,
                "delay": 30000
              }
      			
  3. The rest is done via the app to create automation rules. I use the Eve app instead of the main Apple Home app because it introduces the concept of conditions instead of just triggers. You’ll need to set a condition to ensure notifications only get set “if” the alarm was armed.

    The delay switch created above will have created both a switch and a virtual motion sensor. Your door sensors, motion sensors, etc. should trigger the Alarm Pending delay switch but only if the Alarm Dummy Switch is on (if the alarm is armed). You’ll have to create an automation rule with that condition in the app.

    Have your sirens, notifications, etc. trigger when the virtual motion sensor sees motion. Set a second automation rule in the app to do this.

    Setup a third automation rule in the app to turn off the alarm when the alarm pending delay switch gets turned “off”.

    When you get home, and enter your house, you’ll want to turn off the delay switch (which will also turn off the alarm using the third rule you setup) before the delay period is finished otherwise the delay switch will auto trigger motion at the virtual motion sensor and cause your siren, notifications to be activated. SECURITY NOTICE: You’ll have to physically protect and use the lock features of your iPhone or other devices to ensure access to the app is restricted… Wouldn’t want an evil doer to be able to simply grab your phone and disarm the alarm.

  4. Worth noting, I installed the http switch plugin to send a notification to an external website which will text/email me. This was easiest for me because I already had an external website that I could create a PHP script on. The http switch is the virtual device that I set to turn on when the virtual motion sensor activates.
    Here’s the config info (See the steps to setup Homebridge at the first link above if you don’t know what to do with this)…

            {
              "accessory": "HTTP-SWITCH",
              "name": "Alarm Notifier",
    
              "switchType": "stateless",
    
              "timeout": 1000,
    
              "onUrl": "http://MyWebsite.com/MyScript.php"
            }