Skip to content
HSYCO Wiki

SIACLIENT

The SIACLIENT driver implements a SIA (Security Industry Association protocol) client, following the DC-09 specification. It has been developed and tested with HSYCO acting as a SIA DC-09 client, sending messages to a SIA-compatible receiver. Compatibility with other SIA protocol variants is possible but not guaranteed.

The driver opens an outbound TCP connection to a SIA receiver, formats and sends messages (optionally encrypted), and handles acknowledgements/responses. It exposes datapoints to monitor both outgoing traffic and the incoming acknowledgements. Optional heartbeat (NULL) messages can be sent at a configurable interval.

  • IP Address: the SIA server IP address
  • IP Port: the SIA server TCP port
  • Shutdown when inactive: defaults to true.

Receiver option can be omitted since this field is not mandatory in SIA protocol.

Setting heartbeat to a value other than 0 will send a NULL message at the specified interval in seconds. The NULL message is a standard SIA DC-09 keep-alive message, containing no event data, used only to signal that the client is active.

Options

ID Default Values Description
receiver number Receiver identifier (`Rrcvr` in SIA message). Could be empty
lpref 0 number Line prefix (`Lpref` in SIA message)
account HSYCO number/letters Account identifier (`#acct` in SIA message).
encryption false true, false Enable/disable AES encryption (AES/CBC/NoPadding)
encryptiontype aes-128,aes-256 AES key size when encryption is active
secret string Secret key for AES encryption; must match the receiver configuration.
heartbeat 10 number Heartbeat interval (seconds) for NULL messages. Set 0 do disable heartbeat. The maximum value is 65535
Datapoint Type R/W Description
last.message.sent string R Last SIA message sent to the receiver.
message.queue.length number R Number of messages currently queued for sending.
received.account string R Account field extracted from the received acknowledgement/response.
received.crc hex string R CRC value received in the acknowledgement.
received.crc.calculated hex string R Locally calculated CRC of the received acknowledgement payload.
received.crc.error 0,1 R CRC validation: `0` = valid, `1` = error.
received.decrypted.message string R Decrypted acknowledgement body, when encryption is enabled.
received.event string R Parsed event/response information from the acknowledgement.
received.raw string R Raw incoming message received from the receiver.
received.seq number R Sequence number extracted from the acknowledgement.
received.timestamp string or `unknown` R Timestamp extracted from the acknowledgement, if present.
timestamp.seconds.elapsed number R Seconds since the last acknowledgement was received. Updated every 60s or on new message.
message string W Send the message to the SIA server
message.queue clear W Clear the message queue. Could be useful if the SIA server has not replied to the latest messages and the driver is trying ro re-send them and it's necessary to reset and restart with a new message
  • If `heartbeat` is set, the driver sends a NULL command every x seconds.
  • When the `message` datapoint is updated, the specified message is queued and transmitted as soon as possible.
  • After sending a message, the driver waits one second for a response from the SIA server. If no response is received, the message is placed back in the queue.
  • The queue can be cleared at any time by setting `message.queue = clear`

This JavaScript module generates randomized SIA (Security Industry Association) protocol messages for HSYCO automation systems. The code creates a timer that sends a new random security alarm message every 10 seconds to the siaclient.message I/O point.

The generator combines random elements from predefined arrays: 15 SIA event codes (BA, BR, CS, PA, GA, etc.), 35 building zones (LivingRoom, Kitchen, Garage, etc.), 9 account numbers (Nri1-Nri9), and 99 sensor indices to create over 465,000 unique message combinations.

Generated messages follow the standard SIA format: `***Nri3/BA42**** RKitchen`

Key Features:

  • Automatic random message generation every 10 seconds
  • Industry-standard SIA codes for burglary, fire, panic, and tamper alarms
  • Comprehensive zone coverage for typical building layouts
  • Easy customization by modifying the predefined arrays
  • The module is ideal for testing SIA client integrations and simulating realistic security system events in HSYCO environments.
INIT : {
    // Array of most common SIA codes for security alarms
    var siaCodes = [
        "BA", // Burglary alarm
        "BR", // Burglary restore
        "CS", // Communication supervision alarm
        "ZC", // Zone short circuit
        "TA", // Automatic test
        "PA", // Panic alarm
        "GA", // Gate/door alarm
        "ZD", // Zone disabled
        "OP", // Open/close
        "CA", // Tamper alarm
        "CG", // Tamper restore
        "AT", // Alarm test
        "RT", // Restore test
        "FA", // Fire alarm
        "FR"  // Fire restore
    ];
    
    // Array of zones/rooms
    var zones = [
        "LivingRoom", "Kitchen", "Bedroom1", "Bedroom2", "MasterBed", 
        "Bathroom", "Entrance", "Garage", "Backyard", "Basement",
        "Attic", "Office", "Study", "Dining", "Hallway", "Stairway",
        "Laundry", "Pantry", "Closet", "StorageRoom", "Utility",
        "Balcony", "Terrace", "Garden", "Pool", "Fence", "Gate",
        "FrontDoor", "BackDoor", "SideEntrance", "WindowLiving",
        "WindowKitchen", "WindowBedroom", "GardenGate", "Walkway", "Roof"
    ];
    
    // Function to generate a random number between min and max (inclusive)
    function getRandomInt(min, max) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }
    
    // Function to select a random element from an array
    function getRandomElement(arr) {
        return arr[Math.floor(Math.random() * arr.length)];
    }
    
    // Function to generate a random SIA message
    function generateRandomSiaMessage() {
        var account = "Nri" + getRandomInt(1, 9);           // Account from 1 to 9
        var code = getRandomElement(siaCodes);              // Random SIA code
        var index = getRandomInt(1, 99);                    // Sensor index from 1 to 99
        var zone = "R" + getRandomElement(zones);           // Random zone
        
        return "***" + account + "/" + code + index + "**** " + zone;
    }
    
    programTimerRepeat("testsia", 10);
}

function programTimerEvent(name) : {
    
    if (name.toLowerCase() == "testsia"){
        // Genera un messaggio SIA completamente casuale
        var randomMessage = generateRandomSiaMessage();
        
        // Invia il messaggio SIA
        ioSet("siaclient.message", randomMessage);
    }
}

Example of sending a SIA message every 60 seconds using basic EVENT logs.

TIME: io siamessage.message = "TEST"

This will cause the driver to send a message like this one (if encryption isn't active):

6A2B004B"SIA-DCS"0001L1R1#12345[#12345|TEST]_14:09:11,08-19-2025

Following the SIA protocol message syntax:

<LF><TYPE><CRC><LLL><SEQ><RRCVR><LPREF><#ACCT>[#ACCT>|payload]<CR>
  • initial release

SIA is a trademark of Security Industry Association