# BACnet device creation using system.device.addDevice()

**URL:** <https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [March 26, 2024, 1:09pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893 "2024-03-26T13:09:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [March 26, 2024, 1:09pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/1 "2024-03-26T13:09:10Z")

</div>

Hi all,

Hoping someone can assist me, I am trying to create a tool to autoamte BACnet device drivers addition (I have many to add) and was hoping to automate the process using the scripting. I am unsure if the BACnet device driver supports the system.device.addDevice() method? If it is, is there any documentation on the headers (dictionary keys) for the device parameters?

Any help is appreciated.

Many Thanks,

MG.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 26, 2024, 1:32pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/2 "2024-03-26T13:32:06Z")

</div>

That driver isn't listed under either [system.device.addDevice()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-device/system-device-addDevice) nor the [DeviceProps Listing](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-device/system-device-addDevice/system-device-addDevice-deviceProps-Listing) supplement.

I would think that's a documentation oversight.

---

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [March 26, 2024, 1:38pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/3 "2024-03-26T13:38:50Z")

</div>

Yeah, I did try having a look. I am hoping it is possible as it would be a huge help. Unsure if there is any other documentation I can look at.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 26, 2024, 1:44pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/4 "2024-03-26T13:44:04Z")

</div>

Unfortunately... this drivers awkward configuration dependency on a "Local Device" means it's not really supported in the scripting functions right now.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 26, 2024, 1:47pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/5 "2024-03-26T13:47:13Z")

</div>

Ok, that's not quite right. It's not documented because it's a bit difficult due to the local device. You basically need to know a priori the ID of that local device setting from the internal DB, presumably by querying or viewing the internal DB.

But if you do know it, you can add the devices like normal:

```auto
dType = "com.inductiveautomation.BacnetIpDeviceType"
dName = "remoteDevice"
dProps = {
  "LocalBacnetDeviceSettingsId" : 5, # <----------- Pay attention to this line
  "RemoteAddress": "asdf"
}
system.device.addDevice(deviceType = dType, deviceName = dName, deviceProps = dProps)

```

You can figure out the key names by looking at the `BacnetIpRemoteDeviceSettings` table.

---

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [March 26, 2024, 2:44pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/6 "2024-03-26T14:44:26Z")

</div>

Hi Kevin,

This worked perfectly thanks! For anyone reading this in the future the script I have tested in the script console is below.

```auto
testParameters = {
"LOCALBACNETDEVICESETTINGSID":"1",
"REMOTEADDRESS":"10.10.10.10",
"REMOTEPORT":"47808",
"REMOTEDEVICENUMBER":"100", 
"WRITEPRIORITY":"8",
"COVENABLED":"1",
"COVHEARTBEATINTERVAL":"5",
"COVSUBSCRIPTIONLIFETIME":"900",
"COVSUBSCRIPTIONTRETRYINTERVAL":"120",
"CONFIRMEDNOTIFICATIONSENABLED":"0",
"DISCOVERYTIMEOUT":"5"
}

system.device.addDevice(deviceName="BacNETIP_Test1", deviceType="com.inductiveautomation.BacnetIpDeviceType", deviceProps=testParameters)

```

As mentioned by Kevin view the internal DB to get your "LOCALBACNETDEVICESETTINGSID" from another device. For those who haven't before navigate to **(http(s)://gateway:8088/web/status/sys.internaldb?6)** and use

`SELECT * FROM BacnetIpRemoteDeviceSettings`

as your query. Any pre-existing devices will show, use the integer under "LOCALBACNETDEVICESETTINGSID".

- REMOTEADDRESS is the hostname
- REMOTEDEVICENUMBER is the BACnet ID

Hopefully this helps other, took my absolutely ages to get this right 😬.

Thanks everyone for your help it's really appreciated!

---

<div class="post-metadata">

**Author:** ![olivia.lenaghan](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@olivia.lenaghan](https://forum.inductiveautomation.com/u/olivia.lenaghan)\
**Post date:** [October 19, 2026, 4:28pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/7 "2026-10-19T16:28:00Z")

</div>

> [@MG3](#):
>
> `LOCALBACNETDEVICESETTINGSID`

Hi, resurrecting this. In 8.3, the internal DB is no longer available. Is there a different workaround to getting the local device ID now?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 19, 2026, 4:29pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/8 "2026-10-19T16:29:59Z")

</div>

It doesn't exist. The device name is the lookup key. While there is a UUID, it is there only for mitigating issues with renames.

Just use the device name.

---

<div class="post-metadata">

**Author:** ![olivia.lenaghan](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@olivia.lenaghan](https://forum.inductiveautomation.com/u/olivia.lenaghan)\
**Post date:** [October 19, 2026, 4:58pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/9 "2026-10-19T16:58:12Z")

</div>

So the replacement for LOCALBACNETDEVICESETTINGSID would be LOCALDEVICE?

---

<div class="post-metadata">

**Author:** ![olivia.lenaghan](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@olivia.lenaghan](https://forum.inductiveautomation.com/u/olivia.lenaghan)\
**Post date:** [October 19, 2026, 5:01pm UTC](https://forum.inductiveautomation.com/t/bacnet-device-creation-using-system-device-adddevice/87893/10 "2026-10-19T17:01:51Z")

</div>

I got it under connectivity, so disregard. Thanks!
