Somfy sunscreen automated and Alexa control



In this post I just want to share my journey to get 4 sunscreens controlled by Somfy Telis 4 remote integrated into HA, including automated closing, wind & rain protection and last but not least voice control with Alexa. No rocket-science; key to the success is this great forum and friendly co-workers!

RF- Wireless
I am using the RFlink gateway software and hardware from the nodo-shop to setup the rflink-hub.
The installation is well documented in https://www.home-assistant.io/integrations/rflink/

Setup the Somfy sunscreens
ā€œJustā€ follow the documentation: https://www.home-assistant.io/integrations/cover.rflink/

This is the genius who discovered it: https://matdomotique.wordpress.com/2016/04/21/domoticz-rflink-et-somfy/

With 4 sunscreens, you have to perform the pairing with only one screen on power. Switch off the others to you avoid all kinds of troubles.

If the pairing with a code like 2F2F2F fails (the code is visible in RFlink 10;RTSSHOW; but it still does not work), I found it helpful to retry with another code like 2F2F3F.
dipole

Despite the fact that I am using a dipole at a relative short distance (3 meter) to the screens, I had trouble pairing one particular screen. After trying, thinking and crying nothing seems to work. In the end it appeared that the position of the dipole was critical.

Perhaps a coincidence (ā€¦) but this troublesome screen also showed a reverse operation. Operating via RFLink 10;RTS;2F2F2F;0;DOWN; everything was fine but when I used the newly created cover in HA, this screen moved UP when I pressed DOWN.
This can be corrected with the inverted line in the YAML (RFlink Somfy RTS - inverted cover, : RFLink Somfy cover moves only a bit)

So here is how it looks

  - platform: rflink
    devices:
      RTS_1F1F2F_01:
        name: Screen big
        aliases:
          - rts_219a3d_01   
      
      RTS_3F3F3F_03:
        name: Screen ^ left
        aliases:
          - RTS_219a3d_01
          - RTS_237d00_01
          - RTS_232b2d_01
      
      RTS_4F4F4F_04:
        name: Screen ^ right
        aliases:
          - RTS_219a3d_01
          - RTS_42172_01
          - RTS_241ebb_01
          
  - platform: rflink
    devices:
      RTS_2B2B2B_02:
        type: inverted
        name: Screen small
        aliases:
          - RTS_219a3d_01

The status of the cover is not maintained. The arrows Up or Down do not grey out after pressing them. So far I have not found a solution.
Screenshot 2020-06-02 at 12.10.32

Voice control Alexa
Via the emulated hue trick https://www.home-assistant.io/integrations/emulated_hue/ I control the lights and switches. For the 4 sunscreens I want to say: ā€œAlexa turn on Screensā€ to make all of the 4 screens to go down. For this a template switch https://www.home-assistant.io/integrations/switch.template/ is created:

  - platform: template
    switches:
      screens:
        value_template: "{{ states('input_boolean.screens') }}"
        icon_template: '{% if is_state("input_boolean.screens", "on") %}mdi:garage{% else %}mdi:garage-open{% endif %}'
        turn_on:
          - service: input_boolean.turn_on
            data:
              entity_id: input_boolean.screens
          - service: cover.close_cover
            data:
              entity_id: cover.screen_big       
          - delay:
                milliseconds: 5000
          - service: cover.close_cover
            data:
              entity_id: cover.screen_small       
          - delay:
              milliseconds: 5000 
          - service: cover.close_cover
            data:
              entity_id: cover.screen_left       
          - delay:
              milliseconds: 5000  
          - service: cover.close_cover
            data:
              entity_id: cover.screen_right   
          
        turn_off:
          - service: input_boolean.turn_off
            data:
              entity_id: input_boolean.screens
          - service: cover.open_cover
            data:
              entity_id: cover.screen_big       
          - delay:
              milliseconds: 5000
          - service: cover.open_cover
            data:
              entity_id: cover.screen_small       
          - delay:
              milliseconds: 5000  
          - service: cover.open_cover
            data:
              entity_id: cover.screen_left       
          - delay:
              milliseconds: 5000  
          - service: cover.open_cover
            data:
              entity_id: cover.screen_right  

The delays are absolutely necessary in order to avoid a collision of RF signals. By introducing a delay the screens open or close sequential. That is why I had to use a switch template to incorporate the script (How do I turn a script into a switch?)

Screenshot 2020-06-02 at 12.13.36

Do not forget to add the newly created switch to the emulated hue list:

emulated_hue:    
  host_ip: 192.168.2.33
  listen_port: 80
  #off_maps_to_on_domains:
  #  - script
  #  - scene
  expose_by_default: false
  exposed_domains:
  #  - light
  #  - switch
    - scene
    - script
  entities:
    switch.0x00124b000e95c57b_switch_bottom_left:             
      name: "Egg"
      hidden: false
    switch.0x00124b001d861b70_switch_bottom_right:       
      name: "Amplifier"
      hidden: false
    switch.screens:
      name: "Screens"
      hidden: "false"

Automation
Here are my objectives:
a) Automate the closing of the sunscreens in the morning when a very hot day is expected (based on the forecast of dutch Buienradar https://www.home-assistant.io/integrations/sensor.buienradar/).
b) Automatic opening at certain rain and/or wind conditions

This thread How to automate my awning (sunscreen) is a good read.

This is how I build it:

I have created 3 input_booleans:

  wind_low_tomorow:
    name: "Wind < 5 Bft tomorow"
    icon: mdi:weather-windy
  
  temp_high_tomorow:
    name: "Temp >24 C tomorow"
    icon: mdi:weather-sunny
  
  rain_low_tomorow:
    name: "Rain < 0.2 mm tomorow"
    icon: mdi:weather-pouring

Every evening these booleans are set with the latest forecast:

automation:
  - alias: Read temp tomorrow
    initial_state: 'on'
    trigger:
      platform: time
      at: '22:00:00'
    condition:
      condition: numeric_state
      entity_id: sensor.br_temperature_1d
      above: 24
    action:
      service: input_boolean.turn_on
      entity_id: input_boolean.temp_high_tomorow
  
  - alias: Read Windforce tomorrow
    initial_state: 'on'
    trigger:
      platform: time
      at: '22:00:00'
    condition:
      condition: numeric_state
      entity_id: sensor.br_wind_force_1d
      below: 5
    action:
      service: input_boolean.turn_on
      entity_id: input_boolean.wind_low_tomorow

  - alias: Read Rain tomorrow
    initial_state: 'on'
    trigger:
      platform: time
      at: '22:00:00'
    condition:
      condition: numeric_state
      entity_id: sensor.br_rain_1d
      below: 0.2
    action:
      service: input_boolean.turn_on
      entity_id: input_boolean.rain_low_tomorow

And the automation to get the screens down early morning :slight_smile:

  - alias: Screens down 
    initial_state: 'on'
    trigger:
      platform: sun
      event: sunrise
      offset: +00:30:00
    condition:
      condition: and
      conditions:
        - condition: state
          entity_id: input_boolean.wind_low_tomorow
          state: 'on'
        - condition: state
          entity_id: input_boolean.rain_low_tomorow
          state: 'on'  
        - condition: state
          entity_id: input_boolean.temp_high_tomorow
          state: 'on'  
    action:
     - service: switch.turn_on
       entity_id: switch.screens

And an automation to get the screens up when the wind or rain are too strong:

  - alias: Screens up
    initial_state: 'on'
    trigger:
    - platform: time
      at: '17:00:00'
    - platform: sun
      event: sunset
      offset: -02:00:00
    - platform: numeric_state
      entity_id: sensor.br_wind_force
      above: 4
      for:
        minutes: 5
    - platform: numeric_state
      entity_id: sensor.br_precipitation_forecast_total
      above: 0.2
    - platform: numeric_state
      entity_id: sensor.br_irradiance
      below: 100
      for:
        minutes: 5
    action:
     - service: switch.turn_off
       entity_id: switch.screens

I am sure that each sunscreen integration and automation case is different but I hope that this post helps you a bit to design your own.

2 Likes

Hi Doublet,
Iā€™m glad you were able to get your installation working, but if youā€™ll allow me, I have a couple of suggestions.

The coverā€™s state should be maintained between restarts.
For the grey issue, I thought that should not happen with RFLink covers either. You can try to customize the assumed_state attribute to True:

If you want to control ALL the covers at once I recommend that you create in HA another cover to rule them all. This new cover can be paired (the same one) with all your covers (once every time). This way every cover could be controlled 3 ways: the remote, the ā€˜individualā€™ control and the ā€˜groupā€™ control.
You could control all yours covers with a single command without the need for delays. And can keep the individual control of any cover.

And the last one. Maybe you want to take a look at this CC:

This is not a suggestion, but in case anyone is wondering:

This setting is in the documentation too:

1 Like

Thank you for your comments, I will have a closer look and try!

Hi @Doublet , thanks a lot for sharing your case. I have exactly the same remote as yours to control three screenings, and Iā€™d like to control them in my HA now.
Iā€™ve ordered the RFLink kit. But before I start, Iā€™d like to really know what Iā€™m doing to at least not screw up the behaviours of the motor and the original remote.

  1. To make the motor in ā€œpairingā€ or ā€œprogramingā€ mode, is it done by pressing UP and DOWN buttons together on the remote?
  2. I have two screenings connected to the same electricity wire. So I canā€™t (easily) just connect one and cut the power of another. Is this going to be an issue? Once I press the buttons on the remote to start the pairing mode, which motor would react on that? Does the selected ā€œchannelā€ (done by pressing the lowest button) matter at this stage?
  3. The tutorial doesnā€™t mention anything about setting the limits of the motors. Does that also need to be done when pairing RFLink? Or the motor would just keep the originally set limits?

Thank you for your help.

Let me try to answer:

  1. Pairing: In my case I got the motor in pairing mode by pressing the reset button at the back of the remote
  2. Two screens: before you start the pairing and subsequent steps you must ensure that only one screen is powered. So indeed only connect one at the time.
  3. Limits Motor: in my case the limits are already set in the screen/motor, so I only needed to send a up or down command. If you want to set the limits by HA and time controlled, you might want to look at : YET another time controlled cover (RFLink)

good luck

Alright, thanks for the explanation. Having only one motor powered at a time could be difficult for me, Iā€™ll see what I can do. I even wonder, because the RF range could be Ā±100 meters, if some neighbours also have Somfy motors, they will become a problem as well, no?

I think with rolling code procedure of SOMFY the chances are not that big that you control the neighbour sunscreens. And if you CAN control them, itā€™s a bonus :joy:

No I meant when doing the paring steps, if itā€™s needed to have only one RTS motor on power, then any neighbourā€™s Somfy within the range could have been an issue IMHO.

The pairing itself is done with the remote. The transmit power of the remote is not as big as the RFLINK so I think you will be ok.

The Somfy pairing process works only with the motor (or motors) that have the remote code paired.
That is, you will not be able to put a motor in pairing mode if you do not already have a remote paired to that motor.

If you have a single channel/code for several motors/covers, the only way to make the pairing process one by one is what @Doublet says, remove the current from the rest of the blinds so that it does not activate the pairing mode when starting the procedure with the remote.

Cheers.

PS: the pairing procedure can be diferent according to your motor. Follow the manual from your motor/remote to be sure.

I think it is now clear to me. Just waiting for the board to be delivered in the meantime :slight_smile:

Thank you both!

Ok, I just received the RFLink board. I can confirm that itā€™s not necessary to have only one of motors connected to the power.

I had all of them powered together. When entering the paring mode using the remote, only one motor would react (as the one selected on the remote). This makes more sense.

Hi Doublet,
Your automation objectives are similar to what I would like to achieve. I have set-up the buienradar integration, defined the boolean variables (helpers) , set up the automation to read the on 22:00 the forecast for next day. The differences between your YAML and mine are 1) buienradar has changed its name slightly and in my YAML I get quotes around the values which seem to suggest that it is expecting string values instead of numeric values. Iā€™m a 2 day rookie to HA, so forgive me my beginners mistakes; Any advice from your side?. My YAML for temperature is as follows:

alias: Read temp tomorrow
description: Bepaal of het morgen warmer dan 24 graden wordt
trigger:
  - platform: time
    at: '22:00'
condition:
  - condition: numeric_state
    entity_id: sensor.buienradar_temperature_1d
    above: '24'
action:
  - service: input_boolean.turn_on
    entity_id: input_boolean.temp_high_tomorrow
mode: single

I have tried this:

  - alias: Read temp tomorrow
    description: Bepaal of het morgen warmer dan 24 graden wordt
    trigger:
      - platform: time
        at: '22:00'
    condition:
      - condition: numeric_state
        entity_id: sensor.buienradar_temperature_1d
        above: '24'
    action:
     - service: input_boolean.turn_on
       entity_id: input_boolean.temp_high_tomorrow
    mode: single

and no errorsā€¦ please note the difference :slight_smile: a small - before alias

Can you pls try?

thanks Doublet. I tried both with space after the ā€œ-ā€ and without the space. In both cases I get an error message saving the YAML:
Message malformed: extra keys not allowed @ data['-alias']
Hope that you or anyone else has another suggestion