Cover position slider

Likely what’s occurring, I’m not sure how to resolve that at this time. Sorry :frowning:

Hello,
Alter fighting some days with the covers, I have fully integrated them in HA.

My solution has involved making a new command line sensor where I copy the cover position. Then I can show it on the frontend.

My covers aren’t zwave but 433MHz so the architecture is a bit more complex (had to calculate the position based on running time)

How is your overall experience with this qubino shutter in HA?

Except that I never got the position slider to show properly (I haven’t really gone any deeper into it since August) I think it works fine.

Could you write down your solution? I also have 433MHz covers and need to calculate the position). Thanks

Hi, sorry for the delay, I didn’t get a notification for your reply.

Can’t access my HA right now, but I remember that I adapted this example:

in my case the RF part was resolved using pilight-control (the cover was first configured in pilight, so I can access pilight web interface in case of HA failure). Just send at the same time the 433MHz command to your cover and call the script “states.sh”

I lately configured the detection of the original RF remote buttons, so HA knows when somebody open/close the cover manually.

This adds even more complexity…

Regards

Would you be so kind and let us know your whole setup for the RF? Also how are you sending the command to cover and calling the script at the same time, do you use the commandline cover? Thanks

Hello, I am still away from my isolated HA installation… i’ll try to post it when I have access to the HA machine.

btw how can I format the config files to respect indents?

Good question, but don’t know… only manual way, works for me :frowning:

I recommend you use a proper editor with syntax highlighting such as Atom or Visual Studio rather than basic text editors like Notepad or Nano.

I thought he was asking about copying the config here… because I don’t know how to keep formating (for editing config on my HA I am using Atom :slight_smile: )

Ah, I see. Triple back-ticks then, see here: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting

 ` ` ` (shown here with spaces between them)

Hi all.
I’ve tried a similar solution, but when i use the slider to set the level, the cover start moving but stop itself istantly, probably because when start moving it sends its level, set the slider, then the slider re-set the cover level and stops.

input_number:
  posizione_tenda_soggiorno:
    name: Posizione tenda soggiorno
    min: 1
    max: 100
    step: 1
    unit_of_measurement: '%'
    icon: mdi:format-align-middle

  posizione_tenda_cameretta:
    name: Posizione tenda cameretta
    min: 1
    max: 100
    step: 1
    unit_of_measurement: '%'
    icon: mdi:format-align-middle

sensor:
  - platform: template
    sensors:
      posizione_tenda_soggiorno:
        friendly_name: "Posizione Tenda Soggiorno"
        entity_id: cover.fibaro_system_fgrm222_roller_shutter_controller_2_level
        unit_of_measurement: '%'
        value_template: "{{ states.cover.fibaro_system_fgrm222_roller_shutter_controller_2_level.attributes.current_position }}"
      posizione_tenda_cameretta:
        friendly_name: "Posizione Tenda Cameretta"
        entity_id: cover.fibaro_system_fgrm222_roller_shutter_controller_2_level_2
        unit_of_measurement: '%'
        value_template: "{{ states.cover.fibaro_system_fgrm222_roller_shutter_controller_2_level_2.attributes.current_position }}"

automation:
  - alias: "Aggiorna posizione tenda soggiorno"
    trigger:
      platform: state
      entity_id: sensor.posizione_tenda_soggiorno
    action:
      service: input_number.set_value
      data_template:
        entity_id: input_number.posizione_tenda_soggiorno
        value: "{{ (states.cover.fibaro_system_fgrm222_roller_shutter_controller_2_level.attributes.current_position) | int }}"
  - alias: "Setta posizione tenda soggiorno"
    trigger:
      platform: state
      entity_id: input_number.posizione_tenda_soggiorno
    action:
      service: cover.set_cover_position
      data_template:
        entity_id: cover.fibaro_system_fgrm222_roller_shutter_controller_2_level
        position: "{{ states('input_number.posizione_tenda_soggiorno') | int }}"

any suggestion to drop the level updates when the level is set to the slider?

I use a slider for volume, and it always sends a double signal but still works as expected. The only way I can think of that can get you around this issue would be to write your automation in appdaemon. When I ported the volume slider automation into appdaemon, I was able to set flags to ensure that the slider didn’t send more than 1 service.

BTW, why not introduce such a slider to the regular cover widget? Its’s a very common feature and I was a little bit frustrated it isn’t already there. I guess its just up to a little frontend cover component modification to include such a slider when cover position data is available? I’ll take a look little bit later.

Have you find the solution?

No… :confused:

@blackgear

A solution is to check the state of the slider and cover position before setting.

If they are equal, don’t set. Add that in every automation and it will remove the feedback loop.

  - alias: "Setta posizione tenda soggiorno"
    trigger:
      platform: state
      entity_id: input_number.posizione_tenda_soggiorno
    condition:
      - condition: template
        value_template: "{{ states('input_number.posizione_tenda_soggiorno') | int != state_attr('cover.fibaro_system_fgrm222_roller_shutter_controller_2_level', 'position') | int }}"
    action:
      service: cover.set_cover_position
      data_template:
        entity_id: cover.fibaro_system_fgrm222_roller_shutter_controller_2_level
        position: "{{ states('input_number.posizione_tenda_soggiorno') | int }}"

EDIT: To clarify, on pass 1 when you first move the slider or change the position, they aren’t equal and it will set the position / move the slider. On the feedback loop where the slider now moves because the position moved, they will be equal and the position will not be set.

2 Likes

Petro,
Is this a theoretical solution or do you have this working? I’d like to get a slider for my curtains…

It works as a volume slider. I would assume it would be the same way for a cover as long as the cover reports a position.