Have you checked the .rdd file for the available outputs related to blinds and shading? You may find what you need there without having to write an EMS routine.
.rdd