Conditions Action
The Condition action allows third-party applications to communicate with a Broadsign Control Player, activating specific pieces of content for playback on the screen.
Program conditions in Broadsign Control Administrator and associate them to either bundles or campaigns. In order for specific content to appear on your screens, circumstances must meet a specified condition on the player.
Example: Two ad copies... one to play when it is raining outside, and one to play when it is sunny. A third-party application could periodically check a weather feed and set the proper “Rainy" or “Sunny" condition in the player, causing it to display weather-sensitive content.
Call the conditions actions using one of the following:
WebSocket Server:
-
JSON – You can pass parameters from within your HTML5 file using JSON.
Note: Ensure that you select Enable Remote Control in the Remote Control tab of the configuration profile. See The Remote Control Tab.
Note: If using JSON via the WebSocket server, any firewall present on Broadsign Control Player should be configured to access port 2326 directly for use.
Port 2324:
- remote_action – An application that ships with Broadsign Control Player, using command line.
- XML – If you want to develop your own applications, you can communicate directly with Broadsign Control Player API using XML.
Note: Ensure that you select Enable Remote Control in the Remote Control tab of the configuration profile. See The Remote Control Tab.
Note: Any firewall present on Broadsign Control Player should be configured to either allow bsp.exe to open ports, or configure port 2324 or port 2326 directly for use.
Note: The Triggers Action is the only exception to this rule. It uses port 2325. See Triggers Action.
You can call this action on Windows and Ubuntu Linux, and find it along the following paths:
- Windows (64-bit):
- Ubuntu Linux:
/opt/broadsign/suite/bsp/bin/
C:\Program Files\BroadSign\bsp\bin
A condition can be toggled on a player by invoking the standalone executable remote_action which ships with Broadsign Control Player. It can be found in the player’s installation bin directory.
For example, to set a condition, type:
remote_action condition -e 1 -x 1 -n "Cloudy Skies"
Where:
- condition is the action type
- -e is for enable
- -x is for exclusive (see the exclusive parameter description)
- -n is the name of the condition.
Continuing the example above, the equivalent command to deactivate this condition would be:
remote_action condition -e 0 -n "Cloudy Skies"
When you generate a playlist after setting a condition, by default the player will keep track of all the items played. Whenever you apply that same condition, it will continue from where it left off. If you require a different behavior, and want to reinitialize the conditional playlist, then you should use a regenerate option -r:
remote_action condition -r 1 -e 1 -n "Cloudy Skies"
List all Active Conditions on a Player:
The following allows you to list all conditions active on a player:
remote_action condition --la
A custom application can set and remove conditions on Broadsign Control Player by sending an XML message to the monitor_remote port (2324).
<rc version="1" id="1" action="condition" exclusive="1" enabled="1" name="cloudy"/>\r\n\r\n
Note: You must terminate the request with \r\n\r\n
.
The player will respond with the following document:
<rc id="1" version="1" action="condition" status="1"/>
Note: Each command sent requires a unique identifier (id). The application can use a simple incrementing value here.
When you generate a playlist after setting a condition, by default the player will keep track of all the items played. Whenever you apply that same condition, it will continue from where it left off. If you require a different behavior, and want to reinitialize the conditional playlist, then you should use the regenerate option:
<rc version="1" id="1" action="condition" enabled="1" name="cloudy" regenerate="1"/>\r\n\r\n
List all Active Conditions on a Player:
You can create a custom application to list all active conditions on a player. Send an XML message to the monitor_remote port (2324):
<rc version="1" id="1" action="condition" list_active="1" />\r\n\r\n
The player will output the following XML document:
<?xml version="1.0"?>
<active_conditions>
<condition id="12323" name="Sunny"/>
<condition id="13323" name="Warm"/>
</active_conditions>
Conditions Action - XML Parameters
Note: Any firewall present on Broadsign Control Player should be configured to either allow bsp.exe to open ports, or configure port 2324 or port 2326 directly for use.
Parameter | Description |
---|---|
version | The version is always 1. |
id | Contains the identifier of the request. |
action | The kind of action to be taken; always condition. |
enabled | Set to “0" to disable the condition; set to “1" to enable the condition. |
name | The name of the condition to set. This must match the name of the criteria in Broadsign Control Administrator. Condition matching is case insensitive; however, white space must be exact. |
regenerate | If set to "1", this parameter enables you to reinitialize the playlist with the same condition. |
exclusive |
If set to "1", after generating the loop, the player will strip out all slots that are without this condition.
For more information, see Criteria and Conditions and Playlist Generation. |
list_active | Use this parameter when you want to list all conditions on the player. |
A custom application can set and remove conditions on Broadsign Control Player by sending a JSON message to port 2326. You will need to enable the WebSocket server. For more information, see The Remote Control Tab.
{
"rc": {
"version": "1",
"id": "1",
"action": "condition",
"exclusive": "1",
"enabled": "1",
"name": "cloudy"
}
}
The player will respond with the following document:
{
"rc": {
"id": "1",
"version": "1",
"action": "condition",
"status": "1"
}
}
When you generate a playlist after setting a condition, by default the player will keep track of all the items played. Whenever you apply that same condition, it will continue from where it left off. If you require a different behavior, and want to reinitialize the conditional playlist, then you should use the regenerate option:
{
"rc": {
"version": "1",
"id": "1",
"action": "condition",
"enabled": "1",
"name": "cloudy",
"regenerate": "1"
}
}
List all Active Conditions on a Player:
You can create a custom application to list all active conditions on a player. Send a JSON message to the WebSocket server (port 2326):
{
"rc": {
"version": "1",
"id": "1",
"action": "condition",
"list_active": "1"
}
}
The player will output the following JSON document:
{
"active_conditions": {
"condition": [
{
"id": "12323",
"name": "Sunny"
},
{
"id": "13323",
"name": "Warm"
}
]
}
}
Conditions Action - JSON Parameters
Note: If using JSON via the WebSocket server, any firewall present on Broadsign Control Player should be configured to access port 2326 directly for use.
Parameter | Description |
---|---|
version | The version is always 1. |
id | Contains the identifier of the request. |
action | The kind of action to be taken; always condition. |
enabled | Set to “0" to disable the condition; set to “1" to enable the condition. |
name | The name of the condition to set. This must match the name of the criteria in Broadsign Control Administrator. Condition matching is case insensitive; however, whitespace must be exact. |
exclusive |
If set to "1", after generating the loop, the player will strip out all slots that are without this condition.
For more information, see Criteria and Conditions and Playlist Generation. |
regenerate | If set to "1", this parameter enables you to reinitialize the playlist with the same condition. |
list_active | Use this parameter when you want to list all conditions on the player. |