jhendric1
Mar 19, 2010, 11:03 PM
I'm trying to compute the time a door has been left opened using the compute elements and have come up with the following:
opened = _formatTime( _now() , "$I:$M:$S" )
closed = _formatTime( _now() , "$I:$M:$S" )
totaltime = closed - opened
Looking at flags in HCA, I see the opened and closed flags update with the times. Its the subtraction I cannot get to work. Totaltime always comes up 0.
What I'm trying to accomplish is if the door has been left open too long I will have a wav file play. If I can get this to work, then I'll add a total time opened for the whole day(I'm curious). BTW the door I'm talking about is the one on the refridgerator. I already have an element to count when its opened... about 80 times a day with 4 kids.
opened = _formatTime( _now() , "$I:$M:$S" )
closed = _formatTime( _now() , "$I:$M:$S" )
totaltime = closed - opened
Looking at flags in HCA, I see the opened and closed flags update with the times. Its the subtraction I cannot get to work. Totaltime always comes up 0.
What I'm trying to accomplish is if the door has been left open too long I will have a wav file play. If I can get this to work, then I'll add a total time opened for the whole day(I'm curious). BTW the door I'm talking about is the one on the refridgerator. I already have an element to count when its opened... about 80 times a day with 4 kids.