@y4CdW42Ol8
Have a look at the examples as supplied with the mySensors library. Both ways are implemented extensively.
The gw.sleep(...) function will be the way to go for the 12 hrs. you'd like to put the sensor asleep. This is used in many examples
For waking up with interrupt have a look at the example for the power meter. It wakes up the sensor when an interrupt occurs.
Be my guest to find your own way of programming this, but as @mfalkvidd already pointed out: MySensors has its own functions!
Good luck,
Boozz.