@Danhiel said:
BinarySwitchSleepSensor.ino
If the sleep you mention, is the one to let your buttons settle as the code in this example, line100. then it's "just" to let your buttons settle, to handle the contact/switch bounce
// Short delay to allow buttons to properly settle
sleep(5);
https://github.com/mysensors/MySensors/blob/development/examples/BinarySwitchSleepSensor/BinarySwitchSleepSensor.ino