DiY Somfy Blind Controls
My flat came preinstalled with Somfy window blinds and a remote controller. However, no wall switches were installed and no timers or any integration with a home automation system was present. As I recently purchased a MiCasaVerde VeraLite, I wanted to integrate the blinds into the system.
Being interested in both electronics and software, I decided to build my own controller based on an Arduino Ethernet and a Telis-4 remote control.
I purchased an Arduino Ethernet with PoE, some CNY17-3 optocouplers and a couple of resistors along with a Somfy Telis 4 control. The Telis 4 is actually a five-channel remote for Somfy blinds with four LEDs that indicate the currently selcted channel. The Arduino Ethernet, oth, is a small microcontroller based on an ATMega328p, a WizNet W5100 ethernet controller and a PoE module.
The Arduino's digital ports are connected to the Telis remote and toggle the buttons and read the LEDs to select the correct channel.
This picture shows the disassembled Telis 4 remote and a bunch of wires connected to it. You may notice that there are two wires for each button (they go to the CNY17-3), and then there are 4 wires directly or nearly directly attached to the MCU: Those are for reading the LEDs. And two wires go to bigger solder pads: This is the power supply. I connected the Arduino's 3.3V output to the Telis-4 remote and removed the battery - this lets me power the remote directly from the PoE supply.
Here you can see the four CNY17-3 optocouplers on an Arduino Proto Shield. The optocouplers are attached via the resistors (360Ohm, IIRCS) to the Digital PINs, the LEDs are directly connected to the Analog Input pins of the Arduino. It's hard to find, but it is a fact that the analog input pins can be used as digital pins as well.
In order to actually control the blinds, I wrote a simple software for the Arduino. It's not based on the Arduino IDE, but rather plain C code. As I recently discovered the Ariadne bootloader for Arduino, I made the setup compatible with it. Ariadne allows remote flashing of the Arduino via TFTP.
As my MCU is powered via PoE, I have it installed in a hard to access space. Being able to update the software remotely sigifnicantly improves user experience.
My software features two interfaces: A telnet interface on port 63543 that allows not only blind up/down/stop, but also incr/decr, change of IP address, reboot and reprogram. And there is the HTTP interface on port 80 that allows control via a web browser or the Vera plugin.
The Vera plugin, once installed, connects to the HTTP interface and controls the blinds via this interface. It allows for up to five channels in the interface configuration.
You can find the complete software in my hg repository at www.aboehler.at/hg/BlindControl
The software was only compiled on Linux using the avr-gcc toolchain and CMake for the Makefile generation. The variables BLINDCONTROL_USE_MEGA2560 generates code for the ATMega2560 if turned ON, otherwise the target is ATMega328p. The variable BLINDCONTROL_USE_ETH_INTERRUPT make ethernet handling more efficient by using an interrupt for ethernet handling. This does not work on the Arduino Ethernet, as the interrupt is not connected. However, the interrupt can be added to the Ethernet Shield via a solder jumper.