Space CE Configuration: Macros

Macros are a way to dynamically execute functionality from an event or time based trigger.

Some examples of macro usage:

  • Automatically powering the room on at a set time.
  • Recalling DSP presets when rooms are linked.
  • Triggering default routes on system startup.

Macros are composed of triggers and actions.

Triggers can be one of the following:

Event Based TriggerTriggered when a room / device state changes.
Time Based TriggerTriggered when the current time matches the defined time.

Event Based Triggers

Event based triggers have the following properties:

PropertyDescription
IDThe unique ID of the event trigger.
GuidThe GUID of the object generating the event.
PropertyThe name of the object’s property that will be monitored for the trigger.
KeyWhen the property is a dictionary / map: the key that will be used to access the value that will be monitored by the trigger.
IndexWhen the property is a list: the index of the value that will be monitored for the trigger.
ValueThe value which, if the property’s value is matched with, will trigger the macro.

Events Reference – Room:

Below is a list of useful event triggers regarding the room state.


Guid
PropertyValueKey / IndexDescription
roomPowerIsOntrueTriggered when the room’s RoomMode property is not “Off”.
roomPowerIsOnfalseTriggered when the room’s RoomMode property is “Off”.
roomRoomModePresentationCommon room mode that is set when the room is powered on.
roomRoomModeResetTriggered when room “reset” is triggered from the UI.
roomSourceIsSelectedtrueAV Source ID
(eg. source.pc)
Triggered when the key (AV Source ID) is routed to ANY destination.
roomSourceIsSelectedfalseAV Source ID
(eg. source.pc)
Triggered when the key (AV Source ID) is no longer routed to ANY destination.
roomSourceSelectAV Source ID
(eg. source.pc)
Destination Type
(eg. Main / Preview)
Triggered when a source (referenced by AV Source ID) is routed to a destination type.
roomSourceHasSynctrueAV Source ID
(eg. source.pc)
Triggered when a source (referenced by AV Source ID) has input sync detected on any of its defined Video Sync Devices.
roomSourceHasSyncfalseAV Source ID
(eg. source.pc)
Triggered when a source (referebced by AV Source ID) that previously had input sync detected, has lost sync.
roomRoomOccupiedtrueTriggered when the room’s sensors have detected occupancy.
roomRoomOccupiedfalseTriggered when the room’s sensors are not detecting occupancy.

Events Reference – Room Link:

Below is a list of useful event triggers regarding the room link state.


Guid
PropertyValueKey / IndexDescription
roomlinkSecondaryRoomStatussecondaryRoom Link Room ID.
(eg. room.1)
Triggered when we link with the given room link room, and we are the primary room.
(Note room link room ID refers to Room Link / Secondary Rooms / ID)
roomlinkSecondaryRoomStatusprimaryRoom Link Room ID.
(eg. room.1)
Triggered when we link with the given room link room, and we are the secondary room.
(Note room link room ID refers to Room Link / Secondary Rooms / ID)
roomlinkSecondaryRoomStatusunlinkedRoom Link Room ID.
(eg. room.1)
Triggered when the room of the given ID becomes unlinked from us (it was previously primary or secondary).

Events Reference – Audio:

Below is a list of useful event triggers regarding the room’s audio states.


Guid
PropertyValueKey / IndexDescription
audioCeilingMicsMutedtrueTriggered when ceiling microphons are muted.
audioCeilingMicsMutedfalseTriggered when ceiling microphones are unmuted.
audioChannelAudioLevel100Audio Source Channel ID (eg. mic.1)Triggered when the given Audio Source Channel ID has its level adjusted. Value is percentage (0-100).
audioChannelAudioMutetrueAudio Source Channel ID (eg. mic.1)Triggered when the given Audio Source Channel ID is muted.

Events Reference – Cameras:

Below is a list of useful event triggers regarding the room’s camera states.


Guid
PropertyValueKey / IndexDescription
cameraCameraPowertrueCamera Device ID (eg. dev.camera.1)Triggered when the given camera device ID is powered on.
cameraCameraSelectedtrueCamera Device ID (eg. dev.camera.1)Triggered when the given camera device ID is selected for control on the user interface.

Time Based Triggers

Time based triggers will trigger the macro at the defined date and time.

Time based triggers have the following properties:

PropertyDescription
IDThe unique ID of the time trigger.
TimeThe time of day (in 24 hour time, HH:mm:ss) that the macro will trigger.
DaysThe day/s of the week on which the macro is to trigger. Accepts comma delimited day of week names, or the values “Weekday” or “Weekend”.

Macro Actions Reference

Macro actions define what will happen when the macro is triggered.

Actions have the following properties:

PropertyDescription
IDThe unique ID of the macro action.
ScriptThe lambda expression for the action.
DelayThe delay, in seconds, between the macro being triggered and the script being run.
Device IDFor scripts containing the “Device” keyword, the ID of the device it refers to.

Macro Actions – Room

Below is a list of useful actions that can be performed against the room.

ScriptDescription
room.SetSourceSelect("source.pc", "Main Display");Routes the provided Source ID to all destinations with the provided Destination Type.
room.SetSourceSelect("None", "Main Display");Clears the route and triggers Source Deselection Behaviour on all destinations with the provided Destination Type.
room.SetSourceSelect("Off", "Main Display");Triggers the Shutdown Behaviour on all destinations with the provided Destination Type.
room.SetPreview("source.pc");Routes the provided Source ID to all preview destinations.
room.SetRoomMode("Off");Powers off the room.
room.SetRoomMode("Presentation");Sets the room mode to presentation. If the room is off: powers it on.
room.SetDestinationGroupSourceSelect("dest.group.left", "source.pc");Routes the provided Source ID to the provided Destination Group ID.
room.RouteEncoderDecoderStreamByDeviceId("dev.encoder.1", "dev.decoder.1");Set the provided decoder’s audio & video streams to the encoder’s audio & video streams.
room.RouteEncoderDecoderVideoStreamByDeviceId("dev.encoder.1", "dev.decoder.1");Set the provided decoder’s video stream to the encoder’s video stream.
room.RouteEncoderDecoderAudioStreamByDeviceId("dev.encoder.1", "dev.decoder.1");Set the provided decoder’s audio stream to the encoder’s audio stream.
room.PairUsb("dev.remote.device", "dev.local.device");Pairs the USB peripherals (keyboard/mouse/etc) on the Remote Device to the USB device (PC) on the Local Device on the first available USB route slot, otherwise on the 1st route slot.

Remote Device is generally connected to USB peripherals eg. keyboard mouse.
Local Device is generally connected to a PC.
room.PairUsb("dev.remote.device", "dev.local.device", 3);Same as above action, but the route is forced on the index provided. (In this example: 3)

Macro Actions – Room Link

ScriptDescription
room.SetDestGroupIfPrimary("dest.group.left", "source.pc");If the room is currently linked as a primary room, routes the given source to the given destination group.
room.SetDestGroupIfSecondary("dest.group.left", "roomlink");If the room is currently linked as a secondary room, routes the given source to the given destination group.

Macro Actions – Video

ScriptDescription
video.ActivateAllMotors();Extends all motors defined against AV displays.
video.DeactivateAllMotors();Retracts all motors defined against AV displays.
video.SetDestinationDisabled("display.1", true);Disables / enables the AV destination with the provided ID. When a destination is disabled it will trigger its shutdown behaviour, and will not be routed to.

Macro Actions – Audio

ScriptDescription
audio.ResetAudioChannelLevels();Resets every audio channel to their default level.
audio.SetAudioLevel("prog.audio", 50);Set the fader level (percentage, 0-100) of the audio source with the provided ID.
audio.SetAudioMute("prog.audio", true);Mute / unmute the audio source with the provided ID.

Macro Actions – Display Devices

ScriptDevice IDDescription
device.SetPowerOn();dev.display.1
(Device ID of display we are controlling)
Powers on the display and sets the default volume and input.
device.PollPowerOn();dev.display.1Polls the display for its power state, and if the display is off: sends a power on command.
device.SetInput("Hdmi1");dev.display.1Sets the display’s input to Hdmi1.
device.SetVideoMute(true);dev.display.1Video mutes the display.
device.SetVideoMute(false);dev.display.1Unmutes the display (video mute).

Related Articles