If your condition is true,
- set a timer (based on millis()) once,
- set a flag that the timer is started
You will have to incorporate the flag in the condition
If the condition is false
- reset the flag
If the flag is true
- check the millis() time to see if a certain duration has lapsed and take the desired action.
Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project
See About the Installation & Troubleshooting category.