With aboves code I am looking for URL param schuelerid within "related_to", however I want it to be some value that is available via [wpv-attribute] to that view. How can I get the wpv-attributes value? The wpv-attributes name is "schuelerid" as well.
Looking into this a value passed to a View as a shortcode attribute isn't ordinarily available in the context of the wpv_filter_query filter, unless you actually use the passed value in a View filter.
You could add a Query Filter for a related post (it looks like that is what you are trying to do), but that won't make the passed value available to your callback added to wpv_filter_query, because Views pre-processes queries involved related posts to first apply the relationship filter and create a post__in argument in the main query that limits the possible results to only those matching the relationship filter.
But perhaps that is all you need—to add a Query Filter for your relationship where the post to filter by comes from a shortcode attribute—which means that the query you modify with the wpv_filter_query filter will have already eliminated posts that do not match the relationship requirement.