API error in room light monitoring using Z-score analysis


i am getting api rate limit error after 12 samples and i am not getting initial frame size count as given in module.please someone help me asap.my code in this pic.

in the last condition you forgot to add else

try:
if sensor_value > bound[0] :
print (“The light level increased suddenly. Sending an SMS.”)
response = sms.send_sms(“Someone turned on the lights”)
print("This is the response ",response)
elif sensor_value < bound[1]:
print (“The light level decreased suddenly. Sending an SMS.”)
response = sms.send_sms(“Someone turned off the lights”)
print("This is the response ",response)
history_data.append(sensor_value);
except Exception as e:
print (“Error”,e)
time.sleep(10)

this is how your code suppose to be because if the light value is below threshold it suppose to send the sms