Http
Http driver in bOS is used for XML, JSON devices integration or web APIs. Any 3rd party app, device or protocol can be implemented into bOS using http driver, the device must of course have an open API, which means we're able to send/receive http commands.
Table of contents
HTTP Connection Settings
To correctly connect to the integrated device, correct Host URL must be set. If the device requires authentication, fill in the Username and Password. Under Parsing option, select the correct encoding and parsing type, depending on the device integration. For the communication, Command node must be added into bOS.
We can either use online API (ip address or dns of the online API) or local IP address of the device it'self that is sending data to bOS.
A step by step instructions, took from our online training explaining full integration of Foobot (air quality device). The video example shows integration with the device from start to finish, receiving data from the device, parsing values and using json online parsing tool for easier integration.
https://youtu.be/qGY2p9_22b0?t=4049
Command
Sending or receiving data from the device is done using our command node. All method types are supported (get, post, put) these can be selected using the metod type option. Under command option we type in our command and use headers if the command has headers.
The exact command that we need to use should be available in the manual or is the command part of the API URL. For our weather parsing integration, we're using publicly available weather API and it's URL.
We can also send the command cyclically or add a trigger that will send our command out.
HTTP Response
If the commands are configured correctly and the connected API or device responds with data, the received response can be checked in the Values field.
The Values field shows the data received by bOS from the connected device, API, or system.
This response data can then be used directly or parsed further to extract the specific value needed for the project.
For example, the received response may contain multiple values, status information, or JSON data. In this case, use the correct parser settings to extract only the required value and use it in visualization, automation logic, alerts, scenes, or schedules.
To parse the data out, we can use a online parsing tool. Very useful json parser site is https://jsoneditoronline.org/
We can paste the whole response to the left side and use the Tree function to display the whole data nicely, which will allow us to faster and easier.
Data Parsing
Very useful online parsing tool can be found https://jsoneditoronline.org/
We simply paste our API response and select the Tree option.
If we want to parse the temperature information from the API response, we need to find it in the response data. We can see that temperature information is located at the "t" value and it's value is 12.
We need to call all previous arrays in order for bOS to get to the temperature data.
"t" can be found in the "metData" array and "metData" array can be found under "data" array.
To select the array and command we want to read we need to use a comma "." in the parser.
Our command should look like this: "data.metData.t".
Any of your favorite AI agents can also be used to parse specific data out, simply describe the data you need from the whole import string and parse the specific info out.
Different Parser Options
Depending on the received data, we must use a correct data token. We can choose between Boolean, Integer, Double or String. If we stick to our example, we're parsing out temperature data from the weather API, so we will use Double as the variable. Under Token name we paste the parsed token "data.metData.t”
If everything is set correctly, if we scroll to Values area, we should get the temperature reading from the weather API.
URL Image
Any URL image can be displayed in the bOS Client, displaying current API image or current album cover, etc.
Image can be added under String parser.
Image node will automatically parse the image URL from the string parser and display it in the client. We can also set a custom URL under Values of the Image node.
A custom time for image refresh can also be set under Settings tab.
Image node can be dragged into the visualization and display the current image value.