BACnet Guide

Integrate building automation devices over BACnet/IP and MS/TP.

Overview

ControlBird speaks BACnet natively in both client and server roles. As a client, ControlBird reads and writes properties on remote BACnet devices, discovers devices on the network, and subscribes to Change-of-Value (COV) notifications. As a server, ControlBird exposes mapped Store entities as BACnet objects so that third-party supervisors, workstations, and controllers can read and command them.

Each role supports two transports: BACnet/IP (over UDP, with both IPv4 and IPv6) and BACnet MS/TP (Master-Slave / Token-Passing over RS-485 serial). All configuration is performed through the Device Manager app using dedicated controller, endpoint, and mapper entities. No manual files are required, and the system automatically handles device discovery, reconnection, and health checking.

Where BACnet fits

BACnet is the dominant protocol for HVAC, lighting, access control, and life-safety equipment in commercial buildings. Use the client role to pull data from existing building controllers; use the server role to publish ControlBird logic into a building management system.

Transports

TransportMediumKey Settings
BACnet/IPUDP, IPv4 or IPv6Host, Port (default 47808), LocalPort, Interface, IpVersion
BACnet MS/TPRS-485 serialSerialPort, BaudRate, Parity, DataBits, StopBits, MstpMacAddress, MaxMaster, MaxInfoFrames

Default ports

BACnet/IP uses UDP port 47808 (0xBAC0) by default for both client and server. The default local UDP port for the BACnet/IP client is 47810; the remote port defaults to 47808. MS/TP defaults to a baud rate of 38400.

Entity Model

A BACnet integration is built from a controller, one or more endpoints, and a set of mappers. The controller groups its endpoints together and coordinates redundancy across them. Each endpoint configures a transport. Mappers tie BACnet objects to ControlBird entity fields.

EntityRolePurpose
BacnetClientControllerClientManages client connections to remote devices for reading/writing properties
BacnetClientEndpointClientBACnet/IP client endpoint with host/port and discovery settings
BacnetMstpClientEndpointClientMS/TP client endpoint for serial RS-485 connections
BacnetServerControllerServerExposes ControlBird entities as BACnet objects
BacnetServerEndpointServerBACnet/IP server endpoint accepting client connections
BacnetMstpServerEndpointServerMS/TP server endpoint for serial RS-485 connections
BacnetMapperClientMaps a BACnet object to an entity field for read/write
BacnetServerMapperServerMaps an entity field to a BACnet object for get/set

All endpoints share common settings, including health-check timing, TLS configuration (TlsEnabled, Certificate), logging (Logging, MaxLogFiles, MaxLogSizeMb), and retry backoff (MinRetryBackoffMs, MaxRetryBackoffMs).

Configuration Workflow

  1. Open the Device Manager app in ControlBird.
  2. Create a BacnetClientController or BacnetServerController under Root/Controllers/Protocols/.
  3. Create a matching endpoint (BacnetClientEndpoint, BacnetMstpClientEndpoint, BacnetServerEndpoint, or BacnetMstpServerEndpoint) under the controller. Add more than one endpoint to enable redundancy.
  4. For BACnet/IP: set Host (IP address), Port (default 47808), Interface (network device), and IpVersion (IPv4 or IPv6).
  5. For BACnet MS/TP: set SerialPort (e.g. /dev/ttyUSB0), BaudRate (e.g. 38400), Parity, DataBits, StopBits, MstpMacAddress, MaxMaster, and MaxInfoFrames.
  6. Set DeviceId to the target BACnet device instance number.
  7. Enable Logging if communication logging is required.
  8. Client: create BacnetMapper entities to map BACnet objects to entity fields. Server: create BacnetServerMapper entities with source ControlBird entity paths.

Network and certificates

BACnet/IP endpoints support TLS via the TlsEnabled flag and an optional Certificate. See the certificates guide to provision certificates, and walkthrough step 7: Connect a Device for a hands-on device setup.

Device Discovery

The client uses the standard Who-Is / I-Am handshake to locate devices on the network by their device instance number. The discovery timeout defaults to 5 seconds (DiscoveryTimeoutMs: 5000). Resolved device addresses are cached for 5 minutes before the cache is refreshed, avoiding repeated broadcasts on a busy network.

Client Mappers

A BacnetMapper binds a single BACnet object property to a ControlBird entity field. It supports both reading from and writing to the remote device, with either polling or COV-subscription read modes.

FieldDescription
ObjectTypeBACnet object type (default AnalogValue)
ObjectInstanceInstance number of the object (e.g. 0, 1, 2)
PropertyIdProperty to access (default PresentValue)
ArrayIndexOptional array index (default 0)
DirectionRead (read from BACnet) or Write (write to BACnet)
ReadModePoll or Subscribe (COV)
PollIntervalMsPolling interval for read operations (default 1000)
PriorityWrite priority, 1 (highest) to 16 (lowest, default)
CovIncrementCOV threshold (real number) that triggers a subscribed update
TargetEntity / TargetFieldControlBird entity and field to bind
DisabledTemporarily disable the mapper

Read modes

For reads, choose between two modes:

  • Poll: ControlBird issues ReadProperty requests on the PollIntervalMs schedule. Multiple reads on the same device can be batched via ReadPropertyMultiple for efficiency.
  • Subscribe: ControlBird registers a Change-of-Value subscription and receives updates only when the value changes by at least CovIncrement. This minimizes network traffic for slowly-changing analog points.

Write priority

BACnet write operations use a 16-level priority array. ControlBird's Priority field ranges from 1 (highest) to 16 (lowest), and defaults to 16. Writes at a given priority occupy that slot in the device's priority array; lower-priority writes from other controllers will not override a higher-priority value.

Array index semantics

For array-valued properties, ArrayIndex 0 returns the size of the array, while indices 1 and above retrieve individual elements. Use 0 (the default) for scalar properties such as PresentValue.

Server Mappers

A BacnetServerMapper publishes a ControlBird entity field as a BACnet object property so external clients can read or command it. Server mappers configure ObjectType, ObjectInstance, and PropertyId only; array indices do not apply to server mappers.

FieldDescription
ObjectTypeExposed BACnet object type (default AnalogValue)
ObjectInstanceInstance number presented to clients
PropertyIdExposed property (default PresentValue)
DirectionGet (read from entity) or Set (write to entity); default Get
SourcePathPath to the source ControlBird entity
TargetEntity / TargetFieldEntity and field that back the BACnet object

The server endpoint also advertises identity to clients via DeviceId, DeviceName, and VendorId. VendorId defaults to 0. DeviceName defaults to "BACnet Device" for an IP server and "BACnet MS/TP Device" for an MS/TP server.

Object Types

The ObjectType enum covers more than 40 standard BACnet object types. The most common in day-to-day integrations are the analog, binary, and multi-state families:

FamilyObject Types
AnalogAnalogInput, AnalogOutput, AnalogValue
BinaryBinaryInput, BinaryOutput, BinaryValue
Multi-stateMultiStateInput, MultiStateOutput, MultiStateValue
SchedulingCalendar, Schedule, NotificationClass
LoggingTrendLog, TrendLogMultiple, EventLog
SystemDevice, Command, Program, Loop, File, Group, NetworkPort
Life safetyLifeSafetyPoint, LifeSafetyZone

Additional supported types include Averaging, Accumulator, PulseConverter, GlobalGroup, GroupedView (StructuredView), LoadControl, AccessDoor, NotificationForwarder, AlertEnrollment, EventEnrollment, Channel, LightingOutput, BinaryLightingOutput, ElevatorGroup, Escalator, and Lift.

Property Identifiers

The PropertyId enum exposes more than 150 standard properties. Frequently mapped properties include:

PresentValue     ObjectName       Description
ObjectType       ObjectInstance   EventState
EventType        OutOfService     CovIncrement
PriorityArray    Deadband         HighLimit
LowLimit

PresentValue is the default and is what most read/write mappers target. PriorityArray exposes the 16-slot command priority array of a commandable object, and CovIncrement reflects the device-side COV threshold.

Reliability

BACnet endpoints include built-in resilience so integrations survive transient network and device faults:

  • Automatic reconnection with exponential backoff between MinRetryBackoffMs (default 1000) and MaxRetryBackoffMs (default 60000).
  • Health checking that detects an unresponsive device and flags it for recovery.
  • Failover across multiple endpoints in a controller, enabling redundant connections to the same device set.
  • Communication logging with configurable verbosity and rotation via MaxLogFiles and MaxLogSizeMb.

Redundancy

Placing several endpoints under a single controller lets ControlBird run them as a redundant group. If the active endpoint loses contact, a standby endpoint takes over automatically without losing the mapper configuration.