One of the shortcomings of some of the commercially availible units is they do not sense the actual curtain position, they simply count the pulley rotations. Therefore if the cord slips on the pulley, the system thinks the curtains are fully open/closed when in fact they are not.

To detect position I have used infra-red reflective opto-sensors type OPB704. These packages combine an IR LED and IR photo-transistor in one package. A white surface in front of the device will reflect IR from the LED to the opto-transistor, a black surface will not.

I have two of the devices, one adjacent to the other, pointing at the curtain pull-cord as it passes round the pulley. The pull-cord is normally white (I haven't seen any that aren't), and by marking the cord in the correct places with a black permanent marker, the 'Fully Open' and 'Fully Closed' positions can be set. See diagram:

 

 

 

Fully Closed = Opto 1 AND 2

Fully Open = Opto 2 Only

Midway = None

 

 

 

 

 

This gives the system two reference points to use as limit switches. The HA controller can also request status from the system if required.

Here's a picture of the optos mounted near the pulley: