A few days ago I was reading a post about this dude using Slack to keep his family connected, so I decided to give it go. The interesting part was the integrations that Slack allows. However, in the article, there was not much of interest in that regard.
As a weekend project I decided to explore node.js a little more and yesterday I started playing with a few libraries, just to see what I was going to get done in a couple of days.
In the last few months, I have bought a few nice elements for my house. I have a Philips Hue system which covers almost all the apartment with five light bulbs and an LED strip. I also have a Sonos system. Both of these systems have APIs to control them, so I have always wanted to dedicate some time in exploring the possibilities they offered.
Putting together Slack APIs, Hue APIs, Sonos APIs, and a Raspberry Pi I had in a drawer, I came up with TopoBot 🐭, a Slackbot that controls lights and music in my home.
I’ll take some time in the following weeks to better explain the different parts of the project. Today I’m just telling you what it’s currently capable of:
- It logs into my personal Slack team and says “good morning”.
- It replies to “YO” messages.
- It turns on the light on the table when someone requests a dinner scene.
- If someone goes to sleep it turns all the lights to orange, it dims them down, then turns on a relaxing music, and after a few minutes starts fading down the lights, very slowly simulating a sunset. Until the music ends and it goes fully dark.
There are other ideas in the roadmap:
- Morning alarms, combining lights and music.
- House fencing using Bluetooth discoverability (of my Apple watch for instance).
- Support for other devices, like webcams, movement sensors, Nest, etc.
The code will need some refactoring and it’s very raw, but it works. It’s GPL, of course, and it’s on Github. Happy forking!