No no, my intention is just to send the pulse count, every 10 or 15 minutes, with battery powered sensor (and resend the last value even if it not change, due to domoticz not reporting heartbeat, but that is another story )
Hourly and daily value are ok for me.
I was using this sketch as an example just to see how it work and if it could directly do the job.
I enabled sleep_mode.
I was doing that with a testing arduino, directly connected to radio with jumper, and using jumper to simulate reed.
Each time I was doing a pulse that way, the node send the information directly. I was not understanding why. So I run a minimal sketch to try to understand, and I found this thread ...
Finally with all those informations, i think i'll do something like that:
- The loop sleeps for 1 minute, or for the reed interrupt.
- When the loop restart, it checked if the reed interrupt occured with the return value of sleep
-- if yes, it increments pulse count, waits a few ms for debounce, and continues
-- if no it continues
- every 10 loops, a msg is send with the pulse count
- every 60 loops, the battery level is checked
- and then it sleeps again for 1 minute or if the reed interrupt occurs
Thank you again for this great help