Skip to content

Software

Fixing a Broken Home Assistant

Like a small child with no sense of fear, my Home Assistant continues to break itself...

In my last post, I had a bit of a rant about how difficult my smart home was being. Since then, I've had a bit of time to recollect my thoughts and started to systematically tackle the issues and pain points I've had. In general, the issues in vague order of how much they annoy me are:

  • Unreliable Smart Plug Connections
    • Reliance on 'The Cloud'
    • Lack of Documentation
    • Alexa Integration
  • Remote Access
    • Access via http://host.name:8123
    • Lack of TLS
    • Lack of External Access
  • Scenes!
    • Automation
    • Sync Computer Brightness/Hue
  • Future Changes
    • Energy and Cost Views
      • Personal Usage
      • Total House Usage
    • Network Isolation
    • Camera (inc. Doorbell) Access
    • Expand to Entire House
    • Get Remote Keybinds on Computer Working Again
    • Auto Off/On Arrive/Leave House
    • Scene Switch Offs Only/Override Options
    • Electric Blanket Switch Off
    • Plex Dim Lights

I won't tackle all of those in this post, I'll just chip away at those I currently find most annoying and easiest to fix.

Installing Old App Versions to Old Android Devices and Planning for Legacy Users

Emoji of ticket and a phone equalling a bomb and head exploding
Not everything needs to be done with a computer. Background image from Unsplash by Jude Mack

Whilst most adults will have a reasonably up-to-date smartphone, the same can't be said for younger siblings or children that are just getting used to the responsibility of carrying a mobile phone, typically being handed down old phones as their parents or siblings upgrade.

One problem with this is that older devices might not support the most up-to-date operating systems and apps needed for things such as bus passes. Unfortunately, the Play Store doesn't provide a mechanism for installing the most recent compatible version of the app to your device, so side loading from unofficial sources becomes the only way to make these apps work on old devices.

In the remainder of this post, I'll explain the issue that made me need to do this in the first place, and provide a tutorial on how you can safely side load apps on to an old Android phone without risking the addition of malware or disabling key security features.

Havoc Ape: Using Chaos Engineering to Build Resilience and Automate Reboots

AI-generated image of a monkey pulling apart power cables in a server room, with sparks flying
Keep your data centre under lock and key, or risk the wrath of the ape... (AI-generated image, Havoc Ape project logo)

In a perfect world, servers would have infinite memory and would never have memory leaks. Unfortunately, this isn't a perfect world, and we've not yet figured out a way around the fundamental laws of physics, so it's quite likely you will have seen something like this if you've been administering Linux servers for a while:

[11686.043641] Out of memory: Kill process 2603 (applicationWithSlowMemoryLeak) score 761 or sacrifice child
[11686.043647] Killed process 2603 (applicationWithSlowMemoryLeak) total-vm:1498536kB, anon-rss:721784kB, file-rss:4228kB

If not, then you're either really lucky, or you haven't dealt with applications that aren't perfect. Linux tries its best to sort this using something called the OOM killer. This is a relatively simple part of the kernel that deals with memory saturation issues to prevent a complete system breakdown. It's well-intentioned, and tries to kill the process that it thinks might have a memory leak, but leaves servers in an unknown state, often killing the wrong daemon and requiring manual intervention to fix.

For the remainder of this blog post, I'll first dive into how we fix issues with the OOM killer in production across our fleet of servers, then a bit about how we make use of chaos engineering in production to reduce outages and build resilience in our systems.

Serving Plex Clients from a Raspberry Pi

Plex logo, a plus, and Raspberry Pi logo on a blurry background which is the plex home dashboard.
Running a home media server has never been easier!

Plex is the gold standard for a home-hosted media server, allowing you to stream your home movies or (legally) ripped media from any television, computer, or phone either at home or when out and about.

Plex is widely run across many homelabs, as it is easy to setup, and unlike some other projects actually provides good value to the end user. In the remainder of this post, I'll break down how I have my Plex server set up for 24/7 access on a Raspberry Pi.

The Case for a Local Smart Home

Home assistant logo and a selection of local network addresses
Use Home Assistant and keep your smart devices local!

I like to think that I'm quite tech conscious, and that IoT can be a force for good, if installed properly and made easy enough to use. The most important thing, in my opinion, is that the 'smart' devices are just that, and will work reliably not just now, but a few years down the line. They shouldn't be a pain to maintain, or cause problems if the internet dies, or there's a power cut.

Testing SD Card Failure and Storage Reliability

Disclosure: Some of the links below are affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalise a purchase. Learn more.

AI-generated grim reaper trying to take SD card
How long until your storage dies? (AI generated image)

I've been auditing the SD cards I have in use on various devices, including the data on them, and whether they are still reliable. I've recently freed up some of these SD cards for use in other projects, as I move to network booting my Raspberry Pis. Some of these SD cards are completely dead, I think because they have had lots of small writes, for things such as databases, which cause lots of stress on the underlying flash, and eventually cause it to fail. One example I can think of is a previous Pi running my Home Assistant, which randomly died one day and had lots of database activity.