Have you seen the video collection here -> http://www.mysensors.org/about/videos There is one called "Combining MySensors example sketches" maybe it can be helpful for you.