Arm/Disarm Using a Switch

Project Description

In this project I will show you how to arm/disarm an alarm zone using a tactile switch connected to your Raspberry Pi.


Edit the file by typing the following command at the command prompt:
Configure the arm/disarm variables as per figure 3:
Arm Disarm Using a Switch
Set ArmDisarm=True
Set RemoteZoneDescription equal to the description that you configured for the zone you wish to arm/disarm. If you have spaces in the description replace them with %20 (e.g. “My%20House”)
Set ArmPin equal to the pin number (refer Figure 4) to which the the arm button is attached
Set DisarmPin equal to the pin number (refer Figure 4) to which the disarm button is attached
Lastly look for the PrintToScreen variable near the top of and change it to True. This will allow you to test your switches and watch the program send arm/disarm messages to the server as you press the buttons.


Save the file by typing:
  Ctrl-x y ENTER
Run the program from the command line:
  sudo python
Now press the arm button. A message similar to the following will be sent to the server:
Host Update:
Arm Disarm Using a Switch Schematic

Now go to your dashboard at and verify that the zone is armed.

Next press the disarm button. You should see a message similar to the following:
Host Update:
 Now refresh the screen of the dashboard and the zone should be disarmed.
If everything went to plan you are ready to put back into production. Edit the program as you did before using NANO and set the PrintToScreen variable to false. Press Ctrl-x y ENTER to save. If you are using the automated alarm system from this tutorial then reboot your Raspberry Pi by typing sudo reboot, otherwise run the alarm from the command line as
For more detail: Arm/Disarm Using a Switch
Scroll to Top
Scroll to Top
Read previous post:
Boot the Raspberry Pi from USB

Hello world, time for me to gift some raspberry pi to the people. So here's my story, I recently graduated...