#Bacnet Add-on

1 messages · Page 1 of 1 (latest)

pseudo pivot
#

I created a native bacnet add-on for HA.
https://github.com/home-assistant/core/pull/162584

Node-red hackery is annoying me to do somehting that is quite simple..

Here's a summary of the BACnet integration:

  • Hub-device model — A single BACnet/IP client (hub) binds to a network interface and manages communication with multiple BACnet devices, each added as a separate config entry.

  • Config flow — Two-stage setup within the HA UI: (1) pick a network interface for the hub, (2) discover devices via WhoIs broadcast or add manually, then select which BACnet objects to monitor. Options flow lets you change object selection later.

  • Entity platforms: - Sensors — Analog Input, Analog Value, and similar read-only numeric objects (50+ BACnet unit mappings) - Binary sensors — Binary Input, Binary Value

    • Numbers — Analog Output (writable)
    • Switches — Binary Output (writable)
    • Selects — Multi-State Output (writable, with state text labels)

    All writes use BACnet priority 16 (lowest).

    Data updates — Hybrid strategy: COV (Change of Value) subscriptions for real-time push updates, with 60-second polling as fallback for objects that don't support COV.

    Discovery — Periodic WhoIs broadcasts every 5 minutes find new devices and trigger HA discovery flows automatically.

    Lifecycle — Removing the hub cascades removal to all child devices. Unloading cancels COV subscriptions and discovery tasks cleanly.

@fervent raptor wanted to discuss on discord.. let's do it! I am keen to get this RP accepted and merged asap, so I can use it without a custom HA build.

GitHub

Breaking change

Proposed change

Type of change

Dependency upgrade
Bugfix (non-breaking change which fixes an issue)
New integration (thank you!)
New feature (which adds functionality to an ...

fervent raptor
#

Heyo!

#

Okay so I really like this PR. AFAIK there is only one other BACnet based integration in core at the moment

#

flexit_bacnet

#

So from what I understand, this is a modbus like protocol right?

pseudo pivot
#

kind of, but better in that the devices describe themselves, so yu can pretty much query the device, and dynamically build all the entities in HA

#

flexit is for a specific bacnet impl, it hard codes devices types etc. My one does the full discovery so should be compa with every bacnet device. I have mitsubishi, schneider, danfoss all working fine.

fervent raptor
#

Because the problem with modbus is that you have a ton of registers, and today you'd need to supply all the context of a register yourself, and that isn't always nice

#

As in, my mom wouldn't be able to do that

pseudo pivot
#

nope. i have some modbus devices too.. and i considered doing an HA impl.. even got claude to plan it. it was a shit-fest.

fervent raptor
#

And I think in the long run it would be cool to make modbus way more usable, hence I am wondering how bacnet differs and how we can make it user friendly from the get go

#

Because if we look at the internals, do you use bluetooth?

pseudo pivot
#

no bluetooth.

fervent raptor
#

Because with the bluetooth integration, you add an adapter, and after that, the bluetooth integration can discover devices

pseudo pivot
#

bacnet is all UDP. there is a broadcast to discover, then UDP for subsequent traffic

#

i see.

#

i get what you mean

fervent raptor
#

so then the logic to "understand" the bluetooth info, is in the integration layer

pseudo pivot
#

HA needs to change to make this nice..

#

this is the hub intgration.. you need to add 1-n hubs, AND then each hub can add 1-n devices, and each device add 1-n entities.

#

so you have hub->device->entities

#

but HA has hub>entities

fervent raptor
#

So this is also what would be cool with modbus, being able to have a "mitsubitshi_modbus" integration, which then contains all the data related to registers and what context each register has

fervent raptor
#

And maybe, could it make sense to work with specific integrations from the start, or would that be overkill

pseudo pivot
#

be careful modbus is really customisable, you can even get devices that bit set. there is bascially no way to make this nice in HA

fervent raptor
#

Oh we found out 😂

#

That's why I am wondering how bacnet compares, because maybe it could help drive changes that we could use in modbus or vice versa

pseudo pivot
#

i have an austiran biamass boiler (ETA), with a modbus/IP interface. itt all works fine.. but it just wont be feasible to auto-discover or at elast make the config sensible in HA

#

modbus is just too low level. it would be a dog.

#

another one is profinet. its similar to bacnet, self describing etc. BUT

#

you have to construct ethernet packets directly as its a realy protocol at ethernet level. I gave up on that. again claude shat its pants when I ran the spec into it.

fervent raptor
#

We also have this with MQTT by the way, so integrations can use the mqtt integration to listen to topics and receive updates. This way users don't have to setup all the topics and such themselves

#

Sounds lovely

pseudo pivot
#

modbus-mgtt is a very good way fo fixing this.

fervent raptor
#

So you mention bacnet is self describing, how much context does it deliver?

pseudo pivot
#

so, bascially, bacnet describes all the 'points' it has, they have types (binary, analog, state (enums basically) ), and can be redable, or writeable or both. for analog values, they have the units there as well.. so you can fairly easily map the units in HA sensors ro the units in bacnet.

fervent raptor
#

Right

#

But do we have enough context to find out if it should be a climate entity or a water heater?

pseudo pivot
#

nope

fervent raptor
#

And the state types, is that just values 0, 1, 3, 4

#

or also as a string

pseudo pivot
#

this is interesting. (I am doing a change right now for this).

fervent raptor
#

It certainly is 😛

pseudo pivot
#

the enums raw data is an integer. you have to map the integer to a text (by getting the description of the point). so you need to keep track of the id->description map as well. The commit I have just made, polls the devices, and redescovers changes.

fervent raptor
#

how do you mean rediscover changes?

pseudo pivot
#

This is a niche problem, and not often happens. Suppose a device gets a firmware upgrade.. and the enums change or a point is added, then this is now detected.

fervent raptor
#

Right

#

Okay I need to go soon, but let me explain how I would see an ideal world with this

#

So we like entities contextualized. Which means, translations (because not every Home Assistant user speaks English as their native language), entity categories (some things are diagnostic, some are essential), device classes (like temperature, which then allows the user to configure the entity to show in Fahrenheit instead of Celsius), and state translations (away is easier to understand than 0)

#

But also specific entities, your device sounds like a water heater or climate device, so ideally we show that to the user as a proper climate or water heater device (as that is also an easy way to automate with them, and it fit nicely in dashboard and so forth)

#

So while the user can construct that themselves with template entitites, I am wondering if it would make sense to have a similar thing to MQTT/Bluetooth, where we have integrations specifically for a bacnet device, allowing you to add the needed context

#

Which in the end increases the user experience because then they don't really need to grasp what a value means, we already caugh that in the code

pseudo pivot
#

you cannto autodiscover these meta-devices. but you could for instance build a climate entity by stringing together a bunch of sensors, switches and numbers

fervent raptor
#

and be aware, this is just a dream at this point and at this point you know more about bacnet than I do

fervent raptor
pseudo pivot
#

i think i have thought of somethign quite useful for HA here.. by accident!

fervent raptor
#

😂

#

great

#

But you understand the thing I am describing right?

pseudo pivot
#

suppose you have a buch of sensors, switches and numbers (that come from bacnet, bluetooth, modbus, wherever)..

fervent raptor
#

Template entities?

pseudo pivot
#

you could make a climate entity from this

fervent raptor
#

(or "virtual devices" for that matter)

pseudo pivot
#

yes. thats my idea. !

#

you already have it?

fervent raptor
#

yea, so in theory you can already do that with template entities

pseudo pivot
#

so already thought of.. not that helpful am i

fervent raptor
pseudo pivot
#

got it

fervent raptor
#

But I think it would be a nice out of the box experience to deliver this to users already as a climate entity

pseudo pivot
#

one sec.

fervent raptor
#

because in the end, most people would like it as a climate entity, so if we can avoid every user to that action after setting up

pseudo pivot
#

let me show you screen grabs

fervent raptor
#

okok

pseudo pivot
#

ive killed my HA for some reason.. once its alive i will post from screen grabs of the addon working

fervent raptor
#

lmao nice

pseudo pivot
#

whats the process for getting the PR accepted

fervent raptor
#

Getting it reviewed, just like the other one

pseudo pivot
#

ok

fervent raptor
#

but in this case I want to take a step back and take the goal into account

#

because yes, it would work, but I am wondering if we can push ourselves to make it nice

#

And if there's a way for other integrations to build on top of it to provide nice contextualized entities

pseudo pivot
#

well the hub(s)>device(s)>entities change would make sense for bluetooth, and bacnet

fervent raptor
#

that's already there 🙂

pseudo pivot
#

in functionaiyt- yes, but not int he UO

fervent raptor
pseudo pivot
#

button says add entry

#

my button says add hub

#

??

fervent raptor
#

that's configurable

pseudo pivot
#

i guess i need to look at bluetooth addon

fervent raptor
#

even translatable since last release

pseudo pivot
#

i will fix it next

#

ok, i didnt know. leave it with me

fervent raptor
#

But like said, don't take my words at this point as truth, I think it's a nice thing to explore first

#

I also signalled the PR to people who work on the other protocols like Zigbee and Matter, as this might also be an interesting protocol to keep in mind

#

as a number of devices also use this, and then we can support even more devices 😄

#

Anyway, I have to go now, I will catch you later

pseudo pivot
#

agree

fervent raptor
#

I gave you the developer role btw, I think at some point we need to move the conversation to a project thread

pseudo pivot
#

sure

fervent raptor
#

(as this is the support channel, not a dev channel)

pseudo pivot
#

by all means move to the right place. i am new here

fervent raptor
#

Oh we can't move threads, but I will create one later then 🙂

pseudo pivot
#

ok, bye

red prairie
#

how do you connect Bacnet devices to HA? Do you need some "bridge" device or is it just UDP over ethernet?