Please login or register.

Login with username, password and session length

Author Topic: Tring to Get a Macro to Run between a time range  (Read 3840 times)

spacenut

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 24
Tring to Get a Macro to Run between a time range
« on: February 10, 2023, 08:46:50 AM »

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
Logged

brobin

  • Hero Member
  • *****
  • Helpful Post Rating: 160
  • Posts: 1460
Re: Tring to Get a Macro to Run between a time range
« Reply #1 on: February 10, 2023, 12:40:29 PM »

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.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Tring to Get a Macro to Run between a time range
« Reply #2 on: February 10, 2023, 05:15:15 PM »

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
« Last Edit: February 10, 2023, 05:36:05 PM by petera »
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Tring to Get a Macro to Run between a time range
« Reply #3 on: February 10, 2023, 05:47:47 PM »

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.
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.