Determining Blind State

Hi all.

I have a “dumb” motorized blind, that i mostly control via HA using a sonoff RF bridge, tasmotized and portisch’d. The control works pretty well.

The issue is determining the blind state.
I have a door sensor at the bottom, which sometimes works but not always, as the blind is slightly longer than the window, so it doesnt always stop in the exact same spot.

The door sensor gives me closed and open, but not how open it is.
I tried an aqara vibration sensor as i thought that might record movement up or down, but it didnt seem to give me any changes when i moved it around without rotating it.

Can anyone suggest a battery powered sensor, ideally zigbee, that could be used to help determine how open/closed the blind is ? Maybe some kind of distance/ultrasonic sensor?

Solutions I’ve seen just count time while the motor is running, combined with a setting how log it takes to fully open or close (both times can differ as gravity is a factor too). Hardware wise is hard.Maybe a pulse count on the rotating part? what if you put a door sensor near the top and one or more magnets on the turning part? then maybe you could count magnets passing by while it rotates.

Reminds me of the optical / IR pulse sensors old kinds of computer mouses had (those with a ball that would rotate a two-axis structure compared to the optical mouses we know today).