Introducing Simple Smarthome System
Some developers like to have side projects that they can work on in their free time. I’m one of them.
I always have some code and electronics lying around, waiting to be finished. This time I wanted to test my skills in backend development and learn a little bit in the process. I have experience with Kotlin, so the obvious choice for me was to try Ktor.
This approach has the benefit of seeing Kotlin in action on other platforms, since Kotlin multi-platform might be a valuable tool in my toolbox. I chose Vue.js for the frontend since I’ve already tried React in the past. Okay, so I’ve got the tools, but what should I work on? The answer came to me when I was not satisfied with existing solutions in the smart home dashboard environment.
What didn’t I like about existing solutions?
- They are hard to configure
- They have too many features
- They are configured through configuration files with little documentation
So I decided to build my own. How hard can it be?
After more than half a year, I present to you the Simple SmartHome System:
It also works on mobile:
What can it do?
- It can show the latest status of devices.
- Group devices into logical groups like rooms or garages.
- Send events back to an MQTT broker.
What is missing?
- A rule engine that can change the state of sensors based on events.
There are a couple of concepts I’ve tried to follow while developing SSS:
- It is based on MQTT. MQTT is a popular standard in the IoT world with a lot of devices already supporting it.
- It should easily integrate with two tools I use: zigbee2mqtt (gateway software that allows you to use proprietary Zigbee devices without proprietary gateways) and Tasmota (open source firmware for devices based on ESP8622 chips).
- Everything should be configurable through a UI.
Please go to Github for installation details and source code.
I’ve learned a couple of things during development. I think I like React more than Vue. The MVVM approach of Vue is nice, but observable variables didn’t always work as expected. Kotlin is a superb technology even on the backend, but Ktor is not opinionated at all, so I needed to figure out a lot of stuff, like which database to use and what is the database connection pool :)
I need to mention the great support I received from Netguru in developing this tool. Not only do I have the opportunity to promote it here and host it on Netguru’s Github, but also great people from the Vue team helped me with this framework. Growing at Netguru is a pleasure :)
Photo by Robin Glauser on Unsplash