How to manipulate/add RFXtrx RFYcommands?

How can I change the RFY commands sent to the RFXtrx Hub module? I’m trying to control some Somfy blinds but can’t figure out how to manipulate the commands sent out by the Cover component.

It seems like HA only supports Open, Close and Stop commands. Is it possible to manipulate the commands sent out to the RFXtrx Hub?

This is the command I want the Hub to send out:

RFY command: 0C 1A 00 0E 0B BB AA 02 11 00 00 00 00

Create a template cover to define what open/close/stop commands actually are.

# Example configuration.yaml entry
cover:
  - platform: template
    covers:
      somfy_cover:
        friendly_name: "Blinds"
        # Defines the state of the blinds....assuming you can get that somehow. Needs to be between
        # 0 and 100. I'll pretend like you already have that sensor.
        position_template: "{{ states('sensor.blinds_sensor') | int }}"
        open_cover:
          # Define your custom messages for open/close/stop. Make them a script even. I know
          # zero about the RFXtrx hub....I assume there is a service you can call? 
          # Could even do "servce: rfxtrx.send_command" and pass in the data here? 
          service: script.open_blinds
        close_cover:
          service: script.close_blinds
        stop_cover:
          service: script.stop_blinds

Yes, this might absolutely be a way forward. I did find some code on Github that would be able to send the commands I need to the Somfy blinds at https://github.com/rfxcom/node-rfxcom.

RfyCommands: {
stop: 0x00,
up: 0x01,
upstop: 0x02,
down: 0x03,
downstop: 0x04,
updown: 0x05,
listRemotes: 0x06,
program: 0x07,
program2sec: 0x08,
program7sec: 0x09,
stop2sec: 0x0A,
stop5sec: 0x0B,
updown5sec: 0x0C,
erasethis: 0x0D,
eraseall: 0x0E,
up05sec: 0x0F,
down05sec: 0x10,
up2sec: 0x11,
down2sec: 0x12,
sunwindenable: 0x13,
sundisable: 0x14
},

The commands I want to send to the Somfy blinds are actually “up2sec: 0x11” and “down2sec: 0x12” instead of “up: 0x01” and “down: 0x03”. They are all listed above.

However, it looks like HA only supports the latter. In HA you can send to following commands to the Somfy blinds: Open, Close and Stop.

Instead of sending the following RFY command to Somfy/RFXtrx:

RFY command: 0C 1A 00 0B 0B BB BB 02 01 00 00 00 00 (up)

I would like to send:

RFY command: 0C 1A 00 0E 0B BB BB 02 11 00 00 00 00 (up2sec)

The only difference is the command 01(up) in the first one and 11(up2sec) in the latter.

If I only knew how HA passes these values to the RFXtrx Hub I could perhaps use the Template above or make a custom component where the commands have been changed. I guess the easiest way would be to call the specific function directly from the Template?

Problem is that I’m not a programmer so it’s hard to follow the code in HA.

Have you seen this?

It might be what you need!

Yes, thanks. I did use it when configuring my two blinds in HA yesterday. I can control one of them just fine. The other blind has basically 5 supported commands: Up, Down, Stop(My Button), Tilt_up and Tilt_down.

Unfortunately the Up and Down commands require special Somfy commands which is:

Up: Command = “> 2 seconds: up”
Down: Command = “> 2 seconds: down”

This is documented in the RFXtrx documentation and is valid for what the refer to as Venetian Blinds:

image

This results in the HA commands to change the angle of the Blinds instead of actually Open or Close them. I can see how the RFY command change going to the Somfy blinds in RFXtrx: