YET another time controlled cover (RFLink)

Platform error cover.rts_rflink - Integration ‘rts_rflink’ not found.

21:31 components/hassio/__init__.py (ERROR) - message survenu pour la première fois à 20:38 et apparu 7 fois.

With a bad manifest.json I get this error trace during startup:

2020-02-17 21:29:33 ERROR (MainThread) [homeassistant.config] Platform error: cover - Integration 'rts_rflink' not found.

It is not exactly the same as yours, it refers to cover and not cover.rts_rflink

You can check the cover configuration. In my case it is:

cover:
  - platform: rts_rflink
    devices:
      RTS_30E542_0:
        name: comedor
        rts_my_position: 35
        travelling_time_down: 23
        travelling_time_up: 25
        aliases:
          - rts_33e53f_01
          - rts_fa872e_01

I suggest you configure just one cover, eliminating all others covers.

In my covers.yaml file :

- platform: rts_rflink
  automatic_add: false
  devices:
    rts_xxxxxx_01:
      name: Volet Salon
      rts_my_position: 10
      travelling_time_down: 23
      travelling_time_up: 24
      aliases:
       - rts_xxxyyy_01
       - rts_yyyxxx_01
    rts_yyyyyy_01:
      name: Volet Chambre 1
      rts_my_position: 10
      travelling_time_down: 23
      travelling_time_up: 24
      aliases:
       - rts_xxxyyy_01
       - rts_yyyxxx_01

One cover and always the same error:

- platform: rts_rflink
 automatic_add: false
 devices:
   rts_xxxxxx_01:
     name: Volet Salon
     rts_my_position: 10
     travelling_time_down: 23
     travelling_time_up: 24
     aliases:
      - rts_xxxyyy_01
      - rts_yyyxxx_01

Something new.

After correcting the manifest.jason, HA does not restart from configuration --> server controls.
When I try I get the following trace:

2020-02-17 21:43:11 ERROR (MainThread) [homeassistant.components.hassio] Platform error cover.rts_rflink - Integration 'rts_rflink' not found.

Just like yours.

I have forced the restart from hassio comand line (hassio ha restart).

Please, check your manifest.json file and force a restart.

Maybe just a copy&paste typo, but be carefull with file identation.

cover: 
  - platform: rts_rflink
    automatic_add: false
    devices:
      rts_xxxxxx_01:
        name: Volet Salon
        rts_my_position: 10
        travelling_time_down: 23
        travelling_time_up: 24
        aliases:
         - rts_yyyyyy_01
         - rts_zzzzzz_01

Always the same error :rage: :rage: :rage:

2020-02-17 22:19:29 ERROR (MainThread) [homeassistant.components.hassio] Invalid config for [cover.rts_rflink]: [automatic_add] is an invalid option for [cover.rts_rflink]. Check: cover.rts_rflink->automatic_add. (See ?, line ?).

A pycache directory is created in custom_components \ rts_rflink

Yes, it is.

Can you delete de automatic_add config from cover?

The ideation of the aliases also does not seem correct in your examples.

Can you try with just:

cover:
  - platform: rts_rflink
    devices:
      rts_1F2F3F_01:
        name: Volet Salon
        rts_my_position: 10
        travelling_time_down: 23
        travelling_time_up: 24

:+1: :+1: :+1: I have the cover, the STOP button executes the MY programmed on my remote control but not the 10 seconds of rts_my_position: 10.
Can you explain to me how it works …

Great, that’s exactly what I was looking for. It is not super precise but it is super. It would perhaps be more precise if we use tenths of seconds instead of seconds …

The rts_my_position don’t have any functionality.
It’s a value between 0 - 100 (position, not time) , and it’s used to adjust the calculated cover position. RFLink can’t know which one is the cover “MY position”, when you call the “MY position”, the implementation uses the rts_my_position value to set this position and simulates the cover move.

Anyway you must know that the calculated cover position is not exact and you can’t expect a good behavior over the edges.

What reference should you take for rts_my_position?
The current position of the cover just before restarting the server ?

Tenths of seconds could be used for traveling_time_down and traveling_time_up…

You can do it by trial and error. You estimate what the position may be, and from the HA cover detail view you compare when the shutter stops vs when the interface says cover stops.

What I did was look at what position marked the cover detail view when the phisical cover passed through the MY position.

Yes, it could help, but the HA architecture does not allow controls below 1 second (or I have not known how to do it).
There are several threads that claim the same, but it seems that it is a limit that sets the HA architecture and cannot be lowered.
In fact, my implementation uses 0.1 second steps, but it’s not how it really works.

In any case, I think the main problem is the response time of RFLink. Sometimes it reacts instantaneously and sometimes it can take a little more than 1 second.

In fact in my automations, I must leave a lot of delay between RFLink commands.
For example if I raise 3 blinds sequentially, the result was chaotic. In HA the 3 commands can be launched in the same second, but RFLink accumulates delays in processing them. Since the current implementation is optimistic, time starts counting since HA calls the command, but RFLink may take several seconds to process the third command that arrives.
IMHO this behavior makes the result more unpredictable than the fact of not being able to control it below 1 second.

By the way, @sidwin9 what was the problem with the configuration?

Hi,
The problem came from the missing rflink directory in \custom_components\ and the fact that I restarted the server and did not reboot the system.

I want to thank you for your precious help.

I would also like to assign an icon for each state of the covers. but the code i am using does not work in the customize.yaml file:

cover.volet_salon:
  icon: >
    {% if is_state_attr('cover.volet_salon.position'),100 %} mdi:window-shutter-open
    {% elif is_state_attr('cover.volet_salon.position'),0 %} mdi:window-shutter 
    {% else %} mdi:window-shutter-alert
    {% endif %}

Do you have an idea ?

The following code also doesn’t work:

cover.volet_salon:
  icon: >
    {% if is_state_attr('cover.volet_salon', 'position'), 100 %} mdi:window-shutter-open
    {% elif is_state_attr('cover.volet_salon', 'position'), 0 %} mdi:window-shutter 
    {% else %} mdi:window-shutter-alert
    {% endif %}

I think that you can’t do this at icon variable (to put an scriplet inside), but can be done with a cover.template in the icon_template variable.
You will need to wrap your cover in a cover.template with something like:

cover:
  - platform: template
    covers:
      volet_salon_template:
        .../...
        icon_template: >-
        {% if is_state_attr('cover.volet_salon', 'current_position', 100) %}
          mdi:window-shutter-open
        {% elif is_state_attr('cover.volet_salon', 'current_position', 0) %}
          mdi:window-shutter 
        {% else %} 
          mdi:window-shutter-alert
        {% endif %}

But probably you must complete the rest of the attributes (open_cover, close_,stop_…). There is plenty of examples in the cover.template documentation.

There are some errors at this expression. The correct one shall be like:

{% if is_state_attr('cover.volet_salon', 'current_position', 100) %}

Look around your state window (http://hassio.local:8123/developer-tools/state) to know the attributes names and the Jinja template (http://hassio.local:8123/developer-tools/template) to validate expressions.

Also HA documentation is a good source of examples ()