Flash a Shelly for HomeKit over OTA: step-by-step guide

Leer en español →

We’ve already talked before about how useful a Shelly smart relay can be. If you’ve landed on this post, chances are I don’t need to explain what it is, so we’re going to focus on how to flash Shelly for Apple HomeKit.

What is Shelly?

Alright, let’s assume not everyone lands on this page for the same reason, so I’ll explain what a smart relay is: Imagine you have a smart bulb in a ceiling lamp. You leave the switch on and can turn the bulb on and off perfectly fine from your phone, an automation, or with your virtual assistant… but what happens when someone who doesn’t know it’s a smart bulb flips the switch to turn it on? Well, two things happen… first, it doesn’t turn on, since the switch was already in the ON position and was already powering the bulb even though it was off (smart bulbs don’t actually turn off, they just set brightness to 0%), so flipping the switch cuts power to the bulb… and of course it disconnects from whichever app you’re using. What usually happens is that person flips the switch again (kind of like when the document we sent to print doesn’t come out of the printer… and we just hit print again instead of figuring out why it didn’t come out the first time), which restores power to the bulb but it goes back to its previous state, which is off… and that person ends up shouting from the other end of the house that the bulb has burned out.

Shelly is a smart relay that handles this situation by ‘bridging’ the switch and turning it into a ‘smart’ one. If you tell the switch you want to turn on the bulb, Shelly sends power to the bulb, but if you tell it from the app, it sends it too! In other words, you can keep your good old regular switch working for whoever uses it, while also keeping your automations or voice commands, because that bulb will never lack power.

And all of this in a super tiny space that you can fit behind the outlet or in the junction box… for less than €11! Pretty cool, right?

Why flash it?

I won’t go too deep into this topic since we’ve covered it before, but Shelly doesn’t support Apple HomeKit natively. It used to be compatible, but it seems Apple pulled Shelly’s certification (probably over money issues, license fees, or something along those lines) and the Shelly folks are trying to get it back… but right now they’re not compatible with HomeKit. They are compatible with Google Home and Amazon’s Alexa, so if you use those assistants, you don’t need to keep reading 😀

You can skip the hassle and just buy them already flashed, you know? We’ve mentioned before the already-flashed Shellys available on Amazon, but the price goes up a bit compared to buying it yourself and flashing it. A completely valid option, but first read through this whole post so you can see how simple the process is 🙂

That said, it’s possible to download a firmware that makes Shelly devices (all of them) compatible with Apple HomeKit, so you just need to flash each of your devices for them to start showing up in Apple’s Home app.

IMPORTANT!!: Once you flash the device with the new firmware, it will stop being compatible with other assistants and with the Shelly app, so you’ll have to set up all your automations from Home. This doesn’t bother me at all, honestly I prefer it, since that way there’s no need to have the Shelly app installed.

Going back to the original firmware

To put your mind at ease, I’ll tell you that if at some point you want to flash your Shellys again to use them from their native app or integrate them with other voice assistants, it’ll be as simple as reinstalling the original firmware, which you can download from the official page, no problem 🙂

Flashing the Shelly

It’s a very simple process, don’t worry. The first thing you need to do is power up the gadget if you haven’t already installed it. If you’ve already installed it in place and just want to add HomeKit support, you can skip this step, no need to take it out of wherever it is. In my case, I powered it using the cable from an old power strip: As you can see, all you have to do is connect the blue cable (neutral) to the N input on the Shelly and split the brown one (L) as if it were a switch, so it goes into both L and I. With that, the Shelly is powered and will be detectable on the network. Within a few seconds it’ll turn on and we’ll see that it has created its own WiFi network, since that’s needed to pair it with the native Shelly app which we are NOT going to use: The next thing we need to do is connect to the WiFi network created by the Shelly. It’ll give us an IP address. Then we need to access the Shelly’s IP through the browser, in my case it was 192.168.0.32. Once here, we’ll need to enter our WiFi network credentials… and restart it so it connects to the home WiFi, since we’re going to need it to have internet access. Lastly, we need to enter this in the URL bar: http://192.168.0.32/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly1.zip And… that’s it. Pretty cool, right? Hahahaha. The gadget will download the firmware from that URL (less than 1MB) and install it automatically. When we access it again a few seconds later, we’ll see something like this: The only thing to keep in mind is that we’ll need to come up with the HomeKit code ourselves and then add the Shelly to HomeKit using that same code, although in my case the Home app detected it automatically without any issue, just like any other type of device. Either way, don’t set it to 111-2222-3333, use a bit of common sense and imagination.

Other Shelly devices

If you have a Shelly 2.5 like the one we talked about in the post on how to automate blinds, or any other type of Shelly device, you can flash it in a similar way:

Shelly 1: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly1.zip

Shelly 1PM: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly1PM.zip

Shelly 2: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly2.zip

Shelly 2.5: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-Shelly25.zip

Shelly Plug S: http://A.B.C.D/ota?url=http://rojer.me/files/shelly/shelly-homekit-ShellyPlugS.zip

I know what you’re thinking: «I’m putting firmware from some guy called rojer.me, who I don’t know at all, onto my device… what if it includes a trojan and then sneaks into my house?» Weren’t you thinking that? Well, you should have been, because if you weren’t, that means you don’t read this blog enough and the Security paranoia hasn’t kicked in yet, hahaha. The thing is, I did wonder about this myself, so I downloaded the full firmware and had a look through it without finding anything suspicious. It’s really just a few binaries and a JSON file, so I encourage you to download it and poke around yourself. If that wasn’t clear enough, there’s a short YouTube video where you can see the process in broad strokes This video comes from the GitHub page where the project is hosted: https://github.com/mongoose-os-apps/shelly-homekit

Even so, if you’re still not clear on something or have any doubts about the process, don’t hesitate to swing by the Telegram channel where many of this forum’s readers hang out, and we’ll be happy to help you out!

¿Necesitas ayuda con tu domótica?

Te ahorro tiempo, dinero y disgustos. Sesiones de consultoría desde 60€.

Ver opciones