BACnet project: discover and read points with YABE and bacpypes3, then bring them into Home Assistant

Discuss the Implementation and Development of BACnet Devices
Post Reply
User avatar
ZerOne
Site Admin
Posts: 216
Joined: Sun Dec 13, 2020 8:21 am

A read-first walkthrough for exploring a BACnet/IP network and getting selected points into Home Assistant, with the write-priority rules that stop you leaving a plant stuck in manual. Based on the documentation of each tool as at October 2026. I have not installed the Home Assistant integration for this post and the bacpypes3 flags may differ by version, so use --help and each project's README. If you have not read the getting started primer in this forum, start there.

Rules of engagement: only on a network you have permission to use. Start read-only. Use an unused device instance for your tool. Keep BACnet on its own VLAN.

Step 1: explore with YABE (Windows)
  • Install YABE from SourceForge. Add a BACnet/IP device (UDP, port 47808) bound to the network interface that can see the controllers.
  • Send Who-Is. Devices answer with I-Am and appear in the tree.
  • Expand a device to see its objects. Click an object to read properties like Present_Value, Object_Name, Description and Units.
  • Cross-subnet? Use the BBMD and foreign device options.
  • Write down the device instance, IP and the object IDs of the points you care about.
Step 2: script it with bacpypes3

Code: Select all

pip install bacpypes3
python -m bacpypes3 --help
The module starts an interactive console. Typical options in the project include a name, an instance number and your own address. Pick an instance that does not exist on the site. Example (the flags may differ between versions, so check the help output first):

Code: Select all

python -m bacpypes3 --name ReadProbe --instance 599001 --address 192.168.10.50/24
At the prompt, commands described in the project include whois, iam, read (address, object identifier, property), write (with an optional priority) and rpm (read property multiple). A read looks like this:

Code: Select all

> whois
> read 192.168.10.20 analog-input,1 present-value
To reach another subnet, the console has options for registering as a foreign device with a BBMD. I have not run these myself, so check the project docs before relying on them. Do not use the write command on a live system.

Step 3: bring points into Home Assistant

There is a community custom integration, Home-Assistant-BACnet-integration (GPL-3, installed via HACS as a custom repository, GUI-only setup). From its README:
  • A three-step wizard: network, then discover devices, then select objects. Discovery uses Who-Is and I-Am, and it supports BBMD and foreign device registration.
  • It uses COV subscriptions for instant updates, with polling as a fallback (the default polling interval is 30 seconds, minimum 10).
  • It supports read and write, with Priority Array handling. It also has a "Safety on a live site" section worth reading in full.
The safety points from its README, which I would apply to any tool:
  • Discovery, polling and COV subscriptions should not change values. Writes happen only when you or an automation do it.
  • One exception: if you set its COV increment option above 0, it writes that value to each imported analog object. Leave it at the default 0 if you do not want to touch device settings.
  • Entities write at priority 16 by default (the lowest), so higher-priority commands such as a manual operator at 8 still win.
  • Switching an entity off writes a value; it does not release the output. Use the relinquish service to hand control back.
  • Its services accept any priority from 1 to 16. Priorities 1 to 7 outrank a manual operator, so use those only on purpose.
My suggestion: import read-only sensors first (temperatures, humidity, CO2, power), watch behaviour for a week, and only then think about any writable point with the site owner's agreement.

The reverse direction

ha-bacnet-hub is a community project that publishes Home Assistant entities as BACnet objects, built on bacpypes3. That is useful if a BMS needs to read values from your home setup. Treat it as another device on the network: choose a unique instance, and do not expose it outside the BMS VLAN.

Troubleshooting
  • No devices found: wrong interface or subnet, firewall blocking UDP 47808, or you need a BBMD.
  • Replies not arriving even though Who-Is goes out: check that no other BACnet software on the same machine is already holding UDP 47808, and check firewall rules in both directions.
  • Slow or timing-out reads: slow down polling, use COV, or read multiple properties in one request.
Links
Question for the group: has anyone run the BACnet Home Assistant integration against a real controller (which make and model), and how did COV behave compared with polling?
Post Reply

Return to “BACnet Protocol Discussion”