@szaky: yes if possible I suggest that you use a separate power supply for the rain detector, to see if it make any difference. Generally rain sensor events are also logged so you can check the log to see if there have been rain events which resulted in the program stopping running.