New #IoT ScrollBack Widget in the blog

Just tell me if its irritating or not.

But then when did I have any loyal readers.
comments

Integrate Carriots with Zoho Reports Tutorial

The Carriots Tutorial on Zoho integration is slightly outdated. Zoho Reports have already changed the way their API works. Instead of required two separate API keys as mentioned in their tutorial, you now need only one.


This is a really crude tutorial, but this is all you have on the Internet which WORKS!(as of today 12th March 2014). Use it in supplement to the original Carriots Tutorial.

Prepare:

1. Get a nice ticket/authentication token from here:

https://accounts.zoho.com/apiauthtoken/create?SCOPE=Zohoreports/reportsapi

after adding additional parameters of EMAIL_ID and PASSWORD to the URL.

If you forget to put these additional parameters, you will get a different API (just like me.) which wont work. If you change the scope to ZohoProjects/projectapi, well.... guess what. It wont work too.


So the flow is something is like:

1.  Go to Zoho Reports and click on New Table.
2.  Rename the first two columns as "Value" and "Time".
3.  Save the Table with an appropriate table name.
4. Click Add >Custom Formula and write "fromunixtime( "Time")" in the formula box without the red colored quotes. Name the column as 'Real'. Save it .


Now go to Carriots Device Management.

1. Click on the device and add a new listener to the device.
2. Copy the following code, but change the following parameters according to your own:

Usename e.g qm@qazimamoon.com
Database name e.g. carriots
Table Name e.g. light
Authentication token e.g abcdefg
 Also change the context.data.light to the parameter that is being sent. In addition, to display a nice graph I have included the Epoxy Timestamp that Carriots generates for the end device data reading.


import com.carriots.sdk.utils.BasicHttp;
import groovy.json.JsonBuilder;

def request= new BasicHttp();
request.url = "https://reportsapi.zoho.com/api/qm@qazimamoon.com/carriots/light?authtoken=abcdefg&ZOHO_ACTION=ADDROW&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=JSON&ZOHO_API_VERSION=1.0";
request.verb = "POST";
request.headers = ["Content-Type": "application/x-www-form-urlencoded"];
request.payload= "&Value="+context.data.light+"&Time="+context.envelope.at;

request.send();


Refresh the table inside Zoho Reports to see if its working properly or not. It should roughly look like this:




To start making beautiful graphs of the Carriots Data:

1. Click on new report, and select the appropriate table.
2. Drop the x and the y axis into the appropriate field.
3. Generate the Graph, and then save it with a suitable name.
4. Click publish, and select URL/Permalink
5. Change the mode so that a login is not required.
6. Copy the URL and attach to an IFRAME.


Tadaa!!



Thank me Later!

PS (Read Slowly) : Oh and if you think you cant change the graph after you have embedded it, don't rename the Graph in ZOHO to HURRAAAYYY I DID IT!!



comments

My work desk temperature

This is for my mom. She always wanted to know how cold it is here in MIMOS. One full working day in the cold air of the air-conditioner. The timezone however, highlights the Spanish timezone instead.

To convert to KL time, add 5 to the hour reading.

To convert to Indian time,  add 2 to the hour reading, and 30 minutes to the.. well.. minute reading.


Temperature is in degree Celsius.

#IoT










comments