Thank you @eiten for you suggestion. I will try it. I wanted to be independent from HA, just as a fail safe in case of problems. I am not relying on the time keeping of the arduino, but on a real time clock module.