How a Chat Bot prevented a burglary

Dennis Mellican
3 min readAug 11, 2020

The Slack bot running on Raspberry Pi’s that secures a smart home.

Watch the CCTV footage of the would be burglar:

In the video, the intruder is sneaking up towards the back of the house and is startled by a barking dog, running away as the lights around the home begin switching on.

He was tricked. There is no dog and no one was switching lights on.

Behind the scenes, a motion sensor on a smart security camera starts the fake dog barking on a wireless speaker, then triggers smart lights to switch on inside the house and finally outside on the deck.

The choice of the barking sound and light sequence was deliberate. A yappy small sounding dog is more convincing on a speaker than a larger breed. A yappy dog seems more annoying too. So-called security lights, seem to only aid burglars as opposed to making them flee. They also figured out there isn’t anybody staking out the backyard to suddenly switch the lights on.

The automation sequence mimics a dog being disturbed and someone moving about inside to investigate the commotion.

Actually, I was home alone at the time of that incident and indeed woken up by the barking sounds. My reaction was far slower than the automation. If you look carefully through the blinds in the footage, I can be seen moving about inside wondering what spooked my fake dog.

Communications between the smart security cameras, wireless speaker and smart lights occur in a chat messaging channel. A troupe of chatbots running on several Raspberry Pi devices coordinate tasks amongst themselves. It could be done on a single Raspberry Pi, but for a mission critical system it should be highly available and fault tolerant.

Apart from the high tech security system, a well placed mat seems to slow down this particular type of burglar, as he wipes his feet before stepping onto the back deck. Perhaps he was suffering anxiety due to bad intentions or has an Obsessive Compulsive Disorder? Maybe he was simply attempting to cover his tracks. An extra mat has been placed on the deck to help slow any future visits.

In addition, another active countermeasure has now been deployed if the alarm is tripped again: a smart sprinkler system.

I feel like Kevin McCallister from Home Alone, with these home security “traps”. I’m still waiting to catch the Wet Bandits for the sequel to this story. So far only stray cats have been caught by the sprinkler. Perhaps the next adventure of the chat bot is to order pizza and Gangster ‘Johnny’ to complete the transaction when the pizza delivery triggers the sensors.

Further reading


The Python code that runs this home security system is on Github: and explored in more detail at Medium: The Traveling Slack Bot Troupe.

Slack for the chat messaging system.


The hardware devices used in the video are listed below. Any device that has an API or Python library could be used instead.

  1. Raspberry Pi.
  2. Arlo Pro security cameras.
  3. TP-Link smart lights.
  4. Chromecast audio connected to speakers.
  5. LinkTap, to control the water sprinkler. Not in the video but now operational.

Sound Bites Fun

The barking dog can be replaced with any sound bite (pun intended). For some entertainment, audio on the footage has been dubbed with what it would be like if Arnold Schwarzenegger yelled at him. There are more sound effects fun in that playlist too. Share your suggestions or creations.