This may sound a little left-field, but have you tried changing your washing powder/capsules/liquids and whatever soap you use to hypoallergenic ones, or changing the "scent" of the soap you use?
When my kids were babies I used cloth nappies, and my son got balanitis a couple of times. The first time I assumed infection. The second time I tried not using the couple of drops of lavender essential oil that I had been adding to the white vinegar I used in the rinse cycle to help with deodorising. It went away, but he has since had allergic reactions to lavender scented products so I must have accidentally sensitised him to lavender and triggered an allergic reaction.
If you are finding that it's intermittent for you that may suggest an allergic reaction to something rather than an infectious cause, and the things you wash yourself and your clothes with are the obvious candidates.