Cover state - Somfy RTS blinds via RFXcom

Dear community

I managed to pair my Somfy RTS blinds via RFXcom. Now, the architecture might be a bit complex since the RFXcom is plugged on one Raspberry, and Hass is running on another, so I used a combination of ser2net/socat to make the two communicate.

It works well, the problem is that my covers always have a state “unknown” and due to that I cannot use the state as a condition in automations. I’ve read that with RFXcom and RFY protocol it is not possible to get feedback from the covers, but is there a way for Hass to set the status to “down” when I press “down”, “up” when I press “up”, etc?

Thanks a lot

configuration.yaml:

rfxtrx:
    device: /home/hass/dev/ttyRTX

cover:
  - platform: rfxtrx
    automatic_add: False
    devices:
      071a000000000101: # RFY
        name: Chambre
      071a000000000201: # RFY
        name: Salon

Hi

I have the same problem but I an using rfxtrx cover and a rollertrol device. This is causing me problem to control it with sceneactivation from my fibaro dimmer 2.

I am wondering about this too.
As a workaround I set the states of my Somfy covers in an MQTT topic, and I display the sensor state in the Home Assistant UI. It looks like this:

image

1 Like

Hi,
sorry for the noob question. can you please let me know how you achieve the above?

Same here i cant get the code right

I am not sure how the MQTT solution @lievencoghe was set up. In my case, I used a combination of scripts and cover templates. On the frontend I only display and manage the cover templates, not the rfxtrx ones, and these maintain the state.

configuration.yaml:

rfxtrx:
    device: /dev/ttyUSB0

cover:
  - platform: rfxtrx
    automatic_add: False
    devices:
      071a000000000101: # RFY
        name: rfxcom_chambre
      071a000000000201: # RFY
        name: rfxcom_salon
        
  - platform: template
    covers:
      salon:
        friendly_name: "Salon"
        open_cover:
          service: script.open_salon
        close_cover:
          service: script.close_salon
        stop_cover:
          service: script.stop_salon
      chambre:
        friendly_name: "Chambre"
        open_cover:
          service: script.open_chambre
        close_cover:
          service: script.close_chambre
        stop_cover:
          service: script.stop_chambre
      all:
        friendly_name: "Tous les volets"
        open_cover:
          service: script.volets_up
        close_cover:
          service: script.volets_down
        stop_cover:
          service: script.volets_stop

scripts.yaml

open_salon:
  sequence:
    - alias: OuvreLeSalon
      service: cover.open_cover
      data:
        entity_id: cover.rfxcom_salon
        #option: open

close_salon:
  sequence:
    - alias: FermeLeSalon
      service: cover.close_cover
      data:
        entity_id: cover.rfxcom_salon
        #option: closed

stop_salon:
  sequence:
    - alias: StopLeSalon
      service: cover.stop_cover
      data:
        entity_id: cover.rfxcom_salon
        #option: stop

open_chambre:
  sequence:
    - alias: OuvreLaChambre
      service: cover.open_cover
      data:
        entity_id: cover.rfxcom_chambre
        #option: open

close_chambre:
  sequence:
    - alias: FermeLaChambre
      service: cover.close_cover
      data:
        entity_id: cover.rfxcom_chambre
        #option: closed

stop_chambre:
  sequence:
    - alias: StopLaChambre
      service: cover.stop_cover
      data:
        entity_id: cover.rfxcom_chambre
        #option: stop

Seems to work, I’d also like to try @lievencoghe 's solution. Could you post your config please?

In the meantime I have changed to config a bit. I don’t have seperate entries for the state in the UI, but show the state in the icon itself using templates.

It looks like this now (both covers are up in the screenshot):

image

I split up my configuration in seperate files.

I’m using lovelace. This is what’s in ui-lovelace.yaml to display both my covers:

- type: entities
  id: card_zonnewering
  entities:
    - cover.keukencover
    - cover.livingcover

This is what I have in covers.yaml:

- platform: rfxtrx
  devices:
    071a0000000D0D01:
      name: keuken
    071a0000000C0C01:
      name: living

- platform: template
  covers:
    keukencover:
      friendly_name: "Zonnewering Keuken"
      icon_template: >-
        {% if is_state('sensor.zonnescherm_keuken_status', 'Opened') %}
          mdi:arrow-up
        {% elif is_state('sensor.zonnescherm_keuken_status', 'Closed') %}
          mdi:arrow-down
        {% elif is_state('sensor.zonnescherm_keuken_status', 'Stopped') %}
          mdi:square
        {% else %}
          mdi:help
        {% endif %}

      open_cover:
        service: cover.open_cover
        data:
          entity_id: cover.keuken
      close_cover:
        service: cover.close_cover
        data:
          entity_id: cover.keuken
      stop_cover:
        service: cover.stop_cover
        data:
          entity_id: cover.keuken

    livingcover:
      friendly_name: "Zonnewering Living"
      icon_template: >-
        {% if is_state('sensor.zonnescherm_living_status', 'Opened') %}
          mdi:arrow-up
        {% elif is_state('sensor.zonnescherm_living_status', 'Closed') %}
          mdi:arrow-down
        {% elif is_state('sensor.zonnescherm_living_status', 'Stopped') %}
          mdi:square
        {% else %}
          mdi:help
        {% endif %}
      open_cover:
        service: cover.open_cover
        data:
          entity_id: cover.living
      close_cover:
        service: cover.close_cover
        data:
          entity_id: cover.living
      stop_cover:
        service: cover.stop_cover
        data:
          entity_id: cover.living

In sensors.yaml:

- platform: mqtt
  state_topic: "hass/states/cover/keuken"
  name: "Zonnescherm Keuken status"

- platform: mqtt
  state_topic: "hass/states/cover/living"
  name: "Zonnescherm Living status"

The MQTT values are set by Node-RED, as I do all of my automations in there. So I cannot help with the Home Assistant configuration for setting MQTT values. Anyway, the MQTT value is set to either of the 3 values (Opened, Closed, Stopped) in accordance to the function being called for the cover (open_cover, close_cover, stop_cover).

Anyway, here’s a screenshot so you get the idea:

Hope this helps.

1 Like

Great thanks, will give it a try and figure out which of the 2 i like the most :slight_smile:

@lievencoghe Could you please provide some more info on the NodeRed flow? I’m trying to setup my state-icons just like you did but I’m stuck on the NodeRed part… I’d really appreciate it!

Hello,
I start on HA. how do you get the long number for example "… devices:
071a000000000101: # RFY … "?

1 Like

Well I also started with the HA and added my somfy RTS blinds.
But why the state is always unknow. Can I change that when clicking on the up/down options?
Maybe someone can help?

Hello,

If some people tracking this topic, you should help me with my problem : [SOLVED] Strange behavior with the stop button Somfy RFXCom

Thank you !

Which solution did you find worked best?

As for now, HA tries to track the state. Which is impossible as RTS is not bidirectional. This means that when I use the original remote, the state gets messed up. How can I prevent this? The “unknown” state would be desirable for me…

Have you find a solution for that?

Hi Michael
No I did not investigate it further. I just ignore the entities history an state…

What I would like to achieve is to create the cover command only a given seconds and set the state of the cover accordingly.

Such as is, orders could be expressed as “closing at 30%” and action would last the corresponding time and the state would assume the position of the cover accordingly.

I am a beginner with yaml and nodered so I have still to find an already made solution or make it !

EDIT 1 : Here a good beginning :
Manage RF433 covers’ exact position with node-red and Home Assistant - Share your Projects! - Home Assistant Community (home-assistant.io)

EDIT 2 : Here a Custom Component that looks great for the purpose !
Custom Component: Cover Time Based - Share your Projects! / Custom Components - Home Assistant Community (home-assistant.io)
I managed to do it with my RFXTRX integration and gave my configuration files there.