Roller shutter comfort control

I hope someone can help me. I come from IOBroker and have now switched to HA. And still struggling with the Node Red automations for my shutters. At the IOBroker there was a nice adapter that regulated everything. I didn’t find anything like that at HA.

Basic task of my automation that I would like to have

Lowering the shutters according to the lux value from the light sensor 5 lux each shutter with an offset of 30 seconds (I managed to do that)

Raising the roller shutters according to the lux value from the light sensor 12 lux each roller shutter with an offset of 30 seconds (I managed that)

Here, however, I have the problem that if the value Lus is over 5 in the morning and I want to close the roller shutter because it is blinding or something, it then automatically starts up again because the sensor shows over 5 lux.

Now the challenges come for me where I don’t know how to realize it:

The patio door also has a rotary handle sensor, here I would like the roller shutters to go down completely in the “closed” position, down to a certain value in the “tilt” position, and not down in the “open” position. If I then close the open door and the rotary handle sensor is now in the “closed” position, the roller shutter should go all the way again, the same if I change from the “tilt” to closed position. And when I move the roller shutter to a certain value from the “closed” to “tilt” position.

All other windows have a window contact with only “open” and “closed” value, and here I would have a similar scenario that when the window is “open” then moves down to a certain value and when it is closed then closes completely.

If the roller shutter is closed in a window and I open the window, the respective roller shutter opens to a certain value.