Until now I have a blind stay closed each day until 14:00 when the sun passes over the roof, to protect some delicate wooden furniture.
But I want to automate the blind so that it only stays closed if cloud cover is less than 80%, based on AccuWeather data, between the hours of 07:00-14:00.
I have sorted the AccuWeather API & integration, but I don’t know how to organise the code so that the curtain either doesn’t open & remains closed 07:00-14:00 if the cloud cover is <81 OR closes between 07:00-14:00 IF the cloud cover drops to <81.
That code isn’t going to open the cover at all, and will close it at 07:00 regardless of cloud cover or at any time the cloud cover changes from above 81 to below 81 (triggers are OR).
Just add conditions to check for cloud cover at 07:00, and to prevent it from operating outside 07:00 to 14:00 (e.g. 15:00 with low cloud cover) (conditions are AND):
If cloud cover at 07:00 is <81% the cover remains closed*** OR closes anytime between 07:00-14:00 if the cloud cover drops below 81% between 07:00-14:00
If cloud cover at 07:00 is >81% the cover opens*** AND opens anytime between 07:00-14:00 if the cloud cover goes above 81% between 07:00-14:00