is incorrect.
if Record == False and timer != 0: # The if only proceeds if Record = False and the timer is not 0,
# call macro that starts recording # Assuming the pir tripped the timer then Recording will start
Record = True # next loop the if wont proceed because Record is True not False even though timer is not = 0 so the macro to start will not get called again
if Record == True and timer == 0: # OK Record is True but until the timer = 0 nothing happens
# call macro that stops recording # when the timer =0 the Recording stops
Record = False # The only time Record = False again is when the timer = 0 then of coarse the first if statement will only proceed if the timer is not 0 ie when the pir trips again