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. Adapter code uses the generated enum member (e.g.,
Armed,Disarmed,Alarm); the status id it publishes is the canonical string (e.g.,intrusion.armed). Key states below are listed asMember(status.id). - 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:
Secured(lock.secured),Unsecured(lock.unsecured),Deadbolt(lock.deadbolt),Held(lock.held),Open(position.open),Forced(intrusion.forced),Propped(intrusion.propped),Lockdown(emergency.lockdown),Evacuation(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:
ReaderLockout(access.reader.lockout),ReaderDuress(access.reader.duress) - Key Actions:
AccessGranted(),AccessDenied(),DuressCodeEntered(),LockoutTriggered(),LockoutCleared() - Properties:
card_format
Intrusion Detection¶
IntrusionDetector¶
Generic intrusion detection sensor (PIR, contact, glass break, shock, vibration, curtain, dual-tech).
- Key States:
Clear(detection.clear),Prealarm(intrusion.prealarm),Alarm(intrusion.alarm),Tamper(intrusion.tamper),Bypassed(intrusion.bypassed),Masked(intrusion.masked),MotionActive(detection.motion.active),Open(position.open),Fault(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:
Clear(detection.clear),Alarm(fire.alarm),AlarmGeneral(fire.alarm.general),AlarmSection(fire.alarm.section),AlarmConditional(fire.alarm.conditional),Prealarm(fire.prealarm),Smoke(fire.smoke),Heat(fire.heat),Trouble(fire.trouble),Test(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:
PanelDay(fire.panel.day),PanelNight(fire.panel.night),AlarmGeneral(fire.alarm.general),AlarmSection(fire.alarm.section),AlarmConditional(fire.alarm.conditional),Trouble(fire.trouble),AlarmBlocked(fire.alarm.blocked),Test(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:
Clear(detection.clear),InputActive(fire.input.active),OutputActive(fire.output.active),Disabled(fire.disabled),Test(fire.test),TestActivation(fire.test.activation),Trouble(fire.trouble),AlarmGeneral/AlarmSection/AlarmConditional(fire.alarm.*) - Key Actions:
FirePointGeneralAlarm(),FirePointDisabled(),FirePointTestStarted(),FirePointTrouble(),FirePointLost(),FirePointDuplicate() - Properties: None (all adapter-specific)
FireIntervention¶
Fire alarm intervention window on a panel: confirmation timer, operator investigation timer, and whether the window ended with the fire brigade being called.
- Key States:
InterventionIdle(fire.intervention.idle, hidden),InterventionConfirming(fire.intervention.confirming),InterventionInvestigating(fire.intervention.investigating),InterventionDispatched(fire.intervention.dispatched) - Key Actions:
FireInterventionStarted(),FireInterventionExtended(),FireInterventionDispatched(),FireInterventionCancelled(),FireInterventionCleared() - Properties: None (all adapter-specific)
FireSounder¶
Fire sounder/siren output with activation, silence, enable, and disable state.
- Key States:
On(control.on),Off(control.off),Disabled(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:
On(control.on),Off(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:
Normal(supervision.normal),Fault(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:
On(control.on),Off(control.off),Disabled(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:
On(control.on),Off(control.off),OutputActive(fire.output.active),Disabled(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:
Disarmed(intrusion.disarmed),Armed(intrusion.armed),ArmedInstant(intrusion.armed.instant),ArmedPartial(intrusion.armed.partial),Entry(intrusion.entry),Exit(intrusion.exit),Alarm(intrusion.alarm),TestWalktest(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:
Disarmed(intrusion.disarmed),Armed(intrusion.armed),Entry(intrusion.entry),Exit(intrusion.exit),Panic(emergency.panic),Maintenance(lifecycle.maintenance) - Key Actions:
Panic(),PanicFire(),PanicMedical(),PanicPolice(),DisplayReady(),DisplayArmed() - Properties: None (adapter-specific)
Hardware Monitoring¶
ConnectionBase¶
Device communication lifecycle handling.
- Key States:
Online(connection.online, hidden),Offline(connection.offline),Degraded(connection.degraded) - Actions: None (state driven by the framework connection lifecycle)
- Properties: None
AuthenticatedProtocol¶
Protocol authentication and secure-session health for authenticated device sessions.
- Key States:
Authenticated(protocol.authenticated, hidden),AuthenticationFailed(protocol.authentication.failed),HandshakeFailed(protocol.handshake.failed) - Key Actions:
SetAuthenticated(),SetAuthenticationFailed(),SetHandshakeFailed(),SetDefault() - Properties: None
Comm¶
Bus/link communication supervision for a child device on a shared transport.
- Key States:
Online(connection.online, hidden),Offline(connection.offline) - Key Actions:
Disconnected(),Reconnected() - Properties: None
Power¶
Power supply and battery monitoring.
- Key States:
PowerOk(supervision.power.ok, hidden),PowerFault(supervision.power.fault),BatteryLow(supervision.battery.low),BatteryCritical(supervision.battery.critical),BatteryCharging(supervision.battery.charging),BatteryFault(supervision.battery.fault) - Key Actions:
AcFault(),AcRestored(),BatteryLow(),BatteryCritical(),BatteryNormal() - Properties: None
Tamper¶
Physical tamper detection for device enclosures.
- Key States:
Tamper(intrusion.tamper),TamperSealed(intrusion.tamper.sealed, hidden) - Key Actions:
TamperDetected(),TamperCleared() - Properties: None
Generic I/O¶
Input¶
Generic monitored input point (sensor, contact, switch).
- Key States:
Clear(detection.clear, hidden),Alarm(intrusion.alarm),Fault(supervision.fault) - Key Actions:
Activated(),Deactivated(),Fault() - Properties: None
Output¶
Generic output control point (relay, actuator).
- Key States:
On(control.on),Off(control.off, hidden) - Key Actions:
Activated(),ActivatedRemote(),Deactivated(),DeactivatedRemote() - Properties: None
Data Synchronization¶
AccessSynchronization¶
Access control data synchronization (credential upload/download).
- Key States:
SyncIdle(access.sync.idle, hidden),SyncActive(access.sync.active),SyncFailed(access.sync.failed) - Key Properties:
access_sync_enabled
AntipassbackSynchronization¶
Antipassback zone/state synchronization for directional access control.
- Key States:
SyncIdle(antipassback.sync.idle, hidden),SyncActive(antipassback.sync.active),SyncFailed(antipassback.sync.failed) - Properties: None — governed by the
access_sync_enabledproperty of AccessSynchronization
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 | Secured, Unsecured, Deadbolt, Forced | Opened, Closed |
| Reader | Access | Credential reading | ReaderLockout, ReaderDuress | AccessGranted, AccessDenied |
| IntrusionDetector | Intrusion | Intrusion sensor | Alarm, Bypassed, MotionActive | Bypassed, ForcedEntry |
| FireDetector | Fire | Fire sensor | Alarm, Smoke, Heat, Prealarm | FireAlarm, SmokeDetected, ManualFireAlarm |
| FirePanel | Fire | Fire panel | PanelDay, PanelNight, AlarmGeneral, Trouble | FirePanelGeneralAlarm, FirePanelReset |
| FirePoint | Fire | Addressable fire point | InputActive, OutputActive, Disabled, Test | FirePointDisabled, FirePointTrouble |
| FireIntervention | Fire | Intervention window | InterventionConfirming, InterventionInvestigating, InterventionDispatched | FireInterventionStarted, FireInterventionDispatched |
| FireSounder | Fire | Fire siren/sounder | On, Off, Disabled | FireSounderActivated, FireSounderSilenced |
| Sounder | Alarm | Siren, bell, buzzer | On, Off | SounderActivated, SounderSilenced |
| SounderSupervision | Monitoring | Sounder circuit health | Normal, Fault | SounderFault, SounderFaultCleared |
| FireRouting | Fire | Fire transmission | On, Off, Disabled | FireRoutingStarted, FireRoutingDisabled |
| FireControlOutput | Fire | Fire-control relay | OutputActive, Off, Disabled | FireControlActivated, FireControlDisabled |
| Partition | Intrusion | Alarm group | Armed, Disarmed, Alarm | Armed, DuressDetected |
| SecurityKeypad | Intrusion | Arming keypad | Armed, Panic | Panic, DisplayReady |
| ConnectionBase | Monitoring | Device connectivity | Online, Offline | - |
| Comm | Monitoring | Bus link supervision | Online, Offline | Disconnected, Reconnected |
| Power | Monitoring | Power/battery | PowerOk, BatteryLow | AcFault, BatteryLow |
| Tamper | Monitoring | Tamper detection | Tamper, TamperSealed | TamperDetected |
| Input | Generic I/O | Generic input | Clear, Alarm, Fault | Activated, Fault |
| Output | Generic I/O | Generic output | On, Off | Activated, Deactivated |
| AccessSynchronization | Data Sync | Credential sync | SyncIdle, SyncActive, SyncFailed | access_sync_enabled |
| AntipassbackSynchronization | Data Sync | APB sync | SyncIdle, SyncActive, SyncFailed | (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