BACnet Support

@GravySeal: Trying to use BEPACOM for a BACnet integration but I can’t seem to get your add-on working. It looks like I’m getting an error when initializing NGINX and then a warning when trying to bring up services. Any help would be greatly appreciated. Here is my log file:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: Bepacom EcoPanel BACnet/IP Interface
 Bepacom BACnet/IP interface for the Bepacom EcoPanel. Allows BACnet devices to be available to Home Assistant through an API
-----------------------------------------------------------
 Add-on version: 1.1.3
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.5  (armv7 / raspberrypi3)
 Home Assistant Core: 2023.10.3
 Home Assistant Supervisor: 2023.10.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-interface: starting
[18:03:11] INFO: Initialising NGINX
[18:03:11] INFO: Generating BACpypes.ini
s6-rc: warning: unable to start service init-nginx: command exited 1
[BACpypes]
objectName: EcoPanel
address: 192.168.29.211/24
objectIdentifier: 420
maxApduLengthAccepted: 1476
segmentation: segmentedBoth
vendorIdentifier: 15
foreignBBMD: -
foreignTTL: 255
maxSegmentsAccepted: 64
loglevel: DEBUG
defaultPriority: 15
updateInterval: 60
s6-rc: info: service init-interface successfully started
s6-rc: info: service interface: starting
s6-rc: info: service interface successfully started
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service interface: stopping
[18:03:16] INFO: Service BACnet Interface exited with code 256 (by signal 15)
s6-rc: info: service interface successfully stopped
s6-rc: info: service init-interface: stopping
s6-rc: info: service init-interface successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I have NGINX Home Assistant SSL proxy installed as an add-on and by default port 80 is disabled. I have tried enabling port 80 in my NGINX add-on but this doesn’t impact my BEPACON error and warning.

Hey chad01,

I am reading the logs and it looks like the init-nginx script fails on startup.
This isn’t related to ports, but maybe it relates to ethernet adapters. Could you give me your adapter name?
Could you try the development version and post logs again?

Looks good. Did you consider running HA on Docker Containers where you might have a better chance of configuring Docker connectivity to host mode?

Hi GravySeal,

I tried to install the dev version of Bepacom but it fails to install, even after a restart of HA. I can reinstall the release version without issue. Here is the dev install fail message:

Failed to install add-on
The command '/bin/bash -o pipefail -c apk add --no-cache nginx python3 py3-pip py3-setuptools py3-wheel && pip3 install --no-cache-dir --upgrade pip 'bacpypes3<=0.0.79' 'fastapi<=0.103.1' 'jinja2<=3.1.2' 'uvicorn<=0.23.2' 'websockets<=11.0.3' 'python-multipart<=0.0.6'' returned a non-zero code: 1

… BTW, my adapter name is Wi-Fi

Hey Gravy,
I am having some trouble isntalling this. I have BACnet devices and wanted to see if they would talk through this programming. I installed the .zip file and unzipped it through SSH but I cannot seem to find the addon. Kind of a newbie with all this programming stuff. Let me know if you have any ideas. Thanks!

Hey @btingles,

Are you using Home Assistant OS or supervised?
For the installation, you should go to Settings>Add-Ons>Add-On Store.
In the top right select the settings icon and open the Repositories setting. There you can paste the link to the repository:

When you refresh the page, the repository should appear as “Bepacom Add-on Repository” below Official Add-Ons. There you can select to install the regular version like any other add-on.

If everything works correctly with the add-on, you can install the complementary integration. This is only after you’ve verified you can see all the BACnet devices you need in the web UI of the add-on. Feel free to DM me for more help!

Installed the add-on.
I see the BAKnet data I need.
I don’t understand what to do next so that this data appears in Home Assistant. Tell?

1 Like

I think I reproduced this with home assistant supervised in both dev and normal version.

s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-interface: starting
[23:54:03] INFO: Initialising NGINX
[23:54:03] INFO: Generating BACpypes.ini
[23:54:03] INFO: Initialising NGINX - array read...
s6-rc: warning: unable to start service init-nginx: command exited 1
[BACpypes]
objectName: EcoPanel
address: 0.0.0.0/0
objectIdentifier: 420
maxApduLengthAccepted: 1476
segmentation: segmentedBoth
vendorIdentifier: 15
foreignBBMD: -
foreignTTL: 255
maxSegmentsAccepted: 64
loglevel: DEBUG
defaultPriority: 15
updateInterval: 60
s6-rc: info: service init-interface successfully started
s6-rc: info: service interface: starting
s6-rc: info: service interface successfully started
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service interface: stopping
[23:54:03] INFO: Service BACnet Interface exited with code 256 (by signal 15)
s6-rc: info: service interface successfully stopped
s6-rc: info: service init-interface: stopping
s6-rc: info: service init-interface successfully stopped
s6-rc: info: service legacy-cont-init: stopping

Oddly nginx seems to start when I try to manually start the container…

root@ha01:/home/jayme# docker run -it ghcr.io/bepacom-raalte/amd64-bacnet-interface:1.1.3
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
curl: (6) Could not resolve host: supervisor
[05:21:22] ERROR: Something went wrong contacting the API
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
curl: (6) Could not resolve host: supervisor
[05:21:22] ERROR: Something went wrong contacting the API
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-interface: starting
[05:21:22] INFO: Generating BACpypes.ini
[05:21:22] INFO: Initialising NGINX
s6-rc: info: service init-nginx successfully started
[BACpypes]
objectName: null
address: null/24
objectIdentifier: null
maxApduLengthAccepted: 1476
segmentation: segmentedBoth
vendorIdentifier: 15
foreignBBMD: -
readarray -t eth_adapters < <(ifconfig -a | grep -oE '^(enp|eth|eno|wl)[a-z0-9]+')

is ifconfig the right thing to use here?

@jaymemaurice @cerveza_stalone
I can’t, for the love of me, use that Node in Node Red.
I can connect to my Trend device with Yabe and I get these:

So, about the Trend device have these data:

  • IP: 192.168.45.65
  • port: 47808
  • device ID: 1001
  • various Objects ID

The node I’m using is node-red-contrib-bacnet, In the node “Simple Read” what should I put in there fields?

What’s an instance?
Should I put the Trend IP in the Device os in the Client? I have just 1 BacNet device, what should I put in the other?
Thanks in advance!

It’s confusing eh?
Create an instance for each instantiation of an ID you want to read - in my use I have a thermostat connected to a Delta BAS… I want to read the thermostat/co2/binary state of motion sensor etc…
each of these things are an “instance” of something to read I guess.
The name doesnt seem to matter. Eg. LinkNet1BathroomTemp isnt anywhere in my Delta configuration. What is important is my thermostat variable for Temperature is 101.
Type is the type of bacnet variable - eg 0 is integeranalog-input, 5 binary-input etc. this lives in some standards doc - why this isnt configured as part of the “instance” I couldn’t tell you. Why the type isn’t an enumerated drop down… not sure… Perhaps I don’t understand this well enough??
Device is the device ID you are querying I think… in my case my BAS is 100 and all the thermostats connect over it so it has all the variables available in its GCL.
Client is the node red server’s bacnet instance you are creating here and all your simple reads will probably share the same client.

1 Like

sorry type 0 is “analog input” so here in my BAS I have Master_SPT which is 100.AI101 which is instance 101 object type 0… there is no other 100.101(type 0) but there may be other 100.101’s of other type like Binary Variable or Binary Input etc.

So /you/ from your example should be able to query device id 1001 for type 0 instance ID 1 7 8 35 36 etc.

In my screenshot I can get my humidity from device 100 instance 102 type 0. In my delta the first linknet connected thermostat connected to the bas is 100, second at 200 etc. and AI 1-7 are physical GPIO on the board itself. I have an application controller that connects via rs485 and gets it’s own ID and has it’s on analog inputs and outputs… an can also have more linknet devices connected to it…

And it seems the plugin defaults to type of 8 which from my research is type “Device”


Not very helpful but you might be able to read type 8 instance at 1001 from device 1001… probably everyone using this plugin will be querying types 0 though 5.

This document seems to cover the types:

Not sure if you are still interested in this topic… I have a same setup from one of my client who uses daikin VRV. We added a bacnet gateway from daikin. To integrate with homeassistant(since there is no bacnet support back then), we written a script in Python using FastAPI as a gateway from bacnet to RestApi.

1 Like

I’m getting somewhere: I kept getting “ERR_TIMEOUT” because I had YABE always open.
Now (with YABE) closed, I get Error: BacnetAbort - Reason:5.
I see that you’re talking about Instance ID (which in my case is 1001), but I can’t find where to put it.
This is my setup:
image

Thanks again!

I’d like to take a look at your script!

I am unfortunately unable to share the complete project as it is stored in the company codebase. But if you are able to provide a couple of screenshot with the objects using BDT(bacnet discovery tool), I should be able to mock a script which acts as a gateway for bacnet and restapi

Where you have type ANALOG_INPUT put the integer 0
Edit device “Trend” and put 1001 for it’s name and put the IP of the BACnet interface on the device.

It looks like bepacom add-in has been fixed for me in the dev version.
If you have bridge interfaces on your supervised home assistant to run KVM VMs, you will need the latest version or you will get the problem I encountered starting ngnix :slight_smile:

I am going to be using this add-on instead of Node Red because it automagically adds each bacnet entity and subscribes to CoV rather than polling. Looks like this might be the best thing next to native bacnet in home assistant and I am very greaful to the developers for the work they have done for the community.

1 Like