Pinkmodule

invention

Automating LittleBits with the CloudBit, CloudBit API, and Microsoft Azure

by brady.gaster

Published on December 27, 2014

This project demonstrates how to use Microsoft Azure together with the cloudBit to automate your hack project from the cloud using the LittleBits Cloud HTTP API

How To Make It

STEP 1

Log in to the Azure portal. If your subscription doesn't have any Scheduler Job Collections, create one.

STEP 2

Create a new Scheduler Job

STEP 3

Set the Action Type "HTTPS," the Method "POST," and provide the URI for the output endpoint as specified in the cloudBit API documentation (link is in description). The URI format should look like https://api-http.littlebitscloud.cc/v2/devices/[DEVICE ID]/output. Set the body of the action as the JSON payload to be sent to the API. A sample of this JSON payload is in the code section of this project to turn the light to full power for 3 seconds.

STEP 4

Once the job has been created select it in the Azure portal. On the dashboard set the content-Type header to application/json. Add a new header named Authorization, and set the value of the Authorization header to be Bearer TOKEN, but replace the word "TOKEN" with the value of the "AccessToken" from the LittleBits Cloud Control Center.

STEP 5

Set the schedule to whatever you need it to be, to make your hack do whatever it needs to do, whenever it should be doing it. In this project I've set my schedule to once per minute. If you're using this approach to schedule feeding your kitty, you may want to change this setting twice a day, for example.

STEP 6

Plug in your circuit, hook your hack up to the WiFi, and let the scheduled automation begin.

Related Projects

LEGO police alarm station

Lego construction that receives alarms  

Rube Goldberg Machine

Check it out:https://twitter.com/rdmmakerspace/status/616216721490354176https://twitter.com/rdmmakerspace/status/61621722213089280...