Sonicman began as an experiment with turning my house into a cartoon. No, wait, hear me out. Tinkering around with Home Assistant, I was testing how interoperable all of the different systems running were. Specifically, I wanted "physical" cause to create a "digital" effect, but not just like pushing a button. I wanted the house to sense what was going on, and respond to it.....and since I am me, the way I first did that was adding cartoon sound effects to the bathroom and the hallway.
Essentially the way it worked was, Home Assistant was set up to watch everything I plugged into it. I had a lot of old gear from the Mister House years, plus the newer stuff I was building out at the time in our new home. Things like motion sensors, temp sensors, cameras, pressure sensors, range finders, whatever. I would set them up, have Home Assistant listen for events, and then do...something. I started with automations in Home Assistant yaml (this was long before you could do this stuff in the UI) but eventually found it limiting. To say nothing of the long waits to restart all of Home Assistant each time I made a change. (This was also before you could reload automations without restarting Home Assistant, and it was also before restarting Home Assistant was fast - ugh!). Searching for a solution, I found a project by Andrew Cockburn called Appdaemon.
Appdaemon doesn't require Home Assistant, but it was originally created to run along side of it. Instead of templating out automations in rigid yaml as Home Assistant desires, I now had the freedom to access all of the data Home Assistant had, but with the versatility of Python. Further, I could reload my scripts without restarting Home Assistant. This dramatically accelerated development time.
Getting back to the bathroom and hallway - created a listener for a few entities (in this case, the hallway motion sensor and the bathroom light+motion sensor), and tied them to sound effects. When you walked through the hallway, the system would play an mp3 on a small speaker in the hallway. The sound it played was pulled from a list of cartoon sound effects I sourced for the purpose. (Think things like the common skidding sound or the Mario Jump). When you went into the bathroom, it would do the same. I started here with an array that contained sounds like waterfalls, babbling brooks, and faucet sounds. Because, you know...
These additions were met with some mild amusement and eye rolls from my housemates, which I took as a sure sign to continue.
A few weeks later, the coffee maker percolated again, despite being an auto-drip. When the door was unlocked, you could hear it in the living room. The bathroom made rude noises when the light turned off. I added belches which would play in the kitchen if someone walked in around dinner time. In lieu of a doorbell, when the motion sensor by our porch triggered, Sonicman would play a familiar chime in the house.
I eventually added music to our bathrooms, which would serve both to cover the unfortunate native sounds of the room, as well as give you something to listen to while in there. I started with old video game music (NES and SNES era), and just kept adding to it. First old TV theme songs, then newer game music my kids would recognize, then the entire soundtrack of Smash Ultimate, movie soundtracks, and game remixes. Today there are over 3600 different songs in Sonicman's repertoire.
Each family member has Entrance Music that plays throughout the house when they returned home. I had it trigger when their phones connected to the house wifi (Sonicman looked for what devices were on the LAN), so it usually started playing before they entered the house, which made for a nice effect.
I also included an easteregg mode, which had about a 1 in 10,000 chance of triggering. If would play things like a certain fellow ginger's hit song, the sadtrombone (delayed just enough to give you time to make it to the toilet before it played), the Intermission Song from Monty Python's Holy Grail, the 'Opps' sound from the Price is Right, and a few others - just to change it up a bit.
After a conversation with my family one day in 2020, I realized that somehow I had failed to expose them properly to the glory of Metal. As such, February of 2021 became Metal Month \m/, and I added heavy metal covers of virtually every track in Sonicman's library which it would play instead.
It wasn't all just for fun, there were some really useful features as well. The Metal Gear Alert! sound would play in our bedroom, for example, if there was motion in the hallway outside our door after bedtime. For awhile I had sensors in each of our houseplant pots. When they needed to be watered, the speakers next to them would politely cough throughout the day until you fixed it.
So what is with the name? Well, when I made it, Sonicman was part of a series of scripts I was working on. Each one was named in the style of a Mega Man Robot. There were nine in all (classic), and of course it couldn't be Mega Man without Dr. Light:
- Sonicman - played sound effects.
- Gossipman - used TTS voices on house speakers.
- Doorman - which handled the door locks and security system.
- Fireman - talked to our smoke detectors.
- Pushman - responsible for sending push notifications to my phone.
- Triggerman - an "If/Then" engine for responding to state changes around the house.
- Chronoman - a time based scheduler, for triggering events on schedules.
- Darkman - adjusted the day/night modes on my security cameras based on illumination in the room.
- Growman - monitered all of our plant sensors and notified other scripts when action was needed.
- Dr. Light - Controlled all of the lighting in the house.
All of the above scripts have been retired and their functions moved into Home Assistant proper. As HA's capabilities improved, I found myself leaning on Appdaemon less. Today, almost all of the functionality I depended on Appdaemon for is available in Home Assistant itself.
All in all, this made the house feel much more alive. You really noticed if Sonicman wasn't running for some reason, or when Home Assistant was down.
Member discussion: