Smart Home and IOT

Controlling Somfy blinds with ESP8266

Controlling Somfy blinds with ESP8266

The Story Behind

Somfy?

I recently moved to another apartment where I got motorized blinds.
Those blinds works on a system called Somfy which includes one remote.
The remote control cost around for the basic version and it has 3 buttons: Up, Down and Stop.

In the beginning I thought the remote is working on infrared but it turned out to be RF.
So after some google-ing I found a great guy called Nickduino on Github and he wrote an Arduino sketch that emulates Somfy remote.
You can find his great project here.

And the Somfy RTS protocol is explained here.
But in a nutshell, the remote is operating at 433.42 MHz and the modulation is ASK/OOK.

Hardware

I had some 433 RF modules in my drawer but those are operating at 433.92 MHz
So I had to order from eBay some new SAW tooth resonator that operate on 433.42MHz.
After I got those, I just replaces the resonator on the module with the new.

I decided to work with ESP8266 cause I wanted to control the blinds remotely.
Wemos D1 Mini was the easiest choice since it’s small and easy to program.

433MHz RF modules on eBay
Wemos D1 Mini on eBay

Software

After downloading Nickduino’s sketch I had to adapt it to the ESP8266 and change some lines.
Then I had to play hours to figure out what did I do wrong (turned out that using “New line” on Arduino serial console is messing the code so I needed to choose “No line ending”).

HTTP server was my choice to handle the part of the remote control, all I needed is to import one library and write some code.
It’s pretty simple, I configured dynamic DNS and opened ports on my router.
When the ESP8266 receives a request it processes what’s the URL argument (U for up, D for down etc.) and send the generated frame through the RF module.
I wanted to schedule it to roll up every morning so I set a cronjob on my server to send an HTTP request to the ESP8266.

The last step was to configure Webhooks on IFTTT so I can use Google Assistant to remotely control the blinds.

In the end

I really enjoyed working on this project even though I had to debug it many times and my oscilloscope was working extra hours.
Now I can control the blinds remotely and schedule it to open and close whenever I want.

UPDATE:

Since many people ask me for the code, here is the download:

Did you like it?

Leave a Comment

Your email address will not be published. Required fields are marked *

Skip to content