ha-rflink-rts icon indicating copy to clipboard operation
ha-rflink-rts copied to clipboard

Configuration to integrate Somfy RTS shutters into Home Assistant using the RFLink gateway

= Home Assistant - RFLink - Somfy RTS ifdef::env-github[] :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: :caution-caption: :fire: :warning-caption: :warning: endif::[] ifndef::env-github[] endif::[] :hardbreaks: :imagesdir: images :icons: font :figure-caption!:

Somfy RTS, RFLink and Home Assistant

== Somfy RTS

Shutters automation.

(Unfortunately) we have some https://www.somfysystems.com/en-us/discover-somfy/power-technology/radio-technology-somfy[Somfy RTS] shutters in the house, and I wanted these shutters tied into the automation system together with all the other, non-Somfy-RTS shutters that are automated, and to eliminate using the Somfy remote controls. I'm not interested in buying a Somfy home automation system. The Somfy shutter-motors should be tied into a https://www.home-assistant.io/[Home Assistant] setup. Somfy RTS shutters can be controlled via RF transmission on 433.42 MHz, so how hard can it be?

=== Somfy pcb

ifdef::env-github[] ++++ ++++ endif::[] ifndef::env-github[] .Inside the Somfy RTS Dry Contact Interface image::somfy-dry-contact-to-rts-inside.gif[Dry Contact Interface, 250, 250,float="right"] endif::[]

My first solution for controlling a few Somfy RTS blinds was just using the pcb from a https://store.somfysystems.com/products/remotes/somfy-telis-4.html[Somfy Telis 4 remote control], and connect some relays to it. Basically, same principle as can be bought as a https://www.somfysystems.com/en-us/products/1810493/rts-dry-contact-interface[Somfy RTS Dry Contact Interface]

.Somfy Telis 4 donor image::somfy-telis-4-rts-top.jpg[Somfy Telis 4 donor, 350]

.Somfy Telis 4 image::somfy-telis-4-rts-bottom.jpg[Somfy Telis 4, 350]

.Somfy Telis 4 pcb image::somfy-telis-4-rts-pcb.jpg[Somfy Telis 4 pcb, 350]

.Somfy Telis 4 connections for relay control image::somfy-telis-4-rts-pcb-annotated.png[Somfy Telis 4 connections, 650]

== RFLink

ifdef::env-github[] ++++ ++++ endif::[] ifndef::env-github[] image::rflink.png[RFLink,200,200,float="right"] endif::[]

Controlling the Telis pcb using some relays under control of Home Assistant worked, but a more robust and scalable solution would be to use a microcontroller with a 433MHz transmitter/receiver and have that act as a remote. More information about the Somfy RTS protocol can be found at https://pushstack.wordpress.com/somfy-rts-protocol/ Luckily, an excellent RF Gateway exists with the http://www.rflink.nl[RFLink], and that can serve as a quick way to integrate a 433MHz sender/receiver. Even better, the RFLink people have http://www.rflink.nl/blog2/faq#RTS[integrated the Somfy RTS protocol into their firmware].

The goal here is to have the RFLink behave as if it were an additional Somfy RTS remote control. Just cloning the messages as send out by a Somfy RTS remote control will not suffice, because Somfy employs a rolling code in their RTS protocol. (I guess my take is that I don't want to award these kind of user-hostile companies with buying an additional 'home automation' box. Their automation options are also &@$!#*% expensive) This means that you could either record the signal of an existing Somfy remote, take over the counter for that remote, and make sure not to use that remote control anymore, or, better, to pair the RFLink as an additional remote control to the RTS receiver. This has the added benefit that next to being able to integrate the RTS blinds into your home automation system, you can also still use the original RTS remote control if wanted.

== RFLink - RTS

Following is the configuration for RFLink & Somfy RTS:

Pair RFLink as a remote control with the RTS shutters

  • Use the RFLink Loader program to put latest firmware on the RFLink

image::rflink-flash-firmware.png[RFLink, 650]

  • Connect to RFLink & turn on Serial Port Logging

RFLink should output some feedback like

20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R48;
10;version;
20;01;VER=1.1;REV=48;BUILD=04;
10;status;
20;02;STATUS;setRF433=ON;setNodoNRF=OFF;setMilight=OFF;setLivingColors=OFF;setAnsluta=OFF;setGPIO=OFF;setBLE=OFF;setMysensors=OFF;
  • Check the current slots for storage of rolling codes in the RFLink's internal EEPROM
10;RTSSHOW;

which for an empty rolling codes table would look like:

image::rflink-rtsshow.png[RTSSHOW, 650]

  • Put RTS shutters into pairing mode

See https://www.somfysystems.com/en-us/Blog/Post/2019-03-04-how-to-add-or-remove-additional-rts-controls-for-your-rolling-shutter[Somfy documentation], with an already programmed RTS transmitter, it's just a case of pushing the programming button on the back of the remote control for a few seconds until the shutter jogs.

  • Pair Somfy shutter with the RFLink

Send pairing command : 10;RTS;0A0A0A;0123;1;PAIR;

[cols=2*] |=== 2+^| https://www.rflink.nl/protref.php[Pairing command breakdown]

|10 |indication for RFlink that a command is send to interpret

|RTS |RTS protocol

|0A0A0A |address (needs to be a unique remote control code - hexadecimal)

|0123 |rolling code number

|1 |position in the rolling code table stored in internal EEPROM. (hexadecimal)

|PAIR |RFLink RTS pair command

|===

image::rflink-pair.png[Pair, 650]

  • Verify the pairing by checking the internal EEPROM slots (using RTSSHOW command)

image::rflink-pair-rtsshow.png[Pair, 650]

  • At this point, it should be possible to control the shutter using the RFLink

Moving shutter down:

10;RTS;0A0A0A;0;DOWN;

[cols=2*] |=== 2+^| RFLink protocol

|10 |send command to RFlink

|RTS |RTS protocol

|0A0A0A |address

|0 |(zero = currently unused parameter)

|DOWN |command

|===

Moving shutter up:

10;RTS;0A0A0A;0;UP;

Stop shutter movement:

10;RTS;0A0A0A;0;STOP;

For my 4 shutters, pairing all 4 of them:

shutter 1 (left to right)
10;RTS;0A0A0A;0123;1;PAIR;
shutter 2
10;RTS;0B0B0B;0234;2;PAIR;
shutter 3
10;RTS;0C0C0C;0345;3;PAIR;
shutter 4
10;RTS;0D0D0D;0456;4;PAIR;

4 shutter configurations are programmed into the RFLink, and the 4 corresponding rolling codes are now under control of the RFLink gateway:

image::rflink-pair-4-covers-added.png[RTSSHOW, 650]

== Home Assistant

Home Assistant has an https://www.home-assistant.io/integrations/rflink/[rflink integration] to support the RFLink gateway and support for https://www.home-assistant.io/integrations/cover.rflink/[RFLink-controlled shutters].

=== configuration

Enable rflink in Home Assistant by adding the rflink section to configuration.yaml

# Enable RFLink integration in Home Assistant
rflink:
  port: /dev/ttyACM1
  or
  port: /dev/serial/by-id/usb-xxxxxxxxx

Add the necessary covers to configuration.yaml:

Associate a shutter with the previously configured addresses in RFLink. The RFLink cover ID's are composed of: protocol (RTS), address id & gateway id. For example: RTS_0A0A0A_0

# Add Somfy RTS covers
cover:
  - platform: rflink
    devices:
      RTS_0A0A0A_0:
        name: Shutter Office Room
      ...

==== debug logging

For debugging purposes & investigating the context, enabling the debug logging for RFLink can be handy

logger:
  default: error
  logs:
    rflink: debug
    homeassistant.components.rflink: debug

= Resources

https://www.home-assistant.io/integrations/rflink/ https://www.home-assistant.io/integrations/cover.rflink/ https://github.com/Nickduino/Pi-Somfy https://www.letscontrolit.com/forum/viewtopic.php?t=3399 https://matdomotique.wordpress.com/2016/04/21/domoticz-rflink-et-somfy/ http://rflink.nl/blog2/ https://www.instructables.com/id/How-to-Connect-Your-Somfy-Remote-to-Alexa-With-an-/ https://bithead942.wordpress.com/2014/04/12/motorized-window-blinds-phase-2/ https://romor.github.io/blind-control/ https://www.smbaker.com/automated-cellular-shades-with-somfy