-
Notifications
You must be signed in to change notification settings - Fork 88
Intro to Internet of Things: Labs
Welcome to the IoT lab! This time, we're going to be using If This Then That (IFTTT) to build some complex systems on the internet.
Firstly, head over to IFTTT and create an account. If you've got a cellphone that supports it, install the IFTTT app, and sign in there as well.
Investigate some basic IFTTT recipes. Read about applets and services on the about page. Create some simple recipes: here are some fun examples:
- Cold tomorrow? Notify me!
- Post a thankyou to a new twitter follower
- Cool new desktop wallpapers
- Find my phone!
Here are some more funny recipes:
Let's investigate the Mobile Notification. This applet sends you a cellphone notification every time a certain URL is accessed. We can use the python requests library to do this every time your button is pressed.
To start with, install the applet and test it out. Browse to your "maker webhooks" settings and find your account URL. Browse to the URL and test out the connection with some sample data - you should get a notification on your phone!
Now, you can use the requests library to access that URL from python!
pip install requests
Then, in the Python REPL:
r = requests.get(<the url>)Again - you should get a notification on your phone! If you don't, check the value of r.status_code - it should be '200'
This part is fun - remember how to add an event handler to your button in Python? Write some code so that when you press the button, you get a notification on your phone!
Try to send a fun message to yourself,