Set_cover_position from input_number

Hi everyone,
I’m going crazy trying to set_cover_position for my covers.

Here’s the scenario:

I’ve set up cover templates for my covers.
Command UP/STOP/DOWN are working perfectly.

Then, using Node Red, since my covers don’t have position sensors, I created some functions to get position using time (i.e. if a cover needs 20 seconds to open, in node red I use a input_number of 50 to open for 10 seconds).

Now, I’d like to use that input_number to set_cover_position (and use the slider in Lovelace).
I tried like that:

[...]
set_cover_position:
  service: input_number.set_value
  target:
    entity_id: input_number.cover_set_position
  data: "{{ states('input_number.cover_set_position') }}"

I also tried many other ways, but still can’t understand what’s the point: could anyone give me a hint?
Thanks everyone

set_cover_position:
  service: input_number.set_value
  target:
    entity_id: input_number.cover_set_position
  data: 
    position: "{{ states('input_number.cover_set_position') }}"
1 Like

Wouldn’t this create interference if it is the same input number? Node red setting the position in the input number and the template doing the same? I’d expect you would want to put a script here starting and stopping the blind with a delay inbetween. And then node red would calculate the rew input number.

Yeah. That won’t work. I didn’t notice it when I copy/pasted the code. I was just pointing out the lack of the position data key.

Ok…
let’s say I have an input_number.cover_position that gives me the position of the cover (retrieved from node red) and an input_number.cover_setposition that I use to command the cover (which I use to trigger a node red node to set position)…something like property get and property set in programming languages.

Could this help making set_cover_position work?
How?