@triggertact - take a look at my post on creating virtual switches that execute smartapps -
This should help lead you in the right direction.