This might not be a perfect answer, but: You may first try to analyse the Power Meter Pulse Sensor. It's quite easy to understand, what it does - despite it uses an interrupt service routine you may not need. This may be helpful to understand how communication between node and controller is organized and timing of data sending for non-sleeping modes can be achieved. You may then just put your code into this basis - just add your parts wrt. measuring and delete the not needed parts (or make them comment first). Some further remarks: There is the rather complex Rain Gauge sketch with a lot of options that may be confusing at first sight. This may already be prepared to do most things you may want to do. In Most cases, it's easier to do the statistics part on controller side and just let the nodes report small "snapshots". So resetting the counter and use an RTC is not necessary... I don't have the link at the moment, but there also exists a small example, how to combine sonsors. I also found this helpful to understand how to convert standard arduino code with MySensors functionality.