Unique MQTT to BACnet Use-Case?

Hello everyone!

New to Node-RED as well as MQTT/BACnet integration. We have an unusual use-case that we're attempting to Proof-Of-Concept, but have been hitting various speed bumps.

The ultimate goal is to have our endpoint devices (sensors, etc.) send their data to a local MQTT broker and then have that local broker send actionable output to a local BACnet appliance for further local processing before any output is ultimately sent to a cloud environment. We have the sensors and related MQTT gateway sending data TO our local MQTT broker, but we're having trouble figuring out the conversion step(s) to get the MQTT output properly converted to BACnet compatible inputs...

We've looked into all of the available BACnet-related node sets ( Library - Node-RED ), but haven't been able to get things properly configured to this point.

Do any of you have experience converting MQTT TO BACnet??? If so, would you be willing to share your related wisdom and suggestions? Thanks in advance and have a great weekend!!!

Welcome to the forums @RedWerd

I apologize for playing detective here (and more so if I am wrong), but this by any chance isn't related to a recent post of an almost identical subject is it in our jobs category (kindly linked below)?

Its just interesting that an extremely similar requirement has come about.

Do you care to share a little more about your unusual use-case?

What does your inbound data look like?
Into what format must it be converted?
Does one incoming message produce one outbound, or is some kind of storage/aggregation required?

Hi, Marcus!

Thanks for the welcome.

Yes, apparently - I was not aware that that had been posted to the jobs board here, but that is indeed a post from the business owner.

In any case, what would be most helpful (in my opinion) at least in the short-term would be if there are example flows where folks have managed to work a similar conversion from MQTT TO BACnet locally -rather than from local BACnet TO MQTT broker in the cloud - so that we can determine whether we're just missing something in the configuration or whether there is a fundamental misunderstanding of the capabilities of Node-RED to facilitate our use-case.

Would you have any suggestions to that end? Thanks!

Hi, jbudd!

Initially, we were just looking at the raw sensor data coming into a simple Node-RED flow to evaluate how we would need to handle it (and to determine the necessary format conversions) to feed it through the local MQTT broker to local BACnet. We hadn't yet solidified our topics structure or message content scope, since this is largely a Proof-Of-Concept effort to this point.

My understanding of the intended data flow suggests that this would be a one-way, one message in to one message out setup - though that could potentially change over time if the use-case is modified. So, no persistent storage requirement that I am aware of currently given that the flow will essentially drive a near-real time processing/reporting capability further downstream.

To that end, do you have any suggestions? Thanks!

@RedWerd

I know nothing about BACnet (i'm sure many do here), but a search on the Nodes catalogue:

Connecting this up to an MQTT node, may open up a few possibilities.

EDIT:
I need to learn to read more, seems this isn't simply about a node that can do BACnet :innocent:

Yeah, as I mentioned in the original post, we've looked at this and the other available BACnet-related node sets, but haven't been able to get things flowing the way we're envisioning - so, the question is whether we're simply not configuring things properly OR is it a matter of Node-RED not being able to facilitate the use-case at all (to this point)?

That's where I'm lost currently. So, a working example of something similar would be very helpful in determining where the disconnect may be...

Thanks!

Well I'm quite sure you are familiar with the way MQTT works but your original post

... have our endpoint devices (sensors, etc.) send their data to a local MQTT broker and then have that local broker send actionable output to a local BACnet appliance

implies you are expecting the MQTT broker to reformat data and pass it on to the BACnet appliance.
In fact of course the reformatting would be within Node-red, Something like this.

WIthout an actual example of an incoming message and the outbound message[s] to generate from it, it's hard to create a working example. (Also I do not know BACnet).

Hi, jbudd.

To clarify, we know that the Broker itself cannot reformat the data - that's what Node-RED is for, as you reiterated. It's the "Reformat within Node-red" step(s) that we're having trouble figuring out.

Our local Broker is running on a Raspberry Pi (at least for PoC testing) with the latest version of Node-RED also installed there.

We're currently testing NCD's sensors and MQTT Gateway device - which has an interesting MQTT output format referenced here in the device documentation under Message Settings and Token Definitions: https://ncd.io/wifi-micro-gateway-setup-mqtt/

NOTE: Sensor_Data This token will embed the data from the sensor as needed into the Sensor Message payload. Note that sensor data is a keyed JSON object.

The goal would be to convert and feed that Sensor payload data into local BACnet to support local processing... but all of the BACnet-related node sets that are currently available are less than intuitive in terms of configuration (at least for me with no BACnet experience aside from what has been explained to me recently).

And it may be that there are other Function nodes that need to be configured along with the BACnet-specific nodes for the flow to function the way we are envisioning, but I just don't know what those might be. So, to that end, do you have any ideas? What additional information would be helpful?

Your wisdom is appreciated - thanks!

Hi @RedWerd - apologies if I'm stating the obvious :see_no_evil:

The MQTT node will output an object msg, and by Node RED standards, the bulk of the information will (usually) be in a payload object.

/* msg.payload */
{
   someProperty:"Hello, World",
   someOtherProperty: 500,
   someFancyObject: {
      someProperty: "Hello, World - but deeper"
   }
}

Let's say, the BACnet nodes needs the value of someOtherProperty but it must be named BACnetName (ideally you will know more here, then I/us)

You can drag in a function node and stick it between the MQTT node and the BACnet node

msg.payload = {
  BACnetName: msg.payload.someOtherProperty
}
return msg

the payload now becomes, and will be passed to the BACnet node

/* msg.payload */
{
   BACnetName:500
}

you can also use the change node to do this - But I think this is more transparent at this stage.

as for the BACnet nodes themself, You will need to read on its documentation, and what properties/formats it wants

EDIT
You can use a debug node to print out the message, in the debug panel to the right

It is possible that BACnet specific nodes would help but I'm fairly sure they are not absolutely required.
It's simpler than you seem to think.
You may be over complicating your researches by trying to fit your requirement into what those nodes offer.

There are already multiple ways within node-red to construct messages in various formats.

A way that you might make some progress is to choose a simple BACnet function, perhaps to turn on a light (I have no idea what it can do).
In Node-red construct from scratch the message that will trigger that function. ie no mqtt-in component to worry about.

This should get you used to manipulating data in Node-red. @marcus-j-davies' suggestion above should help.

Next write down all the sensor data messages you might receive and the rules for creating Bacnet messages.
eg bearing temp > 99 -- Increase oil pump.

1 Like

It IS entirely possible that I'm over-complicating it. :slight_smile:

Thanks for the suggestions - I'll keep all of that in mind and see about doing some more testing in the coming days...

@RedWerd some more detail is needed
what is the brand of your "local BACnet appliance" ?
I assume that node-RED is a BACnet client ?
And "local BACnet appliance" is a Server?
What BACnet object types are you writing to?
E.g. "Analog Value Object Type"
Full list of object types
https://ecostruxure-building-help.se.com/bms/topics/show.castle?id=14265&locale=en-US&productversion=3.3

node-bacnet-contrib-extended is new to me I've not used/tested it.
But it looks like it has all you need.

It is possible that BACnet specific nodes would help but I'm fairly sure they are not absolutely required.

I doubt this the case you just send any old msg to a BACnet device

So can help us to help you
Can you list the measurement the sensor reads e.g temp 0-40C and it's data type e.g. float/integer
With this we can then convert to BACnet object type
We also need the object list from the local appliance you can get this via YABE discovery tool.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.