Re: [userModule] Virtual Rain Sensor (Updated 2016/01/08)
Posted: 10 Jun 2016 21:20
I've been looking at the way the module works and it appears to check it's status every 15 minutes. That being the case, I'm considering piggybacking the timer that's already in the module with a boot persistent entry in the metrics that adds the delay time to the current time and then compares it each pass through to determine if it's timed out of the delay cycle. If the program has been restarted and the delay timer has been lost, the most the delay time would be off by is 15 minutes. Needless to say, for a rain delay on an irrigation system, this isn't a big deal. If the system hasn't been restarted, then the original timer would clear the delay and all would be good. Does this sound reasonable? I thought about a way to reset the timer on restart but I'm just not sure it's that important...
Update - I thought about it a bit more and determined that it would be easy enough to catch this early in the process and actually restore the timer, thereby not altering the function of the original module much at all. I'm testing the modifications now...
After a little scratching of my head over something I should have caught early, I have it working the way I expected. I justhink need a rain event now to finish the testing phase. I'd like to offer the changes to you to include in the official module as I'd really rather not have to update this version as you update yours.
Update - I thought about it a bit more and determined that it would be easy enough to catch this early in the process and actually restore the timer, thereby not altering the function of the original module much at all. I'm testing the modifications now...
After a little scratching of my head over something I should have caught early, I have it working the way I expected. I justhink need a rain event now to finish the testing phase. I'd like to offer the changes to you to include in the official module as I'd really rather not have to update this version as you update yours.