Send Event
Trigger a Singlewire event programmatically.
Function
DeviceAPI.SendEvent(eventId, options)
Parameters
| Name | Type | Required | Description |
| eventID | string | true | Singlewire Event ID (from CustomEvents config) |
| options | table | false | Extra settings |
Options Table
{source = "panic_button", -- optional label for logging/devicesplayer = Player -- REQUIRED for live (Message Type 0) events}
Examples
Non-Live Event
DeviceAPI.SendEvent("911", {source = "panic button"})
Live Paging Event
DeviceAPI.SendEvent("100", {player = player,source = "dispatch console"})
Return Values
ok:boolean, reason:string
Common reasons:
- ended
- busy
- no_power
- unknown_event
- live_requires_player