Quickstart

BACnet Quickstart: Write an HVAC Setpoint

Write an HVAC temperature setpoint over BACnet/IP and verify the new value with a separate property read.

Before you begin

Install SPX with BACnet and SPX UI, and have a BACnet/IP client that supports ReadProperty and WriteProperty. This quickstart uses the ready-made Flexit Nordic HVAC model; there is no need to generate a model.

Run the test

1. Start the HVAC model

  • In Instances → New instance, choose Building.HvacFlexitNordic.Bacnet. If it is missing, import the linked YAML through Models → Load model from file.
  • Create and start a fresh instance. The example uses device instance 2 and UDP port 47808; check the configured values under Communication → bacnet.
SPX UI showing the selection of the Flexit Nordic BACnet HVAC model.
Choose the ready-made HVAC model and create an instance.

Screenshot preview

Choose the ready-made HVAC model and create an instance. Open original image

2. Read and write the setpoint

  • Connect a BACnet/IP client to the reachable SPX host and UDP port. When SPX runs in Docker, the UDP port must be reachable from the client. Direct addressing can work where broadcast discovery does not cross a network boundary.
  • Read analogValue:1994 / presentValue. In the default state it is 19 °C.
  • Write Real 22.0 to the same property, then issue another ReadProperty request to confirm the value.
SPX UI showing the BACnet adapter and the HVAC model's temperature chart.
Check the BACnet adapter settings and observe the model in SPX UI.

Screenshot preview

Check the BACnet adapter settings and observe the model in SPX UI. Open original image

Check the result

The readback should be 22.0 °C. The write acknowledgement confirms the operation; the separate read confirms the value. Restore Real 19.0, read it back and stop the instance. This test changes the setpoint without enabling the heater.

For a longer experiment, enable the heater using binaryValue:445 / presentValue, then observe analogInput:4 / presentValue and the supply-air temperature in SPX. Restore the heater to inactive afterwards.

SPX UI showing the HVAC supply-air temperature rising and cooling after a heater test.
A separate heating experiment shows the model's gradual supply-air response.

Screenshot preview

A separate heating experiment shows the model's gradual supply-air response. Open original image

Protocol communication

Use these settings and messages with the library’s Flexit Nordic HVAC model.

Client / transport
BACnet/IP → SPX_HOST:47808 over UDP; device instance 2
Property
presentValue; identify values by object type and object instance
Docker / discovery
Publish UDP 47808; use direct unicast when broadcasts cannot cross the network

Replace host placeholders with reachable addresses and use your published ports.

Swipe the table to see requests and replies.

Addresses, requests and expected replies
Address / messageOperation / payloadExpected reply
analogInput:1 / presentValueReadProperty — outside air temperatureReal in °C; nominal value 5.0
analogInput:4 / presentValueReadProperty — supply air temperature; read-onlyReal in °C; changes with heating/cooling
analogValue:1994 / presentValueReadProperty / WriteProperty — home setpointInitially 19.0°C; write Real 22.5, then read 22.5
binaryValue:445 / presentValueReadProperty / WriteProperty — heater enableBinaryPV / Enumerated: inactive (0) or active (1)

Values describe this model’s nominal setup unless noted. Live measurements change as the simulation runs.

Example request and reply

Write setpoint 22.5 and heater active, read both back, then poll analogInput:4. Restore setpoint 19.0 and heater inactive after the response.

ReadProperty analogValue:1994 presentValue → Real 19.0
WriteProperty analogValue:1994 presentValue = Real 22.5 → SimpleACK
ReadProperty analogValue:1994 presentValue → Real 22.5
WriteProperty binaryValue:445 presentValue = active → SimpleACK
ReadProperty analogInput:4 presentValue → rising temperature
Restore: analogValue:1994 = 19.0; binaryValue:445 = inactive
No reply or an unexpected value?
  • Device instance 2 is not the UDP port or object instance. Both object type and number matter: analogInput:4 differs from analogOutput:4.
  • Send a BACnet Real for the setpoint and BinaryPV/Enumerated for the heater, not text. ReadProperty returns an ACK containing the value; WriteProperty returns a SimpleACK. Read again to verify the change.
  • A UDP mapping does not guarantee Who-Is/I-Am broadcast discovery. Check the client interface/subnet, UDP mapping and reachable unicast destination.

Ask your AI agent

Open your SPX workspace in a local AI agent and ask it to run the ready-made example:

Prompt for your AI agent

Test the ready-made Flexit Nordic HVAC model from the SPX library using BACnet/IP. Create one new instance and start it. Use a BACnet client to read and write the setpoint, then read it back at 22 °C. Restore the setpoint to 19 °C and verify the readback. Report the exact endpoint, object identifier, client requests and responses. Stop and delete only the instance created by this test. Do not change or delete any other instance.

Tested with GPT-6 Luna · Medium

Estimated API cost · $0.0077 per run

In our GPT-6 Luna · Medium test, a client inside the SPX container read 19.0 °C, wrote 22.0 °C and confirmed it with a separate read, then restored and verified 19.0 °C. The client used the container's network address because the BACnet UDP port was not published to the host in our setup; use an endpoint reachable in your environment.

Next steps

Create a custom BACnet device with an AI agent. For adapter settings, use the BACnet guide.