Cover Template + Set Cover Position Not Working

Dear all,
I’m really tired now.

I have to tags:
From home assistant to PLC - input_number.rol_goscinny1_poz - which sending new cover position to PLC
From PLC to HA - input_number.rol_goscinny1_poz_feedback - which giving to home assistant information about current position of cover.

Now its working like that - I need additional slider below cover because original slider is not working.
image

And I have now now Idea how to push template to work with my tags to PLC…

      goscinny1:
        device_class: window
        friendly_name: "Roleta Gościnny 1"
        position_template: >
          {{ states('input_number.rol_goscinny1_poz_feedback') | int }}
        open_cover:
          service: input_boolean.toggle
          entity_id: input_boolean.output_rol_goscinny1_otw
        close_cover:
          service: input_boolean.toggle
          entity_id: input_boolean.output_rol_goscinny1_zam
        set_cover_position:
          service: cover.set_cover_position
          entity_id: cover.goscinny1
          data:
            position: >-
              {{ states('input_number.rol_goscinny1_poz') | int }}
        icon_template: >-
          {% if states('input_number.rol_goscinny1_poz_feedback')|int < 1 %} 
          mdi:window-shutter
          {% elif states('input_number.rol_goscinny1_poz_feedback')|int > 99 %}
          mdi:window-shutter-open
          {% else %} 
            mdi:window-shutter-alert
          {% endif %}

Willl be appreciated if you help me to solve this issue.

How is the input_number.rol_goscinny1_poz_feedback getting populated? Is this number just to store the last value you sent to the shutter? Are you just trying to make an input number control your cover?

Hi, thanks for checking my issue.

input_number.rol_goscinny1_poz_feedback is from current real position of shutter from PLC. So if you move shutter up or down position from wall button - it will also change, so its updated when real position of shutter change.

Are you updating that via an automation?

It’s on modbus communication through Nodered - Updating on value change…

Ok, and does this automation send the input_boolean position to the modbus register? I.e. does it send and receive off the input_booelan?

EDIT: Nevermind, I see you’re using another one

This should work

      goscinny1:
        device_class: window
        friendly_name: "Roleta Gościnny 1"
        position_template: >
          {{ states('input_number.rol_goscinny1_poz_feedback') | int }}
        open_cover:
          service: input_boolean.toggle
          entity_id: input_boolean.output_rol_goscinny1_otw
        close_cover:
          service: input_boolean.toggle
          entity_id: input_boolean.output_rol_goscinny1_zam
        set_cover_position:
          service: input_number.set_value
          target:
            entity_id: input_number.rol_goscinny1_poz
          data:
            value: "{{ position }}"
        icon_template: >-
          {% if states('input_number.rol_goscinny1_poz_feedback')|int < 1 %} 
          mdi:window-shutter
          {% elif states('input_number.rol_goscinny1_poz_feedback')|int > 99 %}
          mdi:window-shutter-open
          {% else %} 
            mdi:window-shutter-alert
          {% endif %}

Its working!

Believe I tried with this value “position” but maybe to wrong entity_id. :smiley:

A now I see - different service!!! That was the issue.

Nevertheless - you found the bug and many thanks.
Topic can be closed.

1 Like