A repository of BACnet configuration profiles for LoRaWAN devices used with RAKwireless gateways. This repository contains mapping configuration files that convert LoRaWAN sensor/actuator data from multiple vendors to BACnet objects.
This repository provides conversion configuration files from LoRaWAN devices to BACnet protocol. These profile files enable RAK gateways to map LoRaWAN device data to standard BACnet objects (such as Analog Input, Binary Input, Analog Output, etc.), achieving seamless integration with Building Management Systems (BMS).
- π Automatic LoRaWAN data encoding and decoding
- π Mapping LoRaWAN data to standard BACnet objects
- π’ Support for various building sensors and actuators
- βοΈ Configurable object properties (update interval, COV increment, etc.)
- π Support for bidirectional communication (read sensor data and control actuators)
RAK-BACnet-Profiles/
βββ profiles/ # Real device profiles
β βββ Carrier/ # Carrier devices
β βββ Dragino/ # Dragino devices
β βββ Milesight/ # Milesight devices
β βββ Senso8/ # Senso8 devices
β βββ *.yaml # Profile files
β βββ tests/ # Test data (optional)
βββ examples/ # Example profiles
β βββ minimal-profile/ # Minimal example
β βββ standard-profile/ # Complete example
βββ scripts/ # Validation scripts
β βββ validate-profile.js # Profile validator
β βββ test-codec.js # Codec tester
β βββ utils/ # Utilities
βββ docs/ # Documentation
βββ .github/ # GitHub templates
βββ registry.json # Profile registry π
βββ registry-schema.json # Registry schema
βββ README.md
The project includes an auto-generated registry.json file that provides an index and statistics for all available Profiles.
{
"version": "1.0.0",
"lastUpdate": "2026-01-16",
"totalProfiles": 19,
"profiles": [
{
"id": "senso8-lrs20310",
"vendor": "Senso8",
"model": "LRS20310",
"version": "1.0.0",
"path": "profiles/Senso8/Senso8-LRS20310.yaml",
"verified": true,
"hasTests": true,
"description": "Senso8 LRS20310 Water Leak Detection Sensor",
"deviceType": "Water Leak Sensor",
"lorawanClass": ["A"],
"lastUpdate": "2026-01-16"
}
],
"statistics": {
"byVendor": { "Senso8": 9, "Dragino": 4, "Carrier": 2, ... },
"withTests": 10,
"withoutTests": 9
}
}After adding or modifying Profiles, run the following command to update the registry:
cd scripts
node update-registry.jsEach YAML configuration file contains the following main sections:
Defines JavaScript functions for encoding and decoding LoRaWAN data:
codec: |
function Decode(fPort, data, variables) {
// Decode LoRaWAN uplink data
var values = [];
// ... parse data and populate values array
return values;
}
function Encode(data, variables) {
// Encode LoRaWAN downlink data
var bytes = [];
// ... encode data
return bytes;
}Defines BACnet object types, properties, and mapping relationships:
datatype:
"1": # Channel ID
name: Temperature # Object name
type: AnalogInputObject # BACnet object type
units: degreesCelsius # Units
covIncrement: 0.1 # COV increment
updateInterval: 600 # Update interval (seconds)
channel: 1 # LoRaWAN channel numberSupported BACnet Object Types:
AnalogInputObject- Analog input (sensor readings)AnalogOutputObject- Analog output (controllable analog values)AnalogValueObject- Analog value (general analog values)BinaryInputObject- Binary input (switch states, alarms)BinaryOutputObject- Binary output (controllable switches)BinaryValueObject- Binary value (general binary values)OctetStringValueObject- Octet string value (strings, special data)
Defines LoRaWAN related parameters:
lorawan:
adrAlgorithm: LoRa Only # ADR algorithm
classCDownlinkTimeout: 5 # Class C downlink timeout
macVersion: LORAWAN_1_0_3 # LoRaWAN MAC version
regionalParametersRevision: A # Regional parameters revision
supportClassB: false # Class B support
supportClassC: false # Class C support
supportOTAA: true # OTAA supportDevice basic information:
model: Senso8-LRS20310 # Device model
profileVersion: 1.0.0 # Profile version
name: LRS20310 # Device name
vendor: RAKwireless # Vendor name
id: uuid-string # Unique identifier (optional)Import the corresponding device YAML configuration file into the RAK gateway's BACnet service.
Ensure the LoRaWAN device has successfully joined the RAK gateway (supports OTAA or ABP mode).
The gateway will automatically create corresponding BACnet objects according to the configuration file and map LoRaWAN data to these objects.
In the Building Management System (BMS), access these objects through standard BACnet protocol to achieve device monitoring and control.
Device uplink data (LoRaWAN)
β
Decode function parses
β
Map to BACnet object (AnalogInputObject)
β
BMS system reads (via BACnet protocol)
BMS system writes command (via BACnet protocol)
β
BACnet object receives (AnalogOutputObject)
β
Encode function encodes
β
Downlink data sent (LoRaWAN)
Contributions of new device configuration files are welcome!
-
Fork this repository
-
Create device configuration file
- Create a new YAML file in the corresponding vendor directory under
profiles/ - If it's a new vendor, create a new vendor directory under
profiles/ - File naming format:
Vendor-Model.yaml - Example:
profiles/YourVendor/YourVendor-Model.yaml
- Create a new YAML file in the corresponding vendor directory under
-
Write configuration file
- Implement Decode and Encode functions
- Define BACnet object mappings
- Configure LoRaWAN parameters
- Add complete metadata information
-
Testing and Validation
Create test data for your Profile:
# Create test directory mkdir -p profiles/YourVendor/tests # Add test input data # Create profiles/YourVendor/tests/test-data.json # Create profiles/YourVendor/tests/expected-output.json
Run validation:
# Install dependencies (first time only) cd scripts && npm install && cd .. # Run full validation (including output verification) node scripts/validate-profile.js profiles/YourVendor/YourVendor-Model.yaml
Ensure all tests pass:
- β YAML syntax valid
- β Profile structure correct
- β Codec functions executable
- β BACnet object types supported
- β Test data decodes successfully
- β
Output matches expected results
[θΎεΊεΉι ]
See docs/TESTING-GUIDE.md for detailed testing instructions.
-
Submit Pull Request
- Provide detailed device description
- Include test data and expected outputs
- Ensure validation passes
- Update device list in this README
- Use standard YAML format
- Clear code comments (JavaScript functions)
- Object naming follows BACnet specifications
- Units use standard BACnet unit enumerations
- Provide complete metadata information
The configuration files in this project are for use with the RAKwireless ecosystem.
For questions or suggestions, please contact us through:
- Submit a GitHub Issue
- Visit RAKwireless Official Website
- Visit RAKwireless Forum
Note: Before using these configuration files, please ensure your RAK gateway firmware version supports BACnet functionality. Refer to the product documentation for specific support details.