Compare commits

...

2 Commits

Author SHA1 Message Date
Ian Adam Naval
4ab145c62a Tweak thresholds and sliding window size
Increasing sliding window size makes it less sensitive to change, which
makes it take a little longer to register that the dryer is on. This
allows for short bursts of acceleration due to opening/closing the door
and loading clothes.
2015-09-12 01:28:08 -04:00
Ian Adam Naval
b83c342a81 Fix minor formatting issue 2015-09-12 01:27:47 -04:00

View File

@ -11,7 +11,8 @@ from microstacknode.hardware.accelerometer.mma8452q import MMA8452Q
EMAIL_USERNAME = 'noreply@ianonavy.com'
EMAIL_PASSWORD = 'S2PENjQbO6=cHgchw@CXs.bJ'
RECIPIENT_EMAILS = [
'ianonavy@gmail.com', 'dmurvihill@gmail.com',
'ianonavy@gmail.com',
'dmurvihill@gmail.com',
'5038304363@tmomail.net'
]
ALERT_EMAIL_TEXT = """Hi,
@ -23,8 +24,8 @@ Ianonavy Bot
"""
G_RANGE = 2
INTERVAL = 0.005 # seconds
WINDOW_SIZE = 40 # intervals
THRESHOLD = 0.003 # G's
WINDOW_SIZE = 1000 # intervals
THRESHOLD = 0.025 # G's
MAX_EMAIL_FREQUENCY = 60 # seconds
@ -102,7 +103,7 @@ def main():
g_values = accelerometer.get_xyz()
enqueue(sliding_window, g_values)
sliding_stdev = amplitude_stdev(sliding_window)
print(sliding_stdev, dryer_state) # for debugging
print(sliding_stdev, dryer_state, len(sliding_window))
# don't send emails right at the beginning
if g_values:
if sliding_stdev['x'] < THRESHOLD: