added the json parsing to return the switch name.