Since rev7 you can tell if something is connected in line in with the SR node
Which goes to the port expander
Give this a C and python api.