RPC
bOS Offers a JSON RPC (Remote Procedure Call protocol) Service for integration of bOS Server with other systems. The RPC service can be enabled, configured and controlled under API node and RPC subnode.
Table of contents
RPC settings, information and online tool
The firewall exceptions must be set manually in Windows OS. RPC service on the new bOS offers HTTP basic authentication with username, and password.
Excellent online tool for checking, editing and JSON responses is:
https://jsonlint.com/
URL Structure
When creating the URL, the Object Name must contain the full path to the device or object in the configuration.
Use the provided example URL as a template, then replace the example object path with the actual path of the device you want to control or read.
Make sure the object path matches the device location in the configuration tree. If the path is incorrect, the URL will not point to the correct object.
RPC also allows us to communicate between different bOS Servers. This feature can be very useful for a centralized overview of a building with multiple servers or multiple projects. Step by step tutorial:
https://www.youtube.com/watch?v=QnZDu8-x9m8Get value command
To call an RPC Service an HTTP POST call must be performed with data content-type = "application/json";
POST data example (Receive data from another controller):
ComfortClick RPC URL:
https://RPC_username:RPC_password@server_ip_address/API/RPC/GetValue
POST data example (Get light status):
{
"objectName": "Devices\\KNX\\Light 1",
"valueName": "Value"
} Set value command
To call an RPC Service an HTTP POST call must be performed with data content-type = "application/json";
POST data example (Send data to another controller):
ComfortClick RPC URL:
https://RPC_username:RPC_password@server_ip_address/API/RPC/SetValue
POST data example (Turn ON a light):
{
"objectName": "Devices\\KNX\\Light 1",
"valueName": "Value",
"value": "true"
} POST data example (Turning ON two lights):
{
"parameters": [
{
"objectName": "Devices\\KNX\\Light 1",
"valueName": "Value",
"value": "true"
},
{
"objectName": "Devices\\KNX\\Light 2",
"valueName": "Value",
"value": "true"
}
]
} POST data example (Send alert to user):
{
"objectName": "Building\\General\\Users\\User",
"functionName": "SendAlert",
"value": ["'Hello'"]
} POST data example (Change string value):
{ "objectName": "Devices\\Keypad\\Basic\\String", "valueName": "Value", "Value": " 'Open' " } POST data example (Change Mode value to 1):
{
"objectName": "Devices\\Keypad\\Basic\\Mode",
"valueName": "Value",
"value": "{\"Mode\":1}"
} RPC Call function command
To call an RPC Service an HTTP POST call must be performed with data content-type = "application/json";
POST data example (Send data to another controller):
https://RPC_username:RPC_password@server_ip_address/API/RPC/CallFunction
POST data example (Run a program):
{ "objectName": "Devices\\KNX\\Program", "functionName": "RunFromClient" }
POST data example (Start presence simulator):
{ "objectName": "Devices\\KNX\\Presence Simulator", "functionName": "StartSimulation" }