Functions Registry¶
Framework-provided functions that Things can implement. Each function provides states, actions, events, and optional properties.
Axis note. This is the device-side view — what a Thing can be. For the adapter-side view — the integration capabilities we expect an adapter to perform (establish encrypted comms, manage credentials, sync time, run incremental vs full sync, APB…) — see
capability-catalog.md. A catalog capability is backed by one or more of the functions below, but the two are different axes; don't conflateReader/Door(functions) with "credential management" / "door control" (adapter capabilities).
What is a Function?¶
Functions are reusable capabilities that Things can implement:
- States - Enumerated state machine (e.g.,
intrusion.armed,intrusion.disarmed,intrusion.alarm) - Actions - Methods to transition between states (e.g.,
Armed(),Disarmed()) - Events - Automatically published on state changes (e.g.,
pq.event.intrusion.armed) - Properties - Configurable behavior (optional, adapter can override)
# Attach function to device type
device_types:
- type_id: MotionDetector
functions:
IntrusionDetector: # references framework function
properties:
sensitivity: 75 # optional property override
Functions are framework-provided; the per-function pages below are the authoritative reference.
Access Control¶
Door¶
Physical access control door with strike, deadbolt, and position detection.
- Key States:
lock.secured,lock.unsecured,lock.deadbolt,lock.held,position.open,intrusion.forced,intrusion.propped,emergency.lockdown,emergency.evacuation - Key Actions:
Secured(),Unsecured(),UnsecuredByRex(),Locked(),Opened(),Closed(),ForcedOpen(),HeldOpenTooLong() - Properties:
has_door_contact,has_lock_monitor,use_framework_timers,doorlongopen_timeout_seconds,auto_relock_timeout_seconds,access_grant_timeout_seconds
Reader¶
Credential reader for access control (card, PIN, biometric, mobile).
- Key States:
access.reader.lockout,access.reader.duress - Key Actions:
AccessGranted(),AccessDenied(),DuressCodeEntered(),LockoutTriggered(),LockoutCleared() - Properties: None (adapter-specific)
Intrusion Detection¶
IntrusionDetector¶
Generic intrusion detection sensor (PIR, contact, glass break, shock, vibration, curtain, dual-tech).
- Key States:
detection.clear,intrusion.prealarm,intrusion.alarm,intrusion.tamper,intrusion.bypassed,intrusion.masked,detection.motion.active,position.open,supervision.fault - Key Actions:
Alarm(),Bypassed(),MotionDetected(),ContactOpen(),ForcedEntry(),TestModeActivated() - Properties: None (all adapter-specific)
FireDetector¶
Generic fire detection sensor (smoke, heat, flame, combustion, manual call point, suppression flow). Parallel to IntrusionDetector; a panel zone that can report either carries both functions. Fire actions are Fire-prefixed to avoid shortcut collisions on a dual-function Thing.
- Key States:
detection.clear,fire.alarm,fire.alarm.general,fire.alarm.section,fire.alarm.conditional,fire.prealarm,fire.smoke,fire.heat,fire.trouble,fire.test - Key Actions:
FireAlarm(),FireGeneralAlarm(),FireSectionAlarm(),SmokeDetected(),ManualFireAlarm(),SuppressionFlow(),FireCleared(),FireFault() - Properties: None (all adapter-specific)
FirePanel¶
Fire alarm control panel for panel-level EPS/FACP state: alarm summary, acknowledge, reset, day/night mode, blocking, tests, and service/configuration access.
- Key States:
fire.panel.day,fire.panel.night,fire.alarm.general,fire.alarm.section,fire.alarm.conditional,fire.trouble,fire.alarm.blocked,fire.test - Key Actions:
FirePanelGeneralAlarm(),FirePanelAlarmAcknowledged(),FirePanelReset(),FirePanelDayMode(),FirePanelNightMode(),FirePanelTestStarted() - Properties: None (all adapter-specific)
FirePoint¶
Addressable fire point for panels that expose per-address status bitmaps: disabled, test, alarm, active input, active output, and trouble.
- Key States:
detection.clear,fire.input.active,fire.output.active,fire.disabled,fire.test,fire.test.activation,fire.trouble,fire.alarm.* - Key Actions:
FirePointGeneralAlarm(),FirePointDisabled(),FirePointTestStarted(),FirePointTrouble(),FirePointLost(),FirePointDuplicate() - Properties: None (all adapter-specific)
FireSounder¶
Fire sounder/siren output with activation, silence, enable, and disable state.
- Key States:
control.on,control.off,fire.disabled - Key Actions:
FireSounderActivated(),FireSounderDeactivated(),FireSounderSilenced(),FireSounderEnabled(),FireSounderDisabled() - Properties: None (all adapter-specific)
Sounder¶
Audible alarm signaling output for intrusion and non-fire installations.
- Key States:
control.on,control.off - Key Actions:
SounderActivated(),SounderDeactivated(),SounderSilenced() - Properties: None (all adapter-specific)
SounderSupervision¶
Supervision of an audible alarm signaling circuit, independent of the sounder's active state.
- Key States:
supervision.normal,supervision.fault - Key Actions:
SounderFault(),SounderFaultCleared() - Properties: None (all adapter-specific)
FireRouting¶
Fire alarm routing/transmission output to remote display, brigade dispatch, ZDP, OPPO, or monitoring equipment.
- Key States:
control.on,control.off,fire.disabled - Key Actions:
FireRoutingStarted(),FireRoutingStopped(),FireRoutingEnabled(),FireRoutingDisabled() - Properties: None (all adapter-specific)
FireControlOutput¶
Fire protection control output such as suppression, evacuation, door release, HVAC shutdown, smoke control, or other fire-control relay.
- Key States:
control.on,control.off,fire.output.active,fire.disabled - Key Actions:
FireControlActivated(),FireControlDeactivated(),FireControlEnabled(),FireControlDisabled() - Properties: None (all adapter-specific)
Partition¶
Logical alarm group/area containing detectors with independent arming state.
- Key States:
intrusion.disarmed,intrusion.armed,intrusion.armed.instant,intrusion.armed.partial,intrusion.entry,intrusion.exit,intrusion.alarm,supervision.test.walktest - Key Actions:
Armed(),ArmedInstant(),ArmedPartial(),Disarmed(),AlarmTriggered(),DuressDetected() - Properties: None (device-side timing configuration)
SecurityKeypad¶
Arming keypad with panic codes and display feedback.
- Key States:
intrusion.disarmed,intrusion.armed,intrusion.entry,intrusion.exit,emergency.panic,lifecycle.maintenance - Key Actions:
Panic(),PanicFire(),PanicMedical(),PanicPolice(),DisplayReady(),DisplayArmed() - Properties: None (adapter-specific)
Hardware Monitoring¶
ConnectionBase¶
Device communication lifecycle handling.
- Key States:
connection.online,connection.offline,connection.degraded - Actions: None (state driven by the framework connection lifecycle)
- Properties: None
Comm¶
Bus/link communication supervision for a child device on a shared transport.
- Key States:
connection.online,connection.offline - Key Actions:
Disconnected(),Reconnected() - Properties: None
Power¶
Power supply and battery monitoring.
- Key States:
supervision.power.ok,supervision.power.fault,supervision.battery.low,supervision.battery.critical,supervision.battery.charging,supervision.battery.fault - Key Actions:
AcFault(),AcRestored(),BatteryLow(),BatteryCritical(),BatteryNormal() - Properties: None
Tamper¶
Physical tamper detection for device enclosures.
- Key States:
intrusion.tamper,intrusion.tamper.sealed - Key Actions:
TamperDetected(),TamperCleared() - Properties: None
Generic I/O¶
Input¶
Generic monitored input point (sensor, contact, switch).
- Key States:
detection.clear,intrusion.alarm,supervision.fault - Key Actions:
Activated(),Deactivated(),Fault() - Properties: None
Output¶
Generic output control point (relay, actuator).
- Key States:
control.on,control.off - Key Actions:
Activated(),ActivatedRemote(),Deactivated(),DeactivatedRemote() - Properties: None
Data Synchronization¶
AccessSynchronization¶
Access control data synchronization (credential upload/download).
- Key States:
access.sync.idle,access.sync.active,access.sync.failed - Properties: None (adapter implements sync logic)
AntipassbackSynchronization¶
Antipassback zone/state synchronization for directional access control.
- Key States:
antipassback.sync.idle,antipassback.sync.active,antipassback.sync.failed - Properties: None (adapter implements sync logic)
TimeSynchronization¶
Periodic device clock synchronization with timezone support.
- Key Properties:
timezone,sync_interval_minutes - Notes: No states/actions - periodic operation
Polling¶
StatusPoll¶
Periodic device status polling when state is not pushed as events.
- Key Properties:
poll_interval_seconds - Notes: No states/actions - periodic operation
HistoryPoll¶
Periodic event-history polling for devices that buffer events.
- Key Properties:
history_poll_interval_seconds - Notes: No states/actions - periodic operation
Function Comparison Table¶
| Function | Category | Primary Use | Key States | Custom Actions |
|---|---|---|---|---|
| Door | Access | Door control | lock.secured, lock.unsecured, lock.deadbolt, intrusion.forced | Opened, Closed |
| Reader | Access | Credential reading | access.reader.lockout, access.reader.duress | AccessGranted, AccessDenied |
| IntrusionDetector | Intrusion | Intrusion sensor | intrusion.alarm, intrusion.bypassed, detection.motion.active | Bypassed, ForcedEntry |
| FireDetector | Fire | Fire sensor | fire.alarm, fire.smoke, fire.heat, fire.prealarm | FireAlarm, SmokeDetected, ManualFireAlarm |
| FirePanel | Fire | Fire panel | fire.panel.day, fire.panel.night, fire.alarm.*, fire.trouble | FirePanelGeneralAlarm, FirePanelReset |
| FirePoint | Fire | Addressable fire point | fire.input.active, fire.output.active, fire.disabled, fire.test | FirePointDisabled, FirePointTrouble |
| FireSounder | Fire | Fire siren/sounder | control.on, control.off, fire.disabled | FireSounderActivated, FireSounderSilenced |
| Sounder | Alarm | Siren, bell, buzzer | control.on, control.off | SounderActivated, SounderSilenced |
| SounderSupervision | Monitoring | Sounder circuit health | supervision.normal, supervision.fault | SounderFault, SounderFaultCleared |
| FireRouting | Fire | Fire transmission | control.on, control.off, fire.disabled | FireRoutingStarted, FireRoutingDisabled |
| FireControlOutput | Fire | Fire-control relay | fire.output.active, control.off, fire.disabled | FireControlActivated, FireControlDisabled |
| Partition | Intrusion | Alarm group | intrusion.armed, intrusion.disarmed, intrusion.alarm | Armed, DuressDetected |
| SecurityKeypad | Intrusion | Arming keypad | intrusion.armed, emergency.panic | Panic, DisplayReady |
| ConnectionBase | Monitoring | Device connectivity | connection.online, connection.offline | - |
| Comm | Monitoring | Bus link supervision | connection.online, connection.offline | Disconnected, Reconnected |
| Power | Monitoring | Power/battery | supervision.power.ok, supervision.battery.low | AcFault, BatteryLow |
| Tamper | Monitoring | Tamper detection | intrusion.tamper, intrusion.tamper.sealed | TamperDetected |
| Input | Generic I/O | Generic input | detection.clear, intrusion.alarm, supervision.fault | Activated, Fault |
| Output | Generic I/O | Generic output | control.on, control.off | Activated, Deactivated |
| AccessSynchronization | Data Sync | Credential sync | access.sync.idle, .active, .failed | (adapter-defined) |
| AntipassbackSynchronization | Data Sync | APB sync | antipassback.sync.idle, .active, .failed | (adapter-defined) |
| TimeSynchronization | Data Sync | Clock sync | (none) | (periodic) |
| StatusPoll | Polling | Status polling | (none) | (periodic) |
| HistoryPoll | Polling | History polling | (none) | (periodic) |
Using Functions¶
In YAML Configuration¶
device_types:
- type_id: IntrusionPanel
name: "Intrusion Alarm Panel"
functions:
Partition: # logical alarm group
ConnectionBase: # device connectivity
Power: # power monitoring
properties:
entry_delay_seconds: 30
- type_id: PIRMotionDetector
name: "PIR Motion Detector"
functions:
IntrusionDetector: # sensor function
Tamper: # tamper detection
properties:
sensitivity: 75
In Code¶
public class PIRDetectorThing : Thing
{
public IntrusionDetectorFunction Detector { get; }
public TamperFunction Tamper { get; }
protected override async Task HandleDeviceEvent(DetectorEvent evt, CancellationToken ct)
{
switch (evt.Type)
{
case DetectorEventType.MotionDetected:
await Detector.MotionDetected(evt.Timestamp);
break;
case DetectorEventType.Tamper:
await Tamper.TamperDetected(evt.Timestamp);
break;
}
}
}
See Also¶
- Concepts: Functions - Function architecture and patterns
- Reference: Generated Code API - Using generated function classes
- Patterns: Event Publishing - Function methods vs PqEvent