Skip to main content

The story of a Hack Job

"So, you have hacked it" -- Few days ago one of the guys at work passed me this comment on a random discussion about something I built. I paused for a moment and pondered:
  • Do I reply defending how that's not a hack.
    OR
  • Do I just not bother
I picked the second option for 2 reasons:
  • It was late.
  • It probably isn't worth defending the "hack vs" topic as the comment passed was out of context.
So I chose the next best action and replied "Yep, sure did and it is working great.". I felt like Batman in the moment.
In this post I will rant about the knowledge gap around hacking and then describe about one of the components of my home automation project (really, this is the main reason for this post) and use that as an example how hacking is cool and does not always mean bad.

But first lets align on my definition of hacking:

People use this term in good and bad, both ways. For example:
  • "He/she did a hack job" -- Yeah, that probably means bad. Let's say that an application was built using a certain framework and someone did not take the time to understand the framework first and put/deployed a code to work around it to make it work and in process creating a lot of code convolution and complexity. That's actually a bad hack which creates tech debts. (I am 90% sure we all have done it and/or at least had come across it and condemn it.)
  • "You hacked it" -- well, this one depends. It can mean good when you did something that extends the functionality than what was shipped with OR could be completely taken out of context because of lack of understanding (like my example above).
The main point is, the term Hack or Hacking is really quite contextual.
Also let me make few things clear here:
  • The way they show in movies that's not how hacking works. Hacking simply does not happen by typing on keyboard really fast. It requires a lot of knowledge, study, research and dedication. EG> If one didn't know how security algorithm, protocol, rolling code etc works inside and out, the individual won't be able to hack a damn thing (FYI, ddos is not considered as a hack). So one needs to put a lot of extra time and effort acquiring those skillsets before she/he promotes to be a hacker. 
  • Hacking applications and causing incidents or inconvenience to a lot of people's life, stealing PII etc is not in any way cool. It's a shameful act and waste of talent.
  • Being an Ethical hacker is cool. If you could let the right person know about the exploited vulnerability then that works in the positive way. Hack to improve life, not to make it difficult. 

Now, lets put things in context, shall we.

Scene 1:
Extending functionality using API layer isn't a bad hacking. In fact that's how (in a over simplified way) Microservices work. I think almost every  software engineer / programmer have done similar at some point in his/her life or is lucky enough to continuously doing it. So calling it a hack in a bad way isn’t contextually correct or fair.

Scene 2: 
My garage door motor only worked with a RF remote and I had to carry the bulky remote on my keyring to open or close the door. So I hacked the RF Remote to make it work such a way that I can open or close the garage door using my Mobile (which I generally carry all the time, who doesn't these days?). Keep it light by not carrying the extra weight. Is this hacking? Well yes it is but in my book this is good hacking and I take pride doing this hack job because:
  1. I could so I did.
  2. It works great !! (don't believe me? read the rest of post and/or watch the demo video).

The moral of the story:

  • Do not label generically that "It is a hack", "You hacked it". There're good hacks and then there are bad ones. Understand the difference and acknowledge before commenting. 
  • Hack to improve, not to destroy. You will only be cool when you use hacking in a positive way.
  • Hacking is really a skill set and a talent. 

The story of a hack job (Garage Door IoT'ed)

Requirement:
I want to open my garage door using mobile phone from anywhere in the world.
Why:
What I have is this:


And this works fine, mostly, typically. But I am beyond typical (because I am Batman).
Here're few problems with the existing problem:
  • I hate carrying keys and the additional attention to take the key on the way out and remember to bring it in one piece on the way in. As I am carrying mobile phone anyway I want to use it as a key and shed the extra weight.
  • Sharing keys is another problem. These RF remotes are expensive and I did not want to buy 1 per user/member of my family. If I could convert keys to an app then I can just add/remove user to the app. Pretty convenient, eh!?
  • The RF Remote only works when I am near by the door. This is a problem. So many times I have driven away few Ks only to turn back to close the door. So I NEED an internet based door control switch so that I can close or open from any where (Like Batman).
  • If I am not home and one my friends shows up they would have to wait outside till I get home (this has happened to me and my poor friend on a rainy day). Having control of the door over internet will help a great deal here. (eg> scenario: Batman remotely opening the door to bat-cave when justice league arrives for pizza & marvel night)   
Unfortunately, all garage door motor typically ships with RF remote that you need to carry to open/close the door.
What really want is this:

So you see there's a problem/gap between what I want to have and what I have now.
Challenges:
I have watched bunch of YouTube videos on how to automate/IoT garage door (actually that's most people's first DYI. For me it is the 2nd. See the first one here: Smart wifi controlled irrigation system). And pretty much all of them involved some form of live wiring and attaching things to the door motor. But I wasn't too comfortable with the live wiring part + all the attachments seems to make a mess up there. So I had to find an alternative approach and get creative about it.

The solution:
After staring at the wall for a weekend I found a way that worked for me. So the alternative approach is *drum roll please* hacking the garage door remote.(It is the first of its kind, I think, at list I have not seen/found this solution on the internet yet).


The garage door remote is a RF Remote which contains a tiny circuit powered by a battery and when a button is pressed to open/close the door it closes/completes the circuit (like a relay). So all I needed to do is to somehow mimic that button press using an IoT device that I could control the IoT switch over internet using my home assistant and the IoT switch will control the button press of the RF Remote.
This way I do not need any live wiring to the garage door motor itself or attach anything to it; in fact, the whole thing can be nicely tucked away in some corner of the house and it will function just fine.

I chose

  • Sonoff SV as relay for it's circuit isolation and ESP8266 based circuit properties. 
  • Tasmota firmware to flash the ESP8266 for its MQTT usability.
So here's what I did:
  • Flashed the sonoff SV with Tasmota firmware so that instruction can be passed on based on MQTT messaging.
  • Isolated the onboard relay from the main circuit controller chips.
  • Made the relay part of the circuit a dry circuit because the RF Remote circuit already has a power source so cannot have another voltage flowing through the relay.
  • Hooked 2 wires from the both side of the push button and attach to the sonoff dry circuit. This way when the relay closes it will complete the circuit in the RF Remote mimic-ing the button press.
  • Finally added a 5V power supply to power the ESP8266 circuit.
  • I programmed in Home Assistant a MQTT switch. Then programmed an automation to trigger when the switch is on and action to turn off after 200ms. This way the MQTT switch will behave like a toggle button.

YouTube:


Photo Gallery:

Sonoff SV

Garage Door Remote

Garage door circuit wired to Sonoff SV

IoT'ed garage door control in a chocolate box

Cost:

Sonoff SV = $8
Garage Door Remote = Free (Spare. If no spare then $15)
Tiny gage wires = $0.10 (for a whole metre)
5V Power adapter = Free (spare, If no spare then $9)

Total: $8 AUD (or worst case $32).
Can you price beat this with any off the shelf?

What's next:

This solution however has one flaw.
The garage door remote works based on toggle (meaning 1 click is close, 1 click is open, 1 click when on movement is pause) and the manual RF remotes are still in function (I have another one in the garage itself).
This creates an issue of keeping track of what state the door is in (open or close or paused half way in the middle). 
So I need some way to determine what is the door state and result of the state after my action.
(I do have a solution in mind, but that's a topic for another day).

Result:

Hacking improved the convenience in my everyday life.
#HackToImproveLife





Comments

Popular posts from this blog

Reimagining Logs: Building AI powered Conversational Observability System

It is mid-2025 and the cogs of AI are at full speed. So we (I and Mobin) decided to do our own AI project. We called it "IntelliLogs".  IntelliLogs at a glance: Demo:  https://www.youtube.com/watch?v=OXMlORwyMQk In this post I will describe why we did what we did, what is it that we did and how we did it. I will share my personal experience. I am hoping this will, at least, be an interesting read. Table of contents: Why IntelliLogs What is IntelliLogs How IntelliLogs was developed Future of IntelliLogs Conclusion References Why IntelliLogs: Personal motivation 💪 to this were: Explore and experience what does an AI app look like from an architectural and engineering perspective Explore the realm of Huge LLMs (eg: GPT-4.1-170B,  Gemini Pro etc) vs small LLMs (eg: granite-7b, gemma-4b) Explore the possibilities of model tuning / making a model without being a data scientist. How easy or hard it is, what tools available etc. We also wanted to tackle a "not too far from ...

Hall of justice - Authorisation Greeting System

Ever since I watched the Young Justice EP-1 the security system of the Hall Of Justice and Mount Justice wow-ed me. After all it was built by Batman. You see similar AI driven voice guided system in pretty much in all sci-fi series these days. I always dreamed of having something similar of my own. Well, now I have it (sort of). Although we not quite in the flying cars era yet (disappointment) but IOT powered locks are somewhat normal these days. The adoption rate is great.  Some background: What is this Hall Of Justice Authorisation system? This is the security system that Batman built for Hall Of Justice. The movies haven't shown it yet but there're several scenes in the animated series and comic books. Basically, it is a AI powered voice guided intelligent security system that scans bio signatures (like retina, body dimensions, temperature, heart rate) through a scanning device and identifies which member of the justice league it is, logs entry then gr...

Smart wifi controlled irrigation system using Sonoff and Home Assistant on Raspberry Pi - Part 1

If you have a backyard just for the sake of having one or it came with the house and you hate watering your garden or lawn/backyard then you have come to the right place. I genuinely believe that it is a waste of my valuable time. I would rather watch bachelorette on TV than go outside, turn on tap, hold garden hose in hand to water. Too much work!! Luckily, we have things like sprinkler system, soaker etc which makes things a bit easy. But you still have to get off that comfy couch and turn on tap (then turn off if there's no tap timer in place). ** Skip to the youtube video part if reading is not your thing   When I first moved into my house at first it was exciting to get a backyard (decent size), but soon that turned on annoyance when it came down maintaining it, specially the watering part. I laid bunch sprinklers and soaker through out the yard and bought tap timer but I still needed to routinely turn on the tap timer. Eventually few days ago I had enough of this rub...

Jenkins on k8s - can it be this easy?

 As developers or devops we have had a somewhat love and hate relationship with Jenkins like "love oss based ci/cd that can be hosted on any environment with ranges of community plugins for pretty much anything" BUT "hate messy UI, lack of documentations, difficult to configure" etc etc. But this post isn't about pros and cons of Jenkins, rather it is about how you can get Jenkins on your k8s super quick and easy (using Merlin). Git Repo:  https://github.com/alinahid477/jenkinsonk8s Table of contents: Why Jenkins Why Merlin for Jenkins What is Merlin for Jenkins How Merlin for Jenkins works How Jenkins on k8s work Some anticipated FAQs Why Jenkins Jenkins remains a popular choice when it comes to CICD solution with a massive community of users and contributors (despite the fact there are new cool kids in block like Tekton etc). The way I see it (because of our love and hate relationship with it) "Jenkins is not CICD tool that you want it's the CICD t...

Do you even Kubernetes ? - in private cloud

Kubernetes (“koo-burr-NET-eez”) /κυβερνήτης/ - Can be used as noun or verb. Noun "helmsman" or "pilot" or "Orchestrator". We use Kubernetes to achieve resiliency for our application. Verb Perform the act of doing Kubernetes. When done using TKG it is easy but can be super hard if the right tool is not used. Do you even Kubernetes? If I were to survey about how many people in IT industry (regardless of role) knows or at least heard about Kubernetes I would be very surprised if the percentage came out any less than at least 80%. I am curious though, How many people have actually deployed on Kubernetes? How many people have created a Kubernetes cluster? How? The answer could go either way of "Yeah, it's easy" OR "Dude!! it's hard". This is because, in my opinion, it all depends on choosing the right toolset that are fit for purpose. In this post I will create a Kubernetes cluster and deploy a microservice application End-To-End, th...