Jump to content


Photo
- - - - -

will this event work?


  • Please log in to reply
4 replies to this topic

#1 dogbone

dogbone

    Newbie

  • Registered
  • Pip
  • 7 posts

Posted 29 March 2018 - 11:30 AM

I'm trying to keep the notification from occurring in a short time frame 5:30-6:20am, but work all other times
 
 
WHEN DRIVEWAY SENSOR NOT READY
   AND IF TIME IS GREATER THAN 12:01 AM 
   AND IF TIME IS LESS THAN 5:30 AM 
OR
  AND IF TIME IS GREATER THAN 6:20 AM 
THEN SHOW CAR ON DRIVEWAY WITH BEEP
 
 
I also think I need something to remove the message from the console.
 
 
 


#2 ano

ano

    Cocoonut

  • Registered
  • PipPipPipPip
  • 3263 posts
  • Location:AZ
  • Experience:guru
  • Hardware:HAI OmniPro II
  • Tech:UPB, ZigBee
  • Audio:HAI
  • Phone:Ooma

Posted 30 March 2018 - 01:01 PM

I'm trying to keep the notification from occurring in a short time frame 5:30-6:20am, but work all other times
 
 
WHEN DRIVEWAY SENSOR NOT READY
   AND IF TIME IS GREATER THAN 12:01 AM 
   AND IF TIME IS LESS THAN 5:30 AM 
OR
  AND IF TIME IS GREATER THAN 6:20 AM 
THEN SHOW CAR ON DRIVEWAY WITH BEEP
 
 
I also think I need something to remove the message from the console.

Should work.  There are a few ways to do this. You didn't give your model number, but you probably have three timers you can use as well.  You set the start time and the end time, and the timers turn off and on. You could use one to control is your message is displayed or not.

 

As you get more things going, you will find your code is more readable and easier to maintain using flags instead of using times for each actions.  For example, you could create a flag called "DriveMon" or something like that, and have the flag turn on and off at the appropriate time every day. Then you can just test for the flag in your action.  It may not make your code any shorter, especially if you just test for this time condition once, but it makes it easier to debug when you have lots going on.



#3 iceverything

iceverything

    Cocooner

  • Registered
  • PipPip
  • 14 posts

Posted 31 March 2018 - 11:53 PM

I agree with Ano.  I would use a flag.

Timed 6:20 AM MTWTFSS 

      Then Driveway Sensor Flag on

Timed 5:30 AM MTWTFSS

       Then Driveway Sensor Flag off

When Driveway Sensor Zone NOT READY

        And if Driveway Sensor Flag on

        Then Show Car on Driveway with Beep

 

 



#4 dogbone

dogbone

    Newbie

  • Registered
  • Pip
  • 7 posts

Posted 01 April 2018 - 10:45 PM

Thank you for your replies. I have not used flags much but see how they can be very useful. I have reworked my code in order to turn a driveway flag on at 12am, then turn it off for one hour at 5:30 am. Then have the message and beep occur if the the sensor is not ready and the flag is on. 

 

the purpose is to keep the message and beep from occurring when my son leaves for work between 5:45 and 6:15 am. I'll find out tonight if it works.



#5 dogbone

dogbone

    Newbie

  • Registered
  • Pip
  • 7 posts

Posted 02 April 2018 - 09:31 AM

It worked great! 

 

I have my system set up to beep when a perimeter door is opened. Is there any way to have that bypassed during this same one hour period? The only way I can think of doing it would be to turn off the HAI notification setting and simply write a line of code for each zone that is on a perimeter door. Then use a similar code as the driveway sensor.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users