In order to send a command to the Home Yún, we will need to send information from one Yún to another. We achieve this by using a custom API that will send information to be stored on the server.
A different IoT-device can then read and use that information. For example, the Home Yún will get the temperature value, send it to the API, and have it stored. Then, each group’s “Control Yún” will request the temperature value via the API, interpret it, and display the appropriate color via the RGB LED. Depending on the RGB LED color/temperature, each group can decide to activate or deactivate your controllable device in the house.
This API, which we call the Short Memory API, has three different commands which you can see by copying the following text into a web browser’s address bar:
http://verkstad.cc/iot/mmx/group/index.php?variableName=variableValue
This address or “Command” is for the API to store new values.
- “group” is where the number of your group goes
- “variableName” is where the name for your variable goes.
- The “variableValue” is where the value of your variable goes
Example: http://verkstad.cc/iot/mmx/1/index.php?homeTemperature=19
http://verkstad.cc/iot/mmx/group/index.php
Command to display the current variable name and its value
http://verkstad.cc/iot/mxx/group/get_value.php
Command to display current value only
Try it a few times using your own variables and values.
Materials for the project
In order to simplify the final assembly of the group projects, you can print out the following breadboard template. The guide has been created in order to simplify the addition of final components to the breadboard. Click here to download the printable pdf template.