Preface


Niagara Framework® is a comprehensive software infrastructure that addresses the challenges of creating device-to-enterprise applications. It serves as a central console for connecting real-time operational data to the people and systems that manage workflows in smart buildings, data centers, industrial processes, smart cities and other aspects of business enterprises.


Niagara provides the critical, cyber-secure device connectivity and data normalization capabilities needed to acquire and unlock operational data from device-level and equipment-level silos. The control engine at the core of Niagara enables users to not just monitor data flows, but to create logic sequences that effect controls programming based on data observation. Systems integrators use the data management and user presentation applications built into Niagara to manage histories, schedules and alarms.



Milesight offers multi-potential sensing products to capture the most meaningful data and makes it accessible across diverse applications. Milesight product are widely used in facility management, energy management, people comfort and occupancy&people counting in smart buildings.


Previously, we have finish the Basic Integration to Niagara system through different ways:

  1. BACnet Integration
  2. Mqtt Integration
  3. Modbus Integration


In this guide, Milesight develop the driver to integrate Milesight LoRaWAN gateways and sensors to Niagara Framework BMS in an efficient way. it's This is also a sign of our in-depth cooperation with Tridium.


Full Milesight&Niagara  video Tutorial https://www.youtube.com/playlist?list=PLb33srEEYIJbclpv3ycEv20TKEiAQmB3P


TABLE OF CONTENTS


1. Prerequisites

Tridium:

  • Niagara supervisor or Niagara JACE8000/9000 controller.
  • version is from N4.10 and above.

Milesight:

  • Milesight LoRaWAN Gateway UG65/UG67, firmware version: 60.0.0.46-r2 or above.
  • If You gateway is Milesight UG56,firmware version: 56.0.0.46-r2 or above.
  • Milesight LoRaWAN sensors, in this example, AM319 will be used.
  • Milesight BACnet driver package: v1.0.0.9


Milesight BACnet driver is license free, it's a value-added tool of Milesight LoRaWAN gateways and sensors to integrate to Niagara Framework BMS. Since it's BACnet based, the datapoints saved in local database will count against the global capacity point count in the Niagara's license.



2. Milesight Driver installation

Video Guide: 


Download the driver from Milesight website->resources->"Software&Firmware"page, unzip it, then copy "milesightBacnet-rt.jar" and "milesightBacnet-wb.jar" to Niagara workbentch's "modules" folder:



Open Niagara workbentch program to load the driver, then check the module's information:

now the driver is installed successfully.



3. Manage Milesight gateway in Niagara workbentch

In this part, we will guide you how to create the station, load the driver network, add milesight gateway in different ways, and how to manage it.


Video Guide:


3.1. Create new station(ignore if not needed)

Navigate to Tools -> New Station, to open the Wizard to create it step by step:

Input the station's name, click next:

set the Password for the station to login later.

then tick the option "copy it to secure platform for "localhost" with Station Copier", then click Finish.

Then the login windows will pop up directly, click OK to login:

click Next to start the Station Copier

The new station will start to load automatically.

Right Click and choose Open Station to login.

check the information here, then click OK to login.


3.2. load Milesight BACnet driver and create Milesight Network

Search Milesight driver in "Palatte", input Milesight in the Filter field.

Choose MilesightBacnet and click OK

You will find Milesight Driver in the Palette, drag the driver to the right place, and rename it if needed.

The driver is loaded completely.


Note: Since Milesight BACnet driver is based on BACnet progocol, and the Niagara Workbentch just allow one BACnet protocols running here, which leads to a conflict with the existing BACnet network.


If you prefer to add Milesight Gateway and sensors to the existing BACnet network, please refer to 3.3

If you prefer to use Milesight driver directly, prefer to 3.4


Before you start to add Milesight Gateway, please make sure the firmware version is correct.


And make sure the gateway is power on with network access.


3.3. Add Milesight Gateway to existing BACnet Network


Video Guide: 


In this way, we don't need to load Milesight Network, just open the original BACnet Network as usual.


3.3.1. Add Milesight Gateway by BACnet Discovery

If Milesight Gateway and the Niagara controller or Supervisor are in the same LAN, we can click Discover to add it.

click Discover, and hit OK to start.


The Driver will search the BACnet devices and list them here after several seconds.

Drag the right gateway device to local Database, a pop window will appear to input the gateway's name's basic information

  • Name: Input the name of the gateway as your wish.
  • Type: Modify the default value "Milesight Gateway Device", it's a Key step.
  • Device ID: The BACnet device ID, just keep the value.


The other BACnet settings can be kept as well. click OK to save it.

Double click the gateway we just created, find the API settings below.

  • URL: The gateway's http access, in this example, http://192.168.45.191
  • Username: the Username to login web interface, it's the same as account admin, if you prefer a saperate account to manage the API connection, you can create the account in Gateway's web -> System -> User Management -> HTTP API Account page.
  • Password: The password of Account admin.

hit Ok to save it, and wait for while.

You can also hit the options in Action -> Upload to start the synchronization.


3.3.2. Add Milesight Gateway Manually.

if Milesight gateway cannot be Discovered, we can add it manually by the IP address.

Click New in BACnetwork.

Choose Milesight Gateway Device, then click OK.


Input the Basic information of the gateway.

  • Name: Input the name of the gateway as your wish.
  • Type: Keep the default value "Milesight Gateway Device"
  • Device ID: The BACnet device ID, the default value is 3000
  • MAC Addr: IP:0xBAC0, For example: 192.168.46.210:0xBAC0

the other BACnet settings can be kept as default.

Click Ok to save it.

Double click the gateway we just created, find the API settings below.

  • URL: The gateway's http access, in this example http://192.168.46.210
  • Username: the Username to login web interface, it's the same as account admin, if you prefer a saperate account to manage the API connection, you can create the account in Gateway's web -> System -> User Management -> HTTP API Account page.
  • Password: The password of Account admin.

Click Save to save it, and wait for a while.

You can also hit the options in Action -> Upload to start the synchronization in the gateway, gateway parameters, Payload codec side.


3.4. Add Milesight Gateway to Milesight Network

To add Milesight gateway, we need to enable the BACnet stack first.

Firstly, the "Object Id" needs to be modified,

in this example, we assign the value to "200", press "Enter" key to save it.

Then we need to enable the Pool Services in Network->Ip Port


Set the value to true, the status will be OK.

Then we can find the Option Discover in Milesight Network is able to use.


3.4.1. Add Milesight Gateway by BACnet Discovery

If Milesight Gateway and the Niagara controller or Supervisor are in the same LAN, we can click Discover to add it.

The Driver will search the BACnet devices and list them here after several seconds.

Drag the right gateway device to local Database, a pop window will appear to input the gateway's name and API information.

  • Name: Input the name of the gateway as your wish.
  • Type: Keep the default value "Milesight Gateway Device"
  • Device ID: The BACnet device ID, just keep the value.

the other BACnet settings can be kept as well.

  • URL: The gateway's http access, in this example
  • Username: the Username to login web interface, it's the same as account admin, if you prefer a saperate account to manage the API connection, you can create the account in Gateway's web -> System -> User Management -> HTTP API Account page.
  • Password: The password of Account admin.


Click OK to save it. The gateway's status will be OK shortly.

The driver will login gateway's API and finish the sync of decoder and gateway settings information automatically.


3.4.2. Add Milesight Gateway Manually.

if Milesight gateway cannot be Discovered, we can add it manually by the IP address.

Click New in MilesightNetwork.

Choose Milesight Gateway Device, then click OK.

Input the Basic information of the gateway.

  • Name: Input the name of the gateway as your wish.
  • Type: Keep the default value "Milesight Gateway Device"
  • Device ID: The BACnet device ID, the default value is 3000

the other BACnet settings can be kept as default.

  • URL: The gateway's http access, in this example
  • Username: the Username to login web interface, it's the same as account admin, if you prefer a saperate account to manage the API connection, you can create the account in Gateway's web -> System -> User Management -> HTTP API Account page.
  • Password: The password of Account admin.

PS: The Field MAC Addr will be generated automatically from the URL

You can also input the value manually, the format is: IP:0xBAC0

For example: 192.168.70.212:0xBAC0

Click OK to save it.

The gateway will be connected successfully.


3.5. Manage Milesight Gateway settings

Milesight BACnet Driver supports to manage the general Gateway settings, including the BACnet settings, LoRaWAN Region, IP address.

Note:

  • The Bacnet Device Id needs to be modified to invidial value of each Milesight Gateway. if not the Bacnet network will be conflicted.
  • If you modify the gateway's IP, you will need to update the values at API page as well. The driver will re-connect the API after you update it.
  • If you modify the Region, please wait for a while, the gateway needs 10 seconds or so to take effect.


4. Manage Milesight end devices in Niagara Workbentch

Video Guide

4.1. Create Milesight end devices manually

Navigate to Sub Devices, we can create the LoRaWAN sensors and Controllers here.

A pop-up window will appear for you to input the basic information

  • Name: Input the name as your wish, in this exmaple: am319 is used
  • DevEUI: The device EUI of the sensor, You can find it in the back label of the device
  • Payload Codec: The payload codec for this device, it will match the DevEUI automatically. You can choose the best option.
  • Description: input any description as your wish.
  • Application Key: Input the application key, the default one is: 5572404c696e6b4c6f52613230313823
  • Timeout: The time out value to define the online/offline status of the sensor when no uplink data after this period.

Ps: If Application key is empty, it means to load the default one.

Hit Ok to save it, it will be downloaded to the gateway through API automatically.


4.2. Bulk import Milesight end devices

Milesight driver supports to add the sensors in bulk mode to speed up the deployment. We need to download the template firstly.

The format is CSV, download and edit using notepad or Microsoft Excel etc.

This is an example of the edited file.

Click Bulk Import to load the edited file.

The new sensors are created successfully.

The sensors will be downloaded to the gateway automatically. You can also hit download manually if you want.


4.3. Add data points of Milesight end devices

Milesight LoRaWAN sensors and controllers support multipie data points, they are mapped to BACnet object automatically inside the gateway already.

in this step, we will discover them and load it.


Click Discover in the Sub Devices AM319 we created just now.

The Data points will be listed immediately with the full details.

Pickup the needed data object, drag it to local database.

Hit Ok to save it.

Note: The new data points added will count against the global capacity point count in the license


Power on the sensor, and wait for several miutes. then the new data will be updated correctly.

Then you can build your own application or dashboard using the object values here.

4.4. Manage and Control the LoRaWAN devices

Milesight LoRaWAN devices support the downlink command to configure it and control it. But it's not an easy thing to prepare the downlink commands. Milesight gateway's embedded network server supports to map the points to the BACnet stack. So the users can manage and control the LoRaWAN devices in BACnet way.


in this example, Milesight Thermal States WT101 will be used as an example.

Then property Write will shows readonly or Ok or Writable.

The items marked as OK and Writable supports to configure or control.


Here are some examples:

  • Example 1- Calibrate the Valve

Right click and choose Set in Actions menu.


Set the value to Yes

The valve will be calibrated when it reports next time.


  • Example 2 - Set the report interval from 2 minutes to 10 minutes

Right click and choose Set in Actions menu.

Set the value to 10 minutes.

The valve will be configured to report every 10 minutes next time.

  • Example 3 - Restart the Valve

Right click and choose Set in Actions menu.

Set the value to Yes

The valve will restart when it reports next time.


5. Manage the sensor's data alarm

In Niagara framework, the alarm feature is available by default. we can configure the alarm featured based on the BACnet protocol.


Video Guide: 

5.1. Prepare the console recipient.

Firstly, prepare the console recipient in Config -> Services -> AlarmService.

Search Alarm in Palette

Click Ok and drag it to the Wire Sheet.

connect the Default Alarm Class and the ConsoleRecipient together.


5.2. Create the notification class.

Create the Notification class in Alarms -> New


You will need to input the name and the priority of each class.

click Ok to save it, it will be downloaded to Milesight Gateway automatically.


5.3. Create the BACnet Notification Object.

in this part, we can pickup the right BACnet object, and create the notification object based on that.


Switch to the view Milesight Remote Point Manager in Sub-Device -> am319(sensor name here)


in this example, we choose the object am319.temperature as an example;


Double click this object, and configure the options below:

Cov Enabled: CoV means change of value, if the temperature value changes in next uplink, it will trigger to update. we recommend to set it to true

  • Event Enabled: set it to true
  • Notification Class: choose the Notification class we just created.
  • Event: choose to trigger in which situation, in this example, both toOffnormal and toNormal are enabled.
  • Limit Event: enable Low limit and High limit.
  • Ligh limit: set the high limit value. in this example high value is 25 °c
  • Low limit: set the low limit value. in this example low value is 20 °c


Click Ok to save it. All the configurations will be downloaded to the gateway.


5.4. Check the alarm

in this part, we can pickup the right BACnet object, and create the notification object based on that.


when the data triggered the high limit or low limit, the alarm will be triggered

check the Alarm for more details and ACK it.

in this example, the temperature comes to 25.7°c, which goes to high limit.


6. FAQ

Q1: Is there any license fee for Milesight BACnet driver?

A1: Milesight BACnet driver is license free, since it's a value-added tool of Milesight LoRaWAN gateways and sensors to integrate to Niagara Framework BMS. But since it's BACnet based, the datapoints saved in local database will count against the global capacity point count in the Niagara's license.



Q2: Will this driver launch Niagara Marketplace?

A2: Currently, Milesight BACnet is still under promotion, we will consider to launch it later.



Q3: Do you have the develop team to maintant the driver?

A3: Yes, Milesight R&D team has passed the Tridium's develop program, we can support it well.



Q4: Does Milesight BACnet driver supports 3rd party sensor?

A4: Our goal is to integrate Milesight's products in a better way, for 3rd sensors, it's possible technically. You will need to prepare the decoder archive. More details please contact Milesight support team.


Q5: If Milesight launch a new LoRaWAN sensor do I need to upgrade the driver?

A5: No need, you will just need to click Upgrade Online in Payload codec, it will trigger the gateway to update the decoder and upload it to the driver automatically.


-END-