I’ve written previously that I think there are too many programming languages.
I’ll expand that. There’s too much technology. Try something new and it’s easy to end up down a rabbit hole of different options, things to install, configuration files to understand and all the other stuff that comes with doing something new on a server.
If you’re thinking I must have fallen foul of this confusion recently, you’d be right…
I stumbed across Home Assistant, an open source hub for smart devices and home automations. It looked like it might do what I’ve being doing with my home ESB but with a wealth of devices already supported. It’s also got a nice modern material design UI. Worth a closer look…
It’s written in Python. Python 3 to be precise, and I run CentOS which comes with Python2. And so it begins… this is how it went.
I’ve been seeing a few things lately that are clearly developed on Ubuntu and assume you have a Ubuntu machine. Not just home assistant – getting the H264 branch of Zoneminder installed would be easier if I ran Ubuntu and I’ve found other examples.
Consider switching to Ubuntu. Eventually decide not to as I’m more familiar with CentOS and just have a gut feel that I prefer the Redhat/CentOS way of doing things.
So back to Python3. Looks like I might have to compile from source… oh, wait, there’s something called “Software Collections” for this sort of thing. Lucky I stumbled across that, should save time… better figure out how that works.
But wait… Home Assistant is available as a docker image. Should I use Docker? What are the pros and cons. Digression two – read up on Docker and decide if that’s a technology I want to try. Decide against – there seem to be issues. Or not, depending on who you believe, but I want to keep things simple and stable.
So, Python3 installed. Better set up a virtual environment for it. Pause to refresh my memory on Python virtual environments and the pip package installer. Right. It’s running.
Now to configure it. It uses YAML. OK, looks easy enough,
It has SmartThings integration if you install a custom device and a SmartApp. Back to Groovy and SmartThings. Been a few months, so a bit rusty on where everything is. OK. Now what do I need on the Home Assistant side?
An MQTT broker. A what? Read up on that. Ah, there are choices. More decisions. Again, it all comes prepackaged using Docker. Briefly revisit that decision… no, I don’t want to use Docker.
One of the options uses node.js. Another technology, another package manager…
And I want all this stuff to start on boot, so now I have to set up all the systemd stuff necessary to make that work. Including starting up the software collection environment for the Python3 stuff.
Of course I’ll want to access Home Assistant from outside my network and I want to use Apache as a proxy to handle the SSL and redirect to the HA port.
Oh. It’s not going to play well with my other stuff. Everything’s under directory locations so I don’t have to mess about with subdomains and virtual hosts, but HA wants to take over the root web directory and doesn’t take kindly to attempts to get it running in a subdirectory.
Take a look at the code. Find the web root hardcoded all over the place. Give up and get a second dynamic DNS hostname so I can use virtual hosts. Spend best part of an afternoon trying to get everything working in two separate virtual hosts. Get there in the end, sort of. Zoneminder is still available to both, but I want to access it on the local IP internally as well as the first dynamic DNS name so I’ll either have to duplicate the config or accept it’s on both external addresses. For now. There’s probably a way round it – maybe just a rewrite rule to push it to the right host.
It’s at this point I start wondering whether it would be easier just to continue doing my own thing and using my ESB with a DIY front end in Django…in Random Musings