Editing Online Thermometer

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 281: Line 281:
  
 
==== 6th Step: Publish temperature readings in Ducksboard from Carriots server ====
 
==== 6th Step: Publish temperature readings in Ducksboard from Carriots server ====
In this final step, Carriots server publishes temperature readings in the dashboard that we just created. To do this, Carriots uses  [http://dev.ducksboard.com/apidoc/slot-kinds/ Ducksboard's http API].
+
In this final step, the Carriots server publishes temperature readings in the dashboard that we just created. To do this, Carriots uses  [http://dev.ducksboard.com/apidoc/slot-kinds/ Ducksboard's http API].
  
Carriots platform lets you define "listeners", blocks of code that are excuted when certain events are triggered (e.g. the reception of a new sensor reading). This code is run in the cloud server of Carriots and is written in "groovy", a dynamic language based on the Java Virtual Machine (JVM). A listener is esentially a rule based on the result of a condition: if A then do B; otherwise do C.
+
Carriots platform lets you define "listeners", blocks of code that are excuted when certain events are triggered (e.g. the recption of a new sensor reading). This code is run in the cloud server of Carriots and is written in "groovy", a dynamic language based on the Java Virtual Machine (JVM). A listener is esentially a rule based on the result of a condition: if A then do B; otherwise do C.
  
 
[[File:Carriots_listener.jpg]]
 
[[File:Carriots_listener.jpg]]
Line 291: Line 291:
 
* Name: the name of the new listener (e.g. "temperatureDucksboard")
 
* Name: the name of the new listener (e.g. "temperatureDucksboard")
 
* Description: text explaining the function of the listener (e.g. "send temperature readings to Ducksboard")
 
* Description: text explaining the function of the listener (e.g. "send temperature readings to Ducksboard")
* Entity type: ''Device'' (this indicates that the listener applies only to a device)
+
* Entity type: ''Device'' (e.g. "This indicates that the listener applies only to a device")
 
* Id: select the id of the device creted in Step 3 (e.g. "TempMSM@makespacemadrid")
 
* Id: select the id of the device creted in Step 3 (e.g. "TempMSM@makespacemadrid")
 
* Event: ''Event Data Received'' (the listener will be triggered everytime a new reading is received from the selected device)
 
* Event: ''Event Data Received'' (the listener will be triggered everytime a new reading is received from the selected device)
Line 322: Line 322:
  
  
The code in the ''Then'' clause just sends two http POST requests to Ducksboard server. The payload/BODY of the requests follows the JSON format defined in Ducksboard's API. The first request is sent to ''Counter'' widget while the second one is sent to ''Timeline'' widget. There is a [https://www.carriots.com/tutorials/others_APIs/ducksboard detailed tutorial] by Carriots that explains this code.
+
The code in the ''Then'' clause just sends two http POST requests to Ducksboard server. The payload/BODY of the requests follows the JSON format defined in Ducksboard's API. The first request is sent to ''Counter'' widget while the second one is sent to ¡¡Timeline'' widget. There is a [https://www.carriots.com/tutorials/others_APIs/ducksboard detailed tutorial] by Carriots that explains this code.
  
'''Important:''' replace in the code ''your_ducksboard_api_key, your_ducksboard_PUSH_URL_counter_widget, your_ducksboard_PUSH_URL_timeline_widget'' by the corresponding values obtained in Step 5
+
'''Important:''' repalce in the code ''your_ducksboard_api_key, your_ducksboard_PUSH_URL_counter_widget, your_ducksboard_PUSH_URL_timeline_widget'' by the corresponding values onbtained in Step 5
  
Once the listener has been created, any new temperature reading received by Carriots from electricImp (Step 4) will be forwarded to the two Ducksboard widgets. Additionally the values will also be stored internally in Carriots server.
+
Once the listener has been created, any new temperature reading received by Carriots from electricImp (Step 4) will be forwarded to Ducksboard widgets. Additionally the values kill also be stored internally in Carriots server.
  
 
'''Note: ''' Temperature readings could be sent directly from electricImp agent to Ducksboard widgets without using Carriots server, but then we would lose the historical series of readings and the possibility to perform offline review and data mining.
 
'''Note: ''' Temperature readings could be sent directly from electricImp agent to Ducksboard widgets without using Carriots server, but then we would lose the historical series of readings and the possibility to perform offline review and data mining.

Please note that all contributions to Wiki Makespace Madrid may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wiki Makespace Madrid:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to type the two words you see in the box below:

Cancel | Editing help (opens in new window)