Uni Directional BACnet IP to MQTT Publisher for Single Device (JSON Payload)

Last Code Revision Date: 03-Sep-2025

BACnet to MQTT Single Device

This project bridges BACnet devices to MQTT, allowing BACnet data to be published to an MQTT broker for integration with other systems.

Features

  • Connects to a BACnet device over IP
  • Reads multiple BACnet properties (customizable via config)
  • Publishes BACnet data to a specified MQTT topic
  • Configurable BACnet tags and MQTT broker details in config.json
  • Handles BACnet and MQTT connection errors gracefully
  • Simple, single-device focus for easy integration

Configuration

Edit the config.json file to set:

  • BACnet device IP and tags to read
  • MQTT broker hostname, port, topic, and retry interval
  • Polling interval for BACnet reads

Example config.json:

{
   "bacnet": {
      "deviceIp": "192.168.1.19",
      "tags": [
         { "objectType": 0, "objectInstance": 0, "name": "Indoor Temperature" },
         { "objectType": 0, "objectInstance": 1, "name": "Glycol Water Temperature" }
      ]
   },
   "mqtt": {
      "hostname": "127.0.0.1",
      "port": 1883,
      "topic": "bacnet_data",
      "retryInterval": 5000
   },
   "interval": 1000
}

Usage

  1. Install dependencies:
     npm install
    
  2. Start the application:
     node index.js
    
  3. The app will read BACnet values at the configured interval and publish to MQTT.

Project Structure

  • index.js – Main application logic
  • config.json – Configuration for BACnet and MQTT
  • package.json – Project metadata and dependencies

Troubleshooting

  • Ensure BACnet device is reachable from your network
  • Check MQTT broker is running and accessible
  • Review console logs for connection or data errors

79.41$

SKU 92 Categories ,

Your Automation Partner. Streamline workflows, and drive productivity. Explore our innovative solutions.