We are continuing in siman 9, which discusses the concept of mitzvos tzrichos kavana.
The Chayei Adam writes that even according to the opinions that mitzvos do not require kavana, if one has explicit intent that they are not fulfilling a mitzvah, they are not yotzei.
Tosfos and the rishonim grapple with the question that when wishes to fulfill the mitzvah of arba minim, they should not make the bracha until they have the arba minim in their hands, so that when they make the bracha, they are over le’asiyasan, they are only one step away from performing the mitzvah and immediately able to perform it. If they make the bracha before picking up the arba minim, it is called over d’over, because they are a step before performing it. On the other hand, the moment one picks up all arba minim, they are yotzei, so if they try to hold the arba minim in their hands while making the bracha, they have already been yotzei and the bracha is no longer relevant.
The rishonim give three solutions to this question. The first, which is the most common nowadays, is to hold the esrog shelo kederech gedeilaso for the duration of the bracha. The halacha is that in order to be yotzei the mitzvah of arba minim, they must be used in the direction in which they grow. An esrog grows with the pitom facing upwards (until it nears completion, at which point it sags, but its natural growth process is upwards). Thus, if one holds the esrog shelo kederech gedeilaso, they are not yotzei, so they can make the bracha and then turn it to the correct direction.
Another answer is that even though one has been yotzei, since they have not yet performed na’a’nuim, it is considered as though one is still oseik in the mitzvah.
Tosfos gives a third answer, that one should have kavana not to be yotzei until after they make the bracha. Tosfos writes that this answer works according to the opinion that mitzvos tzrichos kavana, but asks how it would work according to the opinion that mitzvos ain tzrichos kavana. He answers that even according to the opinion that mitzvos ain tzrichos kavana, if one has kavana hafachis, kavana to the opposite (i.e., not to be yotzei), they are not yotzei. This answer is accepted by the Rosh and Tur as well. Thus, the Chayei Adam concludes from here that if one has explicit kavana not to be yotzei with any mitzvah, they are not yotzei.
Hence, we see that this opinion agrees that intent is important, just that theyhold that the very nature of the mitzvah action carries an intrinsic intent in it. This opinion understands that, by default, a mitzvah-action is presumed to be a mitzvah, and one is yotzei regardless of their kavana, because the kavana is not needed to turn the action into a mitzvah. However, when one has kavana that they should not be yotzei, they are affecting the very action, and deciding to make the action into an action which is not a mitzvah.
According to all opinions, if one has explicit intent that they are not fulfilling a mitzvah, they are not yotzei.