API v4. Acclaim Lighting PHAROS VLC, PHAROS LPC X, PHAROS TPS, PHAROS EXT, PHAROS TPC, PHAROS LPC
Реклама
Реклама
API v4
API v4
The Pharos system includes multiple API options: l l l
Lua (used internally with Conditions and Actions)
HTTP (used with external devices/software to communicate with a controller)
JavaScript (used with Custom Web Interfaces)
These APIs have been unified to simplify their use as much as possible.
Glossary:
l l l l l l l l l l l l l
Object - A collection of key value pairs e.g. "name" = "Controller 1" (syntax will differ between languages).
String - A series of characters e.g."Th1s_is-4(string)"
Number - Any whole or floating point(decimal) number e.g. 1,2,3,1.5,12.3456)
Integer - A whole number
Bounded integer - An integer with a range (e.g. 10:100 = 10%)
Float/real/number - A decimal number (e.g. 3.2 or 1.0)
JSON - (JavaScript Object Notation) a way of transferring information in the form of a JavaScript Object
GET - A HTTP method to request data from a server
POST - A HTTP method to request data in a more secure way
PUT - A HTTP method to send data to a server
Variant - See
[] - anything shown within square brackets is optional. The square brackets should be omitted if the optional section is used.
callback - A function to run when the javascript function has been run, or a reply has been received.
HTTP Requests
Please note, when a HTTP POST request is sent, it must include a Content-Type header set to "application/json", otherwise it will be treated as invalid.
API Queries
Below are the ways of getting data from the controller.
show
System
Returns data about the controller.
show
Lua
The system namespace has the following properties:
Property
.hardware_type
.channel_capacity
.serial_number
.memory_total
.memory_used
Return type string integer string string string
Return Example
"lpc"
512
"006321"
"12790Kb"
"24056Kb"
- 351 -
Pharos Designer User Manual
.memory_free
.storage_size
.bootloader_version
.firmware_version
.reset_reason
.last_boot_time
.ip_address
.subnet_mask
.broadcast_address
.default_gateway
string string string string string
DateTime object string string string string
"103884Kb"
"1914MB"
"0.9.0"
"2.7.0"
"Software Reset"
"192.168.1.3"
"255.255.255.0"
"192.168.1.255"
"192.168.1.3"
Example: capacity = system.channel_capacity
boot_time = system.last_boot_time.time_string
HTTP
GET /api/system
Returns an object with the following properties:
Property hardware_type channel_capacity serial_number memory_total memory_used memory_free storage_size bootloader_version firmware_version reset_reason last_boot_time ip_address subnet_mask broadcast_address default_gateway string string string string string string string string string
Return type string integer string string string string
Return Example
"LPC"
512
"006321"
"12790Kb"
"24056Kb"
"103884Kb"
"1914MB"
"0.9.0"
"2.7.0"
"Software Reset"
"01 Jan 2017 09:09:38"
"192.168.1.3"
"255.255.255.0"
"192.168.1.255"
"192.168.1.3"
JavaScript
get_system_info(callback)
Returns an object with the same properties as in the HTTP call
Example:
Query.get_system_info( function(system){
- 352 -
var capacity = system.channel_capacity
}
Project
Returns data about the project.
Show
Lua
get_current_project()
Returns an object with the following properties:
Property name author filename unique_id
Return type Return Example string "Help Project" string string string
"Pharos"
"help_project_v1.pd2"
"{6b48627a-1d5e-4b2f-81e2-481e092a6a79}"
Example: project_name = get_current_project().name
HTTP
GET /api/project
Returns an object with the following properties:
Property name author filename unique_id upload_date
Return type Return Example string string
"Help Project"
"Pharos" string string string
"help_project_v1.pd2"
"{6b48627a-1d5e-4b2f-81e2-481e092a6a79}"
"2017-01-30T15:19:08"
JavaScript
get_project_info(callback)
Returns an object with the same properties as in the HTTP call
Example:
Query.get_project_info( function(project){
} var author = project.author
Replication
Returns data about the install replication.
Show
- 353 -
API v4
Pharos Designer User Manual
Lua
get_current_replication()
Returns an object with the following properties:
Property name
Return type string unique_id string
Return Example
"Help Project"
"{6b48627a-1d5e-4b2f-81e2-481e092a6a79}"
Example: rep_name = get_current_replication().name
HTTP
GET /api/replication
Returns an object with the following properties:
Property Return type name string unique_id string
Return Example
"Help Project"
"{6b48627a-1d5e-4b2f-81e2-481e092a6a79}"
JavaScript
get_replication(callback)
Returns an object with the same properties as in the HTTP call
Location
Returns data about the install location.
Show
Lua
get_location()
Returns an object with the following properties:
Property lat long
Return type Return Example float float
51.512
-0.303
Example: lat = get_location().lat
HTTP
Not currently available.
- 354 -
JavaScript
Not currently available.
Network 2
Returns data about the Network 2 (Protocol) Interface.
Show
Lua
The protocol_interface namespace has the following properties:
Property Return type
.has_interface
boolean
.is_up
boolean
..ip_address
.subnet_mask
.gateway
string string string
Return Example true true
"192.168.1.12"
"255.255.255.0"
"192.168.1.1"
Example: if protocol_interface.has_interface == true then ip = protocol_interface.ip_address
end
HTTP
Not currently available.
JavaScript
Not currently available.
Time
Returns data about the time stored in the controller.
Show
Lua
The time namespace has the following functions which return a
l l l l l l l l l l l get_current_time() get_sunrise() get_sunset() get_civil_dawn() get_civil_dusk() get_nautical_dawn() get_nautical_dusk() get_new_moon() get_first_quarter() get_full_moon() get_third_quarter()
- 355 -
API v4
Pharos Designer User Manual and the following properties
Property is_dst gmt_offset
Return Type boolean string
Return Example
Each function returns a
DateTime object , with the following properties:
Property
.year
.month
.monthday
.weekday
.hour
.minute
Return Type integer integer(0-23)
Return Example
2017 integer (1-12) 5 integer (1-31) 8 integer(1-7) 1
13 integer (0-59) 21
.second
integer (0-59) 46
.utc_timestamp
integer 1494249706
.time_string
.date_string
string string
Example: current_hour = time.get_current_time().hour
HTTP
GET /api/time
Returns an object with the following properties:
Property Return Type Return Example datetime string "01 Feb 2017 13:44:42" local_time integer (controller's local time in milliseconds) 1485956682 uptime integer (time since last boot) 493347
JavaScript
get_current_time(callback)
Returns an object with the same properties as in the HTTP call
Example:
Query.get_current_time( function(time){ var uptime = time.uptime
}
Timeline
Returns data about the timelines in the project and their state on the controller.
Show
- 356 -
API v4
Lua
get_timeline(timelineNum)
Returns a single Timeline object for the timeline with user number timelineNum.
The returned object has the following properties
Property name group length source_ bus timecode_ format audio_ band audio_ channel audio_ peak time_offset state onstage position
Return Type string string ('A', 'B', 'C', 'D','') integer integer (equivalent to constants: DEFAULT, TCODE_1 ... TCODE_6, AUDIO_
1 ... AUDIO_4) string integer (0 is equivalent to constant VOLUME) integer (equivalent to constants: LEFT, RIGHT or COMBINED) boolean priority integer integer (equivalent to constants: Timeline.NONE, Timeline.RUNNING,
Timeline.PAUSED, Timeline.HOLDING_AT_END, Timeline.RELEASED) boolean integer integer (equivalent to constants: HIGH_PRIORITY, ABOVE_NORMAL_
PRIORITY, NORMAL_PRIORITY, BELOW_NORMAL_PRIORITY or LOW_
PRIORITY)
(table, keys and values correspond to custom property names and values) custom_ properties
Example: tl = get_timeline(1) name = tl.name
state = tl.state
if (tl.source_bus == TCODE_1) then
-- do something end
1 false
5000
1 true
5000
0
Return
Example
"Timeline 1"
'A'
10000
1
"SMPTE30"
0
- 357 -
Pharos Designer User Manual
HTTP
GET /api/timeline[?num=timelineNumbers] l num can be used to filter which timelines are returned and can be a single number or a string representing the required timelines (e.g. "1,2,5-9")
Returns an object with the following properties: timelines array of timeline objects
Each timeline object contains the following properties:
Property num name group length source_bus timecode_ format audio_band audio_channel audio_peak time_offset state onstage position priority custom_properties
Return Type integer string string('A', 'B', 'C', 'D' or empty) integer string ('internal', 'timecode_1',...'timecode_6', 'audio_1',...'audio_4') string integer (0 is volume band) string ('left', 'right', 'combined') boolean integer string ('none', 'running', 'paused', 'holding_at_end', 'released') boolean integer string ('high', 'above_normal', 'normal', 'below_normal', 'low')
(object, properties and property values correspond to custom property names and values)
Return
Example
1
"Timeline 1"
"A"
10000
100
"SMPTE30"
1
"combined" false
5000
"running" true
10000
"normal"
JavaScript
get_timeline_info(callback[, num]) l num can be used to filter which timelines are returned and is defined as a JSON object which can contain a single number or a string representing the required timelines (e.g. "1,2,5-9")
Returns an array of timelines in the same way as the HTTP call
Example:
Query.get_timeline_info( function(t){ var name = t.timelines[0].name //name of the first timeline
}, {"num":"1-4"})
- 358 -
Scene
Returns data about the Scenes in the project and their state on the controller.
Show
Lua
get_scene(sceneNum)
Returns a single Scene object for the Scene with user number SceneNum.
The returned object has the following properties
Property name group state onstage custom_properties
Return Type string string (A-H) or empty string ('none', 'started') boolean
(object, properties and property values correspond to custom property names and values)
Example: scn = get_scene(1) name = scn.name
state = scn.state
HTTP
GET /api/scene[?num=sceneNumbers] num can be used to filter which scenes are returned and can be a single number or array
Returns an object with the following properties: scenes array of scene objects
Each scene object contains the following properties:
Property name num state onstage
Return Type string integer string ('none', 'started') boolean
Return Example
"Scene 1"
1
"none" false
JavaScript
get_scene_info(callback[, num]) filter may contain a num property which is used to filter which scenes are returned
Returns an array of scenes in the same way as the HTTP call
Return
Example
"Scene 1"
"A"
"none" false
API v4
- 359 -
Pharos Designer User Manual
Example:
Query.get_scene_info( function(s){ var name = s.scenes[0].name //name of the first timeline
}, {"num":"1-4"})
Group
Returns data about the groups in the project.
Show
Lua
get_group(groupNum)
Returns a Group object for the group with user number groupNum.
The returned object has the following properties:
Property name master_intensity_level
Return Type string
Variant
Return Example
"Group 1"
Example: grp = get_group(1) name = grp.name
HTTP
GET /api/group[?num=groupNumbers] num can be used to filter which groups are returned and can be a single number or array
Returns an object with the following properties: groups array of group objects
Each group object contains the following properties:
Property num name level
Return Type Return Example integer (only included for user created groups) 1 string integer (0-100)
"Group 1"
100
JavaScript
get_group_info(callback[, num]) filter may contain a num property which is used to filter which groups are returned
Returns an array of groups in the same way as the HTTP call
- 360 -
API v4
Example:
Query.get_group_info( function(g){ var name = g.groups[0].name //name of the first timeline
}, {"num":"1-4"})
Note:
Group 0 will return data about the 'All Fixtures' group
Controller
Returns data about the controller.
Show
Lua
get_current_controller() get_network_primary()
Returns an object for the controller running the script, or the network primary, containing the following properties:
Property number name
Return Type integer string
Return Example
1
"Controller 1"
Example: cont = get_current_controller() name = cont.name
is_controller_online(controllerNumber)
Returns true if the controller with user number controllerNum has been discovered, and false otherwise
Example: if (is_controller_online(2)) then log("Controller 2 is online") else log("Controller 2 is offline") end
HTTP
GET /api/controller
Returns an object with the following properties: controllers array of controller objects (one for each controller in the project)
Each controller object contains the following properties:
- 361 -
Pharos Designer User Manual
Property num type name serial ip_address online is_network_ primary
Return Type number string string string string (if the controller is discovered)/empty (if the controller is not discovered or is the queried controller) boolean boolean
JavaScript
get_controller_info(callback)
Returns an array of controllers in the same way as the HTTP call
Example:
Query.get_controller_info( function(controller){
} var name = controller[0].name // name of the first controller
Temperature
Returns data about the controller's temperature.
Show
Lua
get_temperature()
Returns an object with the following properties
Property sys_temp core_temp
Return Type number (only for LPC X and VLC/VLC+) number (only for LPC X and VLC/VLC+)
Return Example
40
44 ambient_temp number (only for TPC, LPC X rev 1) cc_temp number (only for LPC X rev 2 and VLC/VLC+)
36.900001525878906
44 gpu_temp number (only for VLC/VLC+) 44
Example: temp = get_temperature() log(temp.ambient_temp)
HTTP
GET /api/temperature
Return
Example
1
"LPC"
"Controller 1"
"009060"
"192.168.1.3" or "" true true
- 362 -
Returns an object with the following properties:
Property sys_temp core1_temp core2_temp
Return Type number (only for LPC X and VLC/VLC+) number (only for LPC X and VLC/VLC+) number (only for LPC X rev 1 ambient_temp number (only for TPC, LPC X rev 1) cc_temp number (only for LPC X rev 2 and VLC/VLC+) gpu_temp number (only for VLC/VLC+)
Return Example
40
44
44
36.900001525878906
44
44
JavaScript
get_temperature(callback)
Returns an object with the same properties as in the HTTP call
Example:
Query.get_temperature( function(temp){
} var ambient = temp.ambient_temp // ambient temperature of the controller
Remote Device
Returns data about the Remote Device/s in the project.
Show
Lua
get_rio(type, num):get_input(inputNum) l l l type can be RIO80, RIO44 or RIO08 num is the remote device number inputNum is the number of the input
Returns a boolean if the input is set to Digital or Contact Closure, or an integer if the input is set to Analog.
Example: rio = get_rio(RIO44, 1) input = rio:get_input(1) get_rio(type, num):get_output(inputNum) l l l type can be RIO80, RIO44 or RIO08 num is the remote device number outputNum is the number of the output
Returns a boolean showing the current state of the output.
Example: rio = get_rio(RIO44, 1)
API v4
- 363 -
Pharos Designer User Manual output_state = rio:get_output(1) get_bps(num):get_state(buttonNum) l l num is the BPS number buttonNum is the number of the button
Returns the state of the button, which can be RELEASED, PRESSED, HELD or REPEAT
Example: bps = get_bps(1) btn = bps:get_state(1)
HTTP
GET /api/remote_device
Returns an array of all remote devices in the project.
The returned object has the following structure remote_devices array of Remote Device objects
Each Remote Device object contains the following properties:
Property num type serial outputs inputs online
Return Type integer string ('RIO08', 'RIO44',
'RIO80', 'BPS', 'BPI', 'RIO
A', 'RIO D') array (all discovered serial number for the address and type) array (of Output objects, only present for RIO44 and
RIO08 that are on the queried controller) array (of Input objects, only present for RIO44 and
RIO80 that are on the queried controller) boolean (if the remote device is detected as being online)
Return Example
1
"RIO 44"
["001234"]
[{"output":1,"value":true},{"output":2,"value":true},{"output":3,"value":true},{"output":4,"value":true}]
[{"input":1,"type":"Contact Closure","value":true},{"input":2,"type":"Contact Closure","value":true},{"input":3,"type":"Contact
Closure","value":true},{"input":4,"type":"Contact Closure","value":true}] true
The Output object has the following properties:
Property output state
Return Type integer boolean (true means the output is on, false means it is off)
The Input object has the following properties:
Return Example
1 false
- 364 -
Property input type value
Return Type integer string ('Analog', 'Digital', 'Contact Closure') integer or bool (depends on type)
Return Example
1
'Digital' true
JavaScript
get_remote_device_info(callback)
Returns an array of all remote devices in the project with the same properties as in the HTTP call.
Example:
Query.get_remote_device_info( function(remote){
} var type = remote[0].type // type of the first remote device
Text Slots
Returns data about the text slots in the project.
Show
Lua
get_text_slot(slotName) l slotName is the name of the text slot
Returns the value of slotName
Example: log(get_text_slot("test_slot"))
HTTP
GET /api/text_slot[?names=slotNames] slotNames can be used to filter which text slots are returned and can be a single name or array
The returned object has the following structure text_slots array of Text Slot objects
Each Text Slot object contains the following properties:
Property name value
Return Type string string
Return Example
"text"
"example"
JavaScript
get_text_slot(callback[, filter]) filter may contain a names property which is used to filter which text slot values are returned
- 365 -
API v4
Pharos Designer User Manual
Returns an array of all text slots in the project with the same properties as in the HTTP call.
Example:
Query.get_text_slot( function(text){ var value = text[0].value // value of the first text slot
}, {names: "test_slot1", "test_slot2"})
Get Log
Returns the log from the queried controller.
Show
Lua
Not currently available.
HTTP
GET /api/log
The returned object has the following structure
Property Return Type log string (containing the whole log of the controller)
JavaScript
Not currently available.
Protocol
Returns the protocols and universes being output from the queried controller.
Show
Lua
Not currently available.
HTTP
GET /api/protocol
Returns all the universes on the queried controller
The returned object has the following structure outputs array of Protocol objects
Each Protocol object has the following properties:
Property type name disabled
Return Type integer string boolean (whether the output has been disabled
Return Example
1
"DMX" true
- 366 -
API v4 universes dmx_ proxy via an Action) array (Universe objects)
DMX Proxy Object (where appropriate)
Each Universe object has the following properties:
{"key":{"index":1},"name":"1"},{"key":
{"index":2},"name":"2"}
{ "ip_address": "192.168.1.17", "name": "Controller 1" }
Property name key
Return Type string
Universe Key object
Return Example
"1"
{"index":1}
Each DMX Proxy object has the following properties:
Property name ip_address
The properties of the Universe Key object depends upon the type:
For DMX, Pathport, sACN and Art-Net:
Property index
For KiNET:
Return Type string (name of the controller that is outputting this universe) string IP Address of the controller outputting this universe
Return Type integer
Return Example
1
Return Example
'Controller 1'
'192.168.1.23'
Property kinet_port kinet_power_supply_num
For RIO DMX:
Property remote_device_num remote_device_type
Return Type integer integer
Return Example
1
1
Return Type integer integer (corresponding to values in query.js)
For EDN:
Property remote_device_num port
Return Type integer integer
Return Example
1
1
Return Example
1
1
JavaScript
get_protocols(callback)
Returns all the universes on the queried controller, with the same structure as the HTTP response.
Output
Returns the levels being output from the queried controller.
Show
- 367 -
Pharos Designer User Manual
Lua
get_dmx_universe(idx) get_artnet_universe(idx) get_pathport_universe(idx) get_sacn_universe(idx) l idx is the required universe number get_kinet_universe(power_supply_num, port_num) l l power_supply_num is the power supply to return the output from port_num is the port to return the output from
These all return a Universe object, which has the following function get_channel_value(chnl) l chnl is the channel to get the value from
Example: uni = get_dmx_universe(1) -- get DMX Universe 1 level = uni:get_channel_value(1) -- get channel 1 from the returned universe
HTTP
GET /api/output?universe=universeKey l l l universeKey is a string in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET, protocol:remoteDeviceType:remoteDeviceNum for RIO
DMX and protocol:remoteDeviceNum:port for EDN.
protocol can be dmx, pathport, sacn, art-net, kinet, rio-dmx or edn remoteDeviceType can be rio08, rio44 or rio80
Example:
GET /api/output?universe=dmx:1
GET /api/output?universe=rio-dmx:rio44:1
The returned object has the following structure
Property channels disabled proxied_ tpc_name
Return Type array (of channel values) boolean (whether the output has been disabled via an Action) string (only if controller is LPC, universe is DMX
2, DMX Proxy has been enabled and the TPC is offline)
Return Example
[0,0,0,0,0,0,0,0,0,255,255,255...255,0,255] true
'Controller 2'
- 368 -
API v4
JavaScript
get_output(universeKey, callback)
Argument universekey
Type string or an object containing protocol and either index, kinet_power_supply_num and kinet_port or remote_device_type and remote_device_num
Example dmx:1 l universeKey can be either a string, or an object containing protocol and either index, kinet_power_supply_ num and kinet_port or remote_device_type and remote_device_num as received from get_protocols
Example:
Query.get_output({protocol:KINET, kinet_port:1, kinet_power_supply_num:1}, function(u){ console.log(u)
})
Query.get_output({protocol:DMX, num:1}, function(u){ console.log(u)
})
Query.get_output("dmx:1", function(u){ console.log(u)
})
Returns an object with the same structure as in the HTTP call
Input
Returns the inputs on the queried controller.
Show
Lua
get_input(idx)
Argument idx
Type integer
Example
1
Returns the value of the controllers input as a boolean or integer
Example: in1 = get_input(1) if in1 == true then
- 369 -
Pharos Designer User Manual log("Input 1 is digital and high") elseif in1 == false then log("Input 1 is digital and low") else log("Input 1 is analog at " .. in1) get_dmx_input(chnl)
Argument chnl l
Type Example integer 1 chnl is the required channel number
Returns the value of the DMX input at channel chnl as an integer. If no DMX Input is detected, it will return nil.
HTTP
GET /api/input
The returned object has the following structure
Property gpio dmxIn
Property error dmxInFrame
Return
Type array (of
Input objects, on
LPC or
TPC+EXT) object
(DMX Input object, if
DMX Input is configured)
Return Example
[{"input":1,"type":"Contact Closure","value":true},{"input":2,"type":"Contact Closure","value":true},{"input":3,"type":"Contact Closure","value":true},{"input":4,"type":"Contact Closure","value":true},{"input":5,"type":"Contact
Closure","value":true},{"input":6,"type":"Contact Closure","value":true},{"input":7,"type":"Contact Closure","value":true},{"input":8,"type":"Contact Closure","value":true}]
[0,0,0,0,0,0,0,0,0,255,255,255...255,0,255]
The Input object has the following properties:
Property input type value
Return Type integer
Return Example
1 string ('Analog', 'Digital', 'Contact Closure') "Contact Closure" integer or bool (depends on type) true
The DMX Input object has the following properties:
Return Type string (if DMX Input is configured but no
DMX is received) array (of channel values)
Return Example
"No DMX received"
[0,0,0,0,0,0,0,0,0,255,255,255...255,0,255]
- 370 -
dmxInSourceCount dmxInProtocol integer (the number of sources - will be
1 except for sACN) string ("dmx", "art-net" or "sacn")
1
"dmx"
JavaScript
Not currently available.
Trigger
Returns the triggers in the project.
Show
Lua
Not currently available.
HTTP
GET /api/trigger?[type=[triggerType]] l triggerType is a string defining the trigger types to be returned.
The returned object has the following structure triggers array (of Trigger objects)
The Trigger object has the following properties:
Property type num name description trigger_text conditions actions
Return Type string integer string string string array (of Condition objects) array (of Action objects
Return Example
"Startup"
1
"Startup"
""
"At startup"
[{"text":"Before 12:00:00 every day"}]
[{"text":"Start Timeline 1"}]
The Condition and Action objects have the following properties:
Property text
Return Type string
Return Example
"Start Timeline 1"
JavaScript
Not currently available.
Lua Variable
Returns the current value of the specified Lua variable.
Show
Lua
Not currently available.
- 371 -
API v4
Pharos Designer User Manual
HTTP
GET /api/lua?variables=luaVariables
Argument luaVariables
Type string or comma separated list
Example
'myVar' or 'myVar, myVar2, myVar3'
Returns an object containing all the Lua variables requested and their values.
JavaScript
get_lua_variables(luaVariables, callback)
Argument luaVariables
Type string or array
Example
'myVar' or 'myVar, myVar2, myVar3'
Returns an object containing all the Lua variables requested and their values.
Example:
Query.get_lua_variables("myVar", function(lua){ var value = lua.myVar
}
Trigger Variable
Returns the value of a variables from the trigger that ran the script.
Show
Lua
get_trigger_variable(idx)
Argument idx
Type integer
Example
1
Returns the trigger variable at idx as a
object.
Example:
-- Use with a TPC Colour Move Trigger red = get_trigger_variable(1).integer
green = get_trigger_variable(2).integer
blue = get_trigger_variable(3).integer
-- Use with Serial Input "<s>\r\n" input = get_trigger_variable(1).string
HTTP
Not currently available.
- 372 -
JavaScript
Not currently available.
Resources
Use to locate resources in the controller's memory.
Show
Lua
get_resource_path(filename)
Argument filename
Type string
Example
'settings.txt'
Returns a path to the resource filename.
Example: dofile(get_resource_path("my_lua_file.lua"))
HTTP
Not currently available.
JavaScript
Not currently available.
Content Target
Returns information about a Content Target in the project.
Show
Lua
On a VLC get_content_target(compositionNum)
On a VLC+ get_content_target(compositionNum, type) l l compositionNum is the usernumber of the composition to return type is the type of target within the composition to return (PRIMARY, SECONDARY, OVERLAY_1,
OVERLAY_2)
Returns a Content Target object with the following properties: master_intensity_level rotation_offset (VLC+ only) x_position_offset (VLC+ only) y_position_offset (VLC+ only)
Variant float float float
Example:
API v4
- 373 -
Pharos Designer User Manual target = get_content_target(1) current_level = target.master_intensity_level
target = get_content_target(1,PRIMARY) current_angle = target.rotation_offset
HTTP
Not currently available.
JavaScript
Not currently available.
Config
Returns information about a controller's Configuration.
Show
Lua
get_log_level()
Returns the current log level of the controller get_syslog_enabled()
Returns true if Syslog is enabled, false otherwise get_syslog_ip_address()
Returns the IP address of the Syslog server get_ntp_enabled()
Returns true if NTP is enabled get_ntp_ip_address()
Returns the IP address of the NTP server
Example:
HTTP
GET /api/config
Returns an object with the following properties:
Property ip subnet_mask gateway
Return Type string string string
Return Example
"192.168.1.3"
"255.255.255.0"
"192.168.1.1"
- 374 -
dhcp_enabled name_server_1 name_server_2 http_port https_port year month day hour minute second watchdog_enabled log_level syslog_enabled syslog_ip ntp_enabled ntp_ip boolean string string integer true
"192.168.1.1"
"8.8.8.8"
80 integer integer
443
2019 integer (1-12) 4 integer (1-31) 25 integer (0-23) 13 integer (0-59) 21 integer (0-59) 46 boolean true integer (1-5) boolean string boolean string
3 true
"192.168.1.2" true
"192.168.1.1"
JavaScript
get_config(callback)
Returns the controller's configuration
The returned object has the same structure as in the HTTP call
API Actions
Below are the ways of changing properties or changing output on the controller.
show
Start Timeline
Start a timeline in the project Show
Lua
get_timeline(timelineNum):start()
Argument timelineNum
Type integer
Example
1
HTTP
POST /api/timeline
{
"action": "start",
"num": timelineNum
- 375 -
API v4
Pharos Designer User Manual
}
Argument timelineNum
Type integer
Example
1
JavaScript
Query.start_timeline({ "num": timelineNum}, callback)
Argument timelineNum
Type integer
Example
1
Start Scene
Start a scene in the project Show
Lua
get_scene(sceneNum):start()
Argument Type sceneNum integer
Example
1
HTTP
POST /api/scene
{
"action": "start",
"num": sceneNum
}
Argument Type sceneNum integer
Example
1
JavaScript
Query.start_scene({ "num": sceneNum}, callback)
Argument Type Example sceneNum integer 1
Release Timeline
Release a timeline in the project Show
Lua
get_timeline(timelineNum):release([fade])
Argument Type Example
- 376 -
timelineNum fade integer float
1
2.0
HTTP
POST /api/timeline
{
"action": "release",
"num": timelineNum[,
"fade": fade]
}
Argument timelineNum fade
Type integer float
Example
1
2.0
JavaScript
Query.release_timeline({ "num": timelineNum[, "fade": fade]}, callback)
Argument timelineNum fade
Type integer float
Example
1
2.0
Release Scene
Release a scene in the project Show
Lua
get_scene(sceneNum):release([fade])
Argument sceneNum fade
Type integer float
Example
1
2.0
HTTP
POST /api/scene
{
"action": "release",
"num": sceneNum[,
"fade": fade]
}
API v4
- 377 -
Pharos Designer User Manual
Argument Type sceneNum integer fade float
Example
1
2.0
JavaScript
Query.release_scene({ "num": sceneNum[, "fade": fade]}, callback)
Argument Type sceneNum integer fade float
Example
1
2.0
Toggle Timeline
Toggle a timeline in the project (if it is running, stop it, and if it is not running, start it) Show
Lua
get_timeline(timelineNum):toggle([fade])
Argument timelineNum fade
Type integer float
Example
1
2.0
HTTP
POST /api/timeline
{
"action": "toggle",
"num": timelineNum[,
"fade": fade]
}
Argument timelineNum fade
Type integer float
Example
1
2.0
JavaScript
Query.toggle_timeline({ "num": timelineNum[, "fade": fade]}, callback)
Argument timelineNum fade
Type integer float
Example
1
2.0
Toggle Scene
Toggle a scene in the project (if it is running, stop it, and if it is not running, start it) Show
- 378 -
Lua
get_scene(sceneNum):toggle([fade])
Argument sceneNum fade
Type integer float
HTTP
POST /api/scene
{
"action": "toggle",
"num": sceneNum[,
"fade": fade]
}
Example
1
2.0
Argument sceneNum fade
Type integer float
Example
1
2.0
JavaScript
Query.toggle_scene({ "num": sceneNum[, "fade": fade]}, callback)
Argument sceneNum fade
Type integer float
Example
1
2.0
Pause Timeline
Pause a timeline in the project Show
Lua
get_timeline(timelineNum):pause()
Argument timelineNum
Type integer
HTTP
POST /api/timeline
{
"action": "pause",
"num": timelineNum
Example
1
- 379 -
API v4
Pharos Designer User Manual
}
Argument timelineNum
Type integer
Example
1
JavaScript
Query.pause_timeline({ "num": timelineNum}, callback)
Argument timelineNum
Type integer
Example
1
Resume Timeline
Resume a timeline in the project Show
Lua
get_timeline(timelineNum):resume()
Argument timelineNum
Type integer
HTTP
POST /api/timeline
{
"action": "resume",
"num": timelineNum
}
Example
1
Argument timelineNum
Type integer
Example
1
JavaScript
Query.resume_timeline({ "num": timelineNum}, callback)
Argument timelineNum
Type integer
Example
1
Pause All
Pause all timelines in the project Show
Lua
pause_all()
- 380 -
HTTP
POST /api/timeline
{
"action": "pause"
}
JavaScript
Query.pause_all(callback)
Resume All
Resume all timelines in the project Show
Lua
resume_all()
HTTP
POST /api/timeline
{
"action": "resume"
}
JavaScript
Query.resume_all(callback)
Release All
Release all timelines, scenes or timelines, scenes and overrides in the project Show
Lua
release_all([fade,] [group]) release_all_timelines([fade,] [group]) release_all_scenes([fade,] [group])
Argument fade group
Type float string ("A","B","C","D") prepend with ! for except (e.g. "!A")
Example
2.0
"A"
HTTP
POST /api/release_all
POST /api/timeline
- 381 -
API v4
Pharos Designer User Manual
POST /api/scene
{
"action": "release"[, (not required for release all)
"group": group][,
"fade": fade]
}
Argument fade group
Type Example float 2.0
string ("A","B","C","D") prepend with ! for except (e.g. "!A") "A"
JavaScript
release_all_timelines({["fade": fade]}, callback) release_all_scenes({["fade": fade]}, callback) release_all({ ["fade": fade,] ["group": group] }, callback)
Argument fade group
Type float
Example
2.0
string ("A","B","C","D") prepend with ! for except (e.g. "!A") "A"
Set Timeline Rate
Set the rate of a timeline in the project Show
Lua
get_timeline(timelineNum):set_rate(rate)
Argument timelineNum rate
Argument
Type integer
Example
1 float or bounded integer 10:100 or 0.1
HTTP
POST /api/timeline
{
"action": "set_rate",
"num": timelineNum,
"rate": rate
}
Type Example
- 382 -
API v4 timelineNum rate integer float or bounded integer
1
10:100 or 0.1
JavaScript
Query.set_timeline_rate({"num": timelineNum, "rate": rate }, callback)
Argument timelineNum rate
Type integer float or bounded integer
Example
1
10:100 or 0.1
Set Timeline Position
Set the position of a timeline in the project Show
Lua
get_timeline(timelineNum):set_position(position)
Argument timelineNum position
Type integer float or bounded integer
HTTP
POST /api/timeline
{
"action": "set_position",
"num": timelineNum,
"position": position
}
Argument timelineNum position
Type integer float or bounded integer
Example
1
10:100 or 0.1
Example
1
10:100 or 0.1
JavaScript
Query.set_timeline_position({"num": timelineNum, "position": position }, callback)
Argument timelineNum position
Type integer float or bounded integer
Enqueue Trigger
Fire a trigger in the project Show
Lua
Example
1
10:100 or 0.1
- 383 -
Pharos Designer User Manual enqueue_trigger(num[,var...])
Argument num - the trigger number to enqueue
Type integer var... - 0 or more variables to pass to the trigger comma separated variables
Example
1
1,2,"string"
Example enqueue_trigger(1,1,2,"string") force_trigger(num[, var...])
Enqueues a trigger without testing its conditions first (it will always be fired).
HTTP
POST /api/trigger
{
"num": num[,
"var": var...][,
"conditions": test_conditions]
}
Argument num var...
Type integer comma separated variables
Example
1
1,2,"string" test_conditions l l l boolean true num - the trigger number to enqueue var... - 0 or more variables to pass to the trigger test_conditions - Should the conditions on the trigger be tested?
JavaScript
Query.fire_trigger({"num": num[, "var": var...][, "conditions": test_conditions]
}, callback)
Argument num var...
Type integer comma separated variables
Example
1
'1,2,"string"' test_conditions l l l boolean true num - the trigger number to enqueue var... - 0 or more variables to pass to the trigger. If passing multiple variables, they must be a single string surrounded by single quotes ( ' ), string variables should be surrounded by double quotes ( " ).
test_conditions - Should the conditions on the trigger be tested?
Run Script
Run a script or parse into the command line on the controller Show
- 384 -
Lua
Not currently available.
HTTP
POST /api/cmdline
{
"input": chunk,
}
Note:
returns "Executed" if successful, or an error string if not
Argument chunk - the script to parse or run
Type string
Example
"tl = 1 get_timeline(tl):start()"
JavaScript
Query.run_command({ "input": chunk }, callback)
Note:
returns "Executed" if successful, or an error string if not
Argument chunk - the script to parse or run
Type string
Example
"tl = 1 get_timeline(tl):start()"
Hardware Reset
Reset the controller (power reboot) Show
Lua
Not currently available.
HTTP
POST /api/reset
JavaScript
Not currently available.
Master Intensity
Master the intensity of a group or content target (applied as a multiplier to output levels) Show
Lua
Non-VLC get_group(groupNum):set_master_intensity(level[, fade[, delay]])
VLC get_content_target():set_master_intensity(level, [fade, [delay]])
- 385 -
API v4
Pharos Designer User Manual
VLC+ get_content_target(compositionNum, type):set_master_intensity(level, [fade,
[delay]])
Argument groupNum compositionNum type - of content target level fade delay
Type integer
Not currently used
Example
1 string (from options) 'primary', 'secondary', 'overlay_1', 'overlay_2' float or integer (0-255) 128 or 0.5
float float
2.0
2.0
Example: get_group(1):set_master_intensity(128,3) -- master group 1 to 50% (128/255 = 0.5) in 3 seconds)
HTTP
Non-VLC
POST /api/group
{
"action": "master_intensity",
"num": groupNum,
"level": level,
["fade": fade,]
["delay": delay]
}
VLC/VLC+
POST /api/content_target
{
"action": "master_intensity",
"level": level,
["fade": fade,]
["delay": delay,]
"type": type
}
- 386 -
API v4
Argument groupNum compositionNum type - of content target level fade delay
Type integer
Not currently used string (from options) float or bounded integer float float
Example
1
'primary', 'secondary', 'overlay_1', 'overlay_2'
0.5 or "50:100"
2.0
2.0
JavaScript
Non-VLC master_intensity({ "num": groupNum, "level": level, ["fade": fade,] ["delay": delay] }, callback)
VLC/VLC+ master_content_target_intensity({ "type":type, "level": level, ["fade": fade,] ["delay": delay] }, callback)
Argument groupNum compositionNum type - of content target level fade delay
Type integer
Not currently used string (from options) float or bounded integer float float
Example
1
'primary', 'secondary', 'overlay_1', 'overlay_2'
0.5 or "50:100"
2.0
2.0
Example:
Query.master_intensity({"num":1,"level":"50:100","fade":3) -- master group 1 to
50% (50/100 = 0.5) in 3 seconds)
Note:
Group 0 will master the intensity of the 'All Fixtures' group
Set RGB
Set the Intensity, Red, Green, Blue levels for a fixture or group.
Show
Lua
get_fixture_override(num) get_group_override(num)
:set_irgb(intensity, red, green, blue, [fade, [path]])
:set_intensity(intensity, [fade, [path]])
:set_red(red, [fade, [path]])
:set_green(green, [fade, [path]])
:set_blue(blue, [fade, [path]])
:set_temperature(temperature, [fade, [path]])
- 387 -
Pharos Designer User Manual
Argument num - group or fixture intensity red green blue temperature fade path
Type integer integer (0-255) integer (0-255) integer (0-255) integer (0-255) integer (0-255) float string (from options)
Example
1
255
255
255
255
255
2.0
"Default", "Linear", "Start", "End", "Braked", "Accelerated, "Damped,
"Overshoot"
Example: ov = get_fixture_override(1) -- Get fixture 1 ov:set_rgb(255, 255, 0, 0) -- Set the fixture to Red
HTTP
PUT /api/override
{
"target": target,
"num": num,
["intensity": intensity,]
["red": red,]
["green": green,]
["blue": blue,]
["temperature": temperature,]
["fade": fade,]
["path": path]
}
Argument target num - group or fixture intensity red green blue
Type string (from options) integer integer (0-255) integer (0-255) integer (0-255) integer (0-255)
Example
"group", "fixture"
1
255
255
255
255
- 388 -
API v4 temperature fade path integer (0-255) float string (from options)
255
2.0
"Default", "Linear", "Start", "End", "Braked", "Accelerated, "Damped,
"Overshoot"
Javascript
set_group_override({ "num": num, ["intensity": intensity,] ["red": red,] ["green": green,] ["blue": blue,] ["temperature": temperature,] ["fade": fade,] ["path": path] }, callback) set_fixture_override({ "num": num, ["intensity": intensity,] ["red": red,]
["green": green,] ["blue": blue,] ["temperature": temperature,] ["fade": fade,]
["path": path] }, callback)
Argument num - group or fixture intensity red green blue temperature fade path
Type integer integer (0-255) integer (0-255) integer (0-255) integer (0-255) integer (0-255) float string (from options)
Example
1
255
255
255
255
255
2.0
"Default", "Linear", "Start", "End", "Braked", "Accelerated, "Damped,
"Overshoot"
Example:
Query.set_fixture_override({ "num": 1, "intensity": 255, "red": 255, "green": 0,
"blue": 0});
Note:
Group 0 will set the levels of the 'All Fixtures' group
Clear RGB
Remove any overrides on fixtures or groups.
Show
Lua
get_fixture_override(num) get_group_override(num)
:clear([fade]) clear_all_overrides([fade])
Argument num - group or fixture fade
Type integer float
Example
1
2.0
- 389 -
Pharos Designer User Manual
Example: ov = get_fixture_override(1) -- Get fixture 1 ov:clear() -- Clear the override on fixture 1
HTTP
DELETE /api/override
{
["target": target,]
["num": objectNum,]
["fade": fade]
}
If num is not included, target is ignored and all overrides are cleared.
Argument target num - group or fixture fade
Type Example string (from options) "group" or "fixture" integer float
1
2.0
JavaScript
clear_group_overrides({ ["num" :num,] ["fade": fade] }, callback) clear_fixture_overrides({ ["num" :num,] ["fade": fade] }, callback) clear_overrides({ ["fade": fade] }, callback)
Argument num fade
Type Example integer 1 float 2.0
Example:
Query.clear_overrides({"fade":3})
Set Text Slot
Set the value of a text slot used in the project.
Show
Lua
set_text_slot(name, value)
Argument name value
Type Example string (matching text slot name) "myTextSlot" string "Hello World!"
- 390 -
API v4
Example: set_text_slot("myTextSlot", "Hello World!")
HTTP
PUT /api/text_slot
{
"name": name,
"value": value
}
Argument name value
Type string (matching text slot name) string
Example
"myTextSlot"
"Hello World!"
JavaScript
set_text_slot({"name": name, "value": value}, callback)
Argument name value
Type string (matching text slot name) string
Example
"myTextSlot"
"Hello World!"
Example:
Query.set_text_slot("name:"myTextSlot", "value":"Hello World!")
Set BPS Button LED
Set the effect and intensity on BPS button LEDS.
Show
Lua
get_bps(num):set_led(button, effect, [intensity], [fade])
Argument num button effect intensity fade
Type integer integer
OFF, ON, SLOW_FLASH, FAST_FLASH, DOUBLE_FLASH, BLINK, PULSE,
SINGLE, RAMP_ON, RAMP_OFF integer (1-255) float
Example
1
1
FAST_
FLASH
255
0.0
Example: get_bps(1):set_led(1,FAST_FLASH,255) -- Set button 1 on BPS 1 to Fast Flash at full intensity
- 391 -
Pharos Designer User Manual
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set Touch Control Value
Set the value on a Touch Slider or Color Picker.
Show
Lua
set_control_value(name, [index,] value[, emitChange])
Argument name - control Key
Type string index - axis of movement (slider has 1, colour picker has 3) integer (1-3) (default 1) value integer (0-255) emitChange boolean (default false)
Example
"slider001"
1
128 false
Example: set_control_value("slider001", 1, 128) -- set slider001 to half and don't fire associated triggers
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set Touch Control State
Set the state on a Touch control.
Show
Lua
set_control_state(name, state)
Argument name - control Key
Type string state - the state name form Interface string (from options in Interface)
Example
"slider001"
"Green"
- 392 -
Example: set_control_state("slider001", "Green") -- set slider001 to a state called
"Green"
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set Touch Control Caption
Set the caption on a Touch control.
Show
Lua
set_control_caption(name, caption)
Argument name - control Key caption - text to display
Type string string
Example
"button001"
"On"
Example: set_control_caption("button001", "On") -- set button001's caption to "On"
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set Touch Page
Change the page on a Touch interface.
Show
Lua
set_interface_page(number[, transition])
Argument number transition
Type integer
SNAP, PAN_LEFT, PAN_RIGHT
Example
4
PAN_LEFT
- 393 -
API v4
Pharos Designer User Manual
Example: set_interface_page(4) -- change the page on the TPC's interface to page 4
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Disable Page
Disable the touchscreen.
Show
Lua
set_interface_enabled([enable])
Argument enable
Type boolean (default true)
Example true
Example: set_interface_enabled(false) -- disable the TPC's touch screen set_interface_enabled() -- enable the TPC's touch screen
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Lock Touch Device
Lock the Touch Device (requires Lock code to be set within Interface).
Show
Lua
set_interface_locked([lock])
Argument lock
Type boolean (default true)
Example true
Example:
- 394 -
API v4 set_interface_enabled(false) -- disable the TPC's touch screen set_interface_enabled() -- enable the TPC's touch screen
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Transition Content Target
Move or rotate a Content Target.
Show
Lua
get_content_target(compositionNum, type)
:transition_rotation([offset], [count], [period], [delay], [useShortestPath])
:transition_x_position([offset], [count], [period], [delay])
:transition_y_position([offset], [count], [period], [delay])
Argument compositionNum type offset count period delay useShortestPath
Type integer
PRIMARY, SECONDARY, OVERLAY_1, OVERLAY_2 integer integer integer integer boolean (default false)
Example
1
PRIMARY
5
0
10
1 false
Example: tar = get_composition_target(1,PRIMARY) tar:transition_x_position(10,1,5) -- Move 10 pixels right in 5 seconds tar:transition_y_position(10,1,5) -- Move 10 pixels down in 5 seconds tar:transition_rotation(90,1,5) -- Rotate by 90 degrees in 5 seconds
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
- 395 -
Pharos Designer User Manual
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Transition Adjustment Target
Move or rotate a Adjustment Target.
Show
Lua
get_adjustment(num)
:transition_rotation([offset], [count], [period], [delay], [useShortestPath])
:transition_x_position([offset], [count], [period], [delay])
:transition_y_position([offset], [count], [period], [delay])
Argument num offset count
Type integer integer integer
Example
1
10
1 period delay integer integer
5
0 useShortestPath boolean (default false) false
Example: tar = get_adjustment(1) tar:transition_x_position(10,1,5) -- Move 10 pixels right in 5 seconds tar:transition_y_position(10,1,5) -- Move 10 pixels down in 5 seconds tar:transition_rotation(90,1,5) -- Rotate by 90 degrees in 5 seconds
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Beacon Controller
Beacons the controller (flashes Status LEDs or screen).
Show
Lua
- 396 -
API v4
Not currently available.
HTTP
POST /api/beacon
JavaScript
toggle_beacon(callback)
Example:
Query.toggle_beacon()
Output To Log
Writes a message to the controller's Log.
Show
Lua
log([level, ]message)
Argument level
Type option (LOG_DEBUG, LOG_TERSE, LOG_NORMAL, LOG_EXTENDED,
LOG_VERBOSE, LOG_CRITICAL, default LOG_NORMAL) message string
Example: log(LOG_CRITICAL, "This is a criticial message!") -- logs the message at Critical log level log("This is a normal message.") -- logs the message at Normal log level.
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Send Variables To Web Interface
Sends data to the web interface in a JSON Object.
Show
Lua
push_to_web(name, value)
Argument Type Example
Example
LOG_
CRITICAL
"Some message to log."
- 397 -
Pharos Designer User Manual name value string "myVar" variable "Some value"
Example: myVar = 15 push_to_web("myVar", myVar) -- will push the object {"myVar": 15}
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Park A Channel
Parks an output channel at a specified level.
Show
Lua
Universe:park(channel, value)
Argument
Universe channel value
Type
integer (1-512) integer (0-255)
Example get_dmx_universe(1)
1
128
Example: get_dmx_universe(1):park(1,128) -- Park channel 1 of DMX Universe 1 at 128 (50%)
HTTP
POST /api/channel
{
"universe": universeKey,
"channels": channelList,
"level": level
}
Argument universeKey
Type string (in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and
Example
"dmx:1"
- 398 -
API v4 channelList level protocol:remoteDeviceType:remoteDeviceNum for RIO DMX) l l protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80 comma separated list(1-512) integer (0-255)
"1-3,5"
128
JavaScript
park_channel({ "universe": universeKey, "channels": channelList, "level": level }, callback)
Argument universeKey channelList value
Type string (in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and protocol:remoteDeviceType:remoteDeviceNum for RIO DMX) l l protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80 comma separated list(1-512) integer (0-255)
Example
"dmx:1"
"1-3,5"
128
Example: park_channel({ "universe": "dmx:1","channels": 1, "level":128}); // Park channel
1 of DMX Universe 1 at 128 (50%)
Unpark A Channel
Unparks an output channel.
Show
Lua
Universe:unpark(channel)
Argument
Universe channel
Type
integer (1-512)
Example get_dmx_universe(1)
1
Example: get_dmx_universe(1):unpark(1) -- Unpark channel 1 of DMX Universe 1 (it will go back to normal output levels)
HTTP
DELETE /api/channel
{
"universe": universeKey,
"channels": channelList
- 399 -
Pharos Designer User Manual
}
Argument universeKey channelList
Type string (in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and protocol:remoteDeviceType:remoteDeviceNum for RIO DMX) l l protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80 comma separated list(1-512)
Example
"dmx:1"
"1-3,5"
JavaScript
park_channel({ "universe": universeKey, "channels": channelList }, callback)
Argument universeKey channelList
Type string (in the form protocol:index for DMX, Pathport, sACN and Art-Net, protocol:kinetPowerSupplyNum:kinetPort for KiNET and protocol:remoteDeviceType:remoteDeviceNum for RIO DMX) l l protocol can be dmx, pathport, sacn, art-net, kinet or rio-dmx remoteDeviceType can be rio08, rio44 or rio80 comma separated list(1-512)
Example
"dmx:1"
"1-3,5"
Example: park_channel({ "universe": "dmx:1","channels": 1}); //Unpark channel 1 of DMX Universe 1 (it will go back to normal output levels)
Disable an Output
Unparks an output channel.
Show
Lua
disable_output(protocol) enable_output(protocol)
Argument protocol
Type Example option (DMX, PATHPORT, ARTNET, KINET, SACN, DVI, RIO_DMX) DMX
Example: disable_output(DMX) -- Disable the DMX output from the controller
HTTP
POST /api/output
{
"protocol": protocol,
- 400 -
"action": action
}
Argument protocol action
Type string ("dmx", "pathport", "art-net", "kinet", "sacn", "dvi", "rio-dmx") string ("enable", "disable")
JavaScript
disable_output({ "protocol": protocol }, callback) enable_output({ "protocol": protocol }, callback)
Argument protocol
Type string ("dmx", "pathport", "art-net", "kinet", "sacn", "dvi", "rio-dmx")
Example
"dmx"
"disable"
Example
"dmx"
Example: disbale_output({ "protocol": "dmx"}); // Disable the DMX output enable_output({ "protocol": "art-net"}); // Enable the Art-Net Output
Set Timeline Source Bus
Set the time source for a timeline.
Show
Lua
Timeline:set_default_source()
Timeline:set_timecode_source(timecodeBus[, offset])
Timeline:set_audio_source(audioBus, band, channel[,peak])
Argument
Timeline timecodeBus audioBus band channel peak
Type
Timeline Object
TCODE_1 ... TCODE_6
AUDIO_1 ... AUDIO_4 integer (0=volume)
LEFT, RIGHT or COMBINED boolean (default false)
Example get_timeline(1)
TCODE_1
AUDIO_1
0
LEFT false
Example: get_timeline(1):set_timecode_source(TCODE_1) -- Set the timecode source of timeline 1 to timecode bus 1
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
API v4
- 401 -
Pharos Designer User Manual
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Enable Timecode Bus
Enables or disables a timecode bus.
Show
Lua
set_timecode_bus_enabled(bus[, enable]) l l bus is the timecode bus to enable or disable (TCODE_1 ... TCODE_6) enable determines whether the bus should be enabled or disabled (boolean, default true)
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
Set Digital Output
Sets the output of a RIO to on or off.
Show
Lua
get_rio(type, num):set_output(outputNum, state) l l l l type can be RIO80, RIO44 or RIO08 num is the remote device number outputNum is the number of the output state is the state to set the output to and can be any of: 0, 1, true, false, ON, OFF
HTTP
Not currently available.
Use Run Script or Enqueue Trigger
JavaScript
Not currently available.
Use Run Script or Enqueue Trigger
- 402 -
Set Log Level
Sets the output of a RIO to on or off.
Show
Lua
set_log_level(log_level)
Sets the log level of the controller to log_level l log_level can be LOG_DEBUG, LOG_TERSE, LOG_NORMAL, LOG_EXTENDED, LOG_VERBOSE,
LOG_CRITICAL or 0-5.
HTTP
Not currently available.
Use Edit Config
JavaScript
Not currently available.
Use Edit Config
Edit Config
Sets the output of a RIO to on or off.
Show
Lua
Not currently available.
HTTP
POST /api/config
{
"ip": ipAddress,
"subnet_mask": subnetMask,
"gateway": gateway,
"dhcp_enabled": dhcpEnabled,
"name_server_1": dnsServer1IPAddress,
"name_server_2": dnsServer2IPAddress,
"http_port": httpPort,
"https_port": httpsPort,
"year": year,
API v4
- 403 -
Pharos Designer User Manual
"month": month,
"day": day,
"hour": hour,
"minute": minute,
"second": second,
"watchdog_enabled": watchdogEnabled,
"log_level": logLevel,
"syslog_enabled": syslogEnabled,
"syslog_ip": syslogIpAddress,
"ntp_enabled": ntpEnabled,
"ntp_ip": ntpIpAddress,
"password": password
}
Argument ipAddress subnetMask gateway dhcpEnabled dnsServer1IPAddress dnsServer2IPAddress httpPort httpsPort year month day hour minute second watchdogEnabled logLevel syslogEnabled syslogIpAddress ntpEnabled ntpIpAddress password
Type string string string boolean string string integer integer integer integer (0-11) integer (1-31) integer (0-23) integer (0-59) integer (0-59) boolean integer (0-5) boolean string boolean string string
If the response is 200 OK, the response body will be
{
Example
"192.168.1.2"
"255.255.255.0"
"192.168.1.1" true
"192.168.1.1"
"8.8.8.8"
80
443
2019
4
25
13
22
40 true
3 true
"192.168.1.4" true
"192.168.1.1"
"myPassword"
- 404 -
"restart": restart
} restart is a boolean. If true, the controller will reset imminently in order to apply the changes
JavaScript
edit_config(params, callback)
Sends a request to change the controller's configuration params is an object of the same format as in the HTTP request
The callback parameter will contain the same object as a response to the HTTP request
API Subscriptions
Subscriptions allow data to be pushed to the web interface whenever there is a change within the project.
show
Subscribe Timeline Status
Subscribes to changes in the timeline status (any change is pushed to the interface).
Show
Lua
Not currently available.
HTTP
Not currently available.
JavaScript
subscribe_timeline_status(callback)
Returns an object with the following properties:
Property num state onstage position
Return type number string ('none', 'running', 'paused', 'holding_at_end', 'released') boolean number (milliseconds)
Return Example
1
'running' true
5000
Callback is used to define a function that should be called whenever the data is received
Example: subscribe_timeline_status(function(t){ alert(t.num + ": " + t.state)
})
API v4
- 405 -
Pharos Designer User Manual
Subscribe Scene Status
Subscribes to changes in the scene status (any change is pushed to the interface).
Show
Lua
Not currently available.
HTTP
Not currently available.
JavaScript
subscribe_scene_status(callback)
Returns an object with the following properties:
Property num state onstage
Return type number
Return Example
1 string ('none', 'running', 'paused', 'holding_at_end', 'released') 'running' boolean true
Callback is used to define a function that should be called whenever the data is received
Example: subscribe_scene_status(function(s){ alert(s.num + ": " + s.state)
})
Subscribe Group Status
Subscribes to changes in group level, as set by the Master Intensity action (any change is pushed to the interface).
Show
Lua
Not currently available.
HTTP
Not currently available.
JavaScript
subscribe_group_status(callback)
Returns an object with the following properties:
Property num
Return type number
Return Example
1
- 406 -
name level string integer (0-255)
'Group 1'
128
Callback is used to define a function that should be called whenever the data is received
Example: subscribe_group_status(function(g){ alert(g.num + ": " + g.level)
})
Subscribe Remote Device Status
Subscribes to changes in Remote Device Online/Offline Status (any change is pushed to the interface).
Show
Lua
Not currently available.
HTTP
Not currently available.
JavaScript
subscribe_remote_device_status(callback)
Returns an object with the following properties:
Property num type online serial
Return type number string ('RIO 08', 'RIO 44', 'RIO 80','RIO D', 'RIO A', 'BPS') boolean string (of serial number)
Return Example
1
'Group 1' true
'001001'
Callback is used to define a function that should be called whenever the data is received
Example: subscribe_remote_device_status(function(r){ alert(r.num + ": " + r.level)
})
Subscribe Beacon
Subscribes to Beacons (any change is pushed to the interface).
Show
Lua
Not currently available.
API v4
- 407 -
Pharos Designer User Manual
HTTP
Not currently available.
JavaScript
subscribe_beacon(callback)
Returns an object with the following properties:
Property on
Return type Return Example boolean true
Callback is used to define a function that should be called whenever the data is received
Example: subscribe_beacon(function(b){ if (b.on){ alert("Beacon Turned On") else { alert("Beacon Turned Off")
}
})
Subscribe Lua
The receiver for the push_to_web() Lua function.
Show
Lua
Not currently available.
HTTP
Not currently available.
JavaScript
subscribe_lua(callback)
Returns an object with the following properties:
Property key
Return type as defined by push_to_web()
Return Example value
Callback is used to define a function that should be called whenever the data is received
Example:
- 408 -
subscribe_lua(function(l){ key = Object.keys(l)[0] value = l.key
alert(key + ": " + value)
})
API Objects
Below are the helper functions and objects in the project.
show
Variant
A Lua object that allows a type and range to be associated with a variable.
Show
Lua
See
.
HTTP
Not currently available.
JavaScript
Not currently available.
DateTime
A Lua object containing time data.
Show
Lua
The DateTime object contains the following properties:
Property
.year
.month
.monthday
.weekday
.hour
.minute
Return Type integer integer (0-11) integer (0-30) integer(0-6) integer(0-23) integer (0-59)
.second
integer (0-59)
.utc_timestamp
integer
.time_string
.date_string
string string
8
1
13
21
Return Example
2017
5
46
1494249706
- 409 -
API v4
Pharos Designer User Manual
HTTP
Not currently available.
JavaScript
Not currently available.
Printing An Enum
Lua functions to convert integers returned from some functions as text.
Show
Lua
digital_input_to_string() button_state_to_string()
Examples: log(digital_input_to_string(get_input(1))) str = button_state_to_string(get_bps(1):get_state(1))
HTTP
Not currently available.
JavaScript
Not currently available.
- 410 -
Завантажити
Реклама