Rfxtrx cover - how to set state according to a door sensor

Hello,
I have somfy covers managed by rfxtrx platform and original remotes. These don’t have position sensor.
So when I open or close one cover manually with a remotes, hass can’t see that the new state (open or closed) of the cover.
I have also zigbee door sensor (using mqtt and zigbee2mqtt) that I wan’t to bind to a cover.
I tried to change the state of the cover according to the sensor but I can’t figure how to do that in the automation panel.

alias: Cover 4 position
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.open_door_4_contact
    attribute: contact
    to: closed
condition: []
action:
  - device_id: d7aaaefc54964d7699fbbe3b3ef7499a
    domain: rfxtrx
    ???
mode: single

Can you help me ?