Tring to Get a Macro to Run between a time range

Started by spacenut, February 10, 2023, 08:46:50 AM

Previous topic - Next topic

spacenut

Can someone Please try to help me with this. I want to run a macro only between the hours of 21:00 and 07:00. I tried every which way to do this but i cannot get it to work. Attached is a picture of the trigger code, The way it is written it works all the  time but when I try to enter a time range I cannot get it to work. Can some tell me what the trigger code should look like?
Thank You

brobin

I know absolutely nothing about HG programming so this may not apply, but in some systems crossing over midnight can be a problem. So instead of "21:00 to 07:00" as one range, maybe "21:00 to 23:59 OR 0:00 to 07:00" stated as two ranges might be worth a try.
Like I said, this is just a shot in the dark.

petera

#2
Read this. It will explain in simple terms what you are trying to do. Just copy/paste this link into your browser bar

old.homegenie.club:8080/www.homegenie.it/forum/index9d63.html?topic=2231.0

petera

Familiarise yourself with the Scheduler https://homegenie.it/content/docs/scheduling/
It covers all the automations that can be created based on times. You can also write simple C# scripts to perform automations based on conditions. There’s plenty of examples of these in the Demo programs that come with Homegenie.