About 18 months ago I shared some insight into some home automation I’d added that turned the whole house into a gaming zone. This has been pretty useful during the recent covid lockdown and provided much entertainment for the family. This post is to explain how it works.

Game objective

Find and defuse the bomb without getting spotted. A baddie has hidden a bomb somewhere around the house, the bomb disposal team have been sent in to locate and defuse it - without activating any of the movement or contact sensors around the house.

Each room has a sensor - so you need to be a ninja to get in and out of a room without activating any. Check each room until you find the bomb, use the special disarm key to disable the bomb and end the game. If you trigger a sensor, you will be alerted by an alarm and flashing lights - you’ve failed your objective.

How it works

Motion sensors

The game is designed on the SmartThings platform, using multiple motion sensors that are registered as devices for each room. Our house had an existing hard-wired alarm installation, adding a Konnected Alarm Interface Panel, exposes each PIR onto the SmartThings platform as a motion sensor device.

Existing hard-wired PIRs become a SmartThings motion sensor. Allowing you to create automations based off any detected movement.

SmartThings Groovy app

I then wrote a custom SmartThings app which detects any motion or contact sensor changes. If movement is detected or a contact sensor state changes, the app will simultaneously flash multiple Philips Hue bulbs around the home to a pre-set colour. In addition, it invokes an Azure Function to playback a given audio track (full source available here). The app is fully customisable so you can easily change the in-game settings - such as which sensors to use, audio track, volume, light colours etc.

Playing music

An important part of the game ambience and to provide feedback is playing music whenever a motion sensor has been triggered. This is controlled using an Azure Function to call the Spotify API (full source available here) to play a given track from a selected playlist. The function allows you to seek to a specific position in a track, and to set playback duration. Allowing you to playback a sample from any given song. Currently I’m using Run by AWOLNATION, recently popular on TikTok. Another nice feature is the ability to select which Spotify connected audio device to use, allowing me to use the otherwise defunct Harmon Kardon Invoke 😀.

Arming/Disarming the bomb

The SmartThings platform allows you to create different “modes” for your house automation such as Home/Away/Night etc. Most normal people add additional modes for Movies etc, I geeked out on this and created a Game mode. Which allows my groovy app to only trigger if the relevant mode is active. I’ve also created a SmartThings scene called Game mode, so to start the game, I can simply ask Alexa - “Turn on Game mode”. Which will immediately activate all of the motion sensors around the house ready for action.

Creating the “bomb” out of an old cardboard box, a repurposed light gun and a SmartThings multi-purpose sensor.

The multi-purpose sensor allows the contact sensor’s magnetic piece to be removed, and thus becomes the “denotation disarm key”. The rest of the sensor is embedded in the bomb.

When the magnet is added, it disarms the bomb (closes the connection) by changing the game mode back to the default (home) - using this simple SmartThings Automation:

To start over, hide the bomb, then put the house back into Game mode.