You can enroll multiple BACnet devices to VMware Pulse IoT Center using BACnet device discovery.

Prerequisites

Ensure that you have:
  • Created a Liota gateway template on VMware Pulse IoT Center.
  • Enrolled a gateway using the Liota gateway template.
  • Created a Thing template to enroll the BACnet Thing devices.
  • Added a firewall rule to open the BACnet UDP Port.

Procedure

  1. Copy the Liota packages from the installer location to the packages folder in your gateway. Run the following command:
    root@photon-machine [ /opt/vmware/liota/data/packages ]# cp ~/mirrors_github_liota/example/pulsev2/* .
    The Liota packages are copied to the packages folder in your gateway.
  2. Edit the BACnet discovery package:
    root@photon-machine [ /opt/vmware/liota/data/packages ]# vi bacnet_discovery.py
  3. The bacnet.discovery.py package contains definitions for collecting metrics and for running commands.
    1. Configure the following parameters:
      Parameter Description
      comms Enter the Ethernet name and port number. For example,
      comms = BacnetDeviceComms({"iface":"eth3", "port":"47808"})

      The broadcast exchange service scans all the IP addresses in the specified Ethernet and port for BACnet devices.

      d Enter the device template name that you have created on VMware Pulse IoT Center. For example,
      d = PulseConnectedDevice(device_name, "TemperatureSensorTemplate",
                                               self.iotcc_edge_system.reg_entity_id,
                                               device_context)
      metricName The name of the metric that is collected in VMware Pulse IoT Center. Ensure that you provide the same metric name and value type when creating a Thing template. For example,
      metricName = "Temperature"
      args To configure your thermostat device to send metrics to VMware Pulse IoT Center, update the object type to analogInput. The following object types are available:
      • analogInput
      • analogOutput
      • analogValue
      • binaryInput
      • binaryOutput
      • binaryValue
      • multiStateInput
      • multiStateOutput
      • multiStateValue
      For example,
      args = [self.reg_device.reg_entity_id,
                              "Temperature_sensor", {"object":"analogInput", "instance":"0"}]
      d_metric Define the type of metric that is sent to VMware Pulse IoT Center. For example:
      d_metric = Metric(
                          name=metricName,
                          mtype='double',
                          unit=None,
                          interval=10,
                          sampling_function=collect_metrics,
                          sampling_args=args
                      )
      client_id The ID for sending the commands. For example,
      client_id = "com.liota.bacnet"
      interval The time interval in seconds to check for the commands. For example,
      interval=10
  4. After configuring the package, register it by running the following command:
    root@photon-machine [ /opt/vmware/liota/data/packages ]# python3 reg.py bacnet_discovery

Results

All BACnet devices that are available on the specified Ethernet and port are enrolled to VMware Pulse IoT Center and are listed in the Inventory > Devices page. The Metrics tab of each device publishes the metrics every 10 seconds.