Inspiration

Major League Hacking is my inspiration.

What it does

It send message when the the room temperature crosses threshold.

How we built it

I built it using python and twilio api.

import conf

from boltiot import Sms, Bolt

import json, time

minimum_limit = 300

maximum_limit = 330

mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)

sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)

while True:

print ("Reading sensor value")

response = mybolt.analogRead('A0') 

data = json.loads(response) 

print("Sensor value is: " + str(data['value']))

try:

    sensor_value = int(data['value'])

    if sensor_value > maximum_limit or sensor_value < minimum_limit:

        print("Making request to Twilio to send a SMS")

        response = sms.send_sms("The Current temperature sensor value is " +str(sensor_value))

        print("Response received from Twilio is: " + str(response))

        print("Status of SMS at Twilio is :" + str(response.status))

except Exception as e:

    print ("Error occured: Below are the details")

    print (e)

time.sleep(10)

Challenges we ran into

It was a fun challenge.

Accomplishments that we're proud of

I am proud of taking this challenge.

What we learned

I learned python and using twilio api.

What's next for Use the Twilio API

I will use some more features of twilio api.

Built With

Share this project:

Updates