Skip to content

Conceptual ideas for how AI can be used to help setup building automation system (BAS) at the supervisory programming level.

License

Notifications You must be signed in to change notification settings

bbartling/BAS-Tech-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BAS-Tech-Assistant

This is a conceptual idea for how AI can be used to help setup building automation system's (BAS) at the supervisory programming level. These ideas are all inspired and not possibly without the creation of the Python BACnet stack called bacpypes and most specifically the newer asyncio based project called bacpypes3 which lives at this git repository all created by Joel Bender. Inside the bacpypes3 repo there is a samples/discover-objects-rdf.py which all these ideas stem from.

Step 1: Classify device type with LLM

The BRICK schema provides a variety of device types for building automation. In building automation contracting, humans often have to manually determine what type of system the HVAC PLC devices control. This task can be daunting, especially if the building is unfamiliar to the BAS technician or IoT developer setting up an edge device. While BRICK data models can significantly aid this process if metadata exists, widespread adoption in the industry is still required. In the absence of metadata (which is likely the case for most buildings at present), an LLM or AI can potentially assist with this task. Here are some common BRICK device types, and you can refer to this link for core concepts.

BRICK.Variable_Air_Volume_Box
BRICK.Air_Handler_Unit
BRICK.Central_Plant
BRICK.Fan_Coil_Unit
BRICK.Boiler
BRICK.Heat_Pump
BRICK.Terminal_Unit
BRICK.Sensor

This is also a super helpful link to BRICK HVAC Equipment for reference.

Step 2: Classify point types with LLM

Once a BACnet device, such as a PLC or an application-specific HVAC control embedded I/O device, is classified by its type of HVAC controller, there are typically numerous "messy" points within the device. These points are considered "messy" due to the lack of standardization in the industry, leading to unique point names that vary from contractor to contractor or technician to technician who originally set up the equipment.

To address this issue, we can leverage a Language Learning Model (LLM) like ChatGPT to make a second request to classify these points into the BRICK format. For example, if the device is identified as a VAV box, we can extract only the useful data typically used in supervisory-level programming for setting up graphics and sensor I/O used for troubleshooting. About 50% of BACnet data points are often tuning parameters that do not need to be integrated into the supervisory-level device, which helps reduce network traffic and unnecessary BACnet requests.

Here's how a human would manually map BACnet discovered HVAC controls to BRICK format which AI can potentially be used for:

point_type_mappings = {
    "Zone Air Temperature Sensor": ["ZN-T", BRICK.Temperature_Sensor],
    "Zone Temperature Setpoint": ["ZN-SP", BRICK.Temperature_Setpoint],
    "Supply Air Temperature Sensor": ["DA-T", BRICK.Temperature_Sensor],
    "Heating Coil Valve Command": ["HTG-O", BRICK.Valve_Command],
    "Air Damper Command": ["DPR-O", BRICK.Damper_Command],
    "Air Flow Sensor": ["SA-F", BRICK.Air_Flow_Sensor],
    "Supply Air Flow Setpoint": ["SAFLOW-SP", BRICK.Air_Flow_Setpoint],
    "Occupancy Sensor": ["OCC-C", BRICK.Occupancy_Sensor],
}

Step 3: TODO Additional Supervisory Level Logic

This step typically involves the human building automation technician pulling in all the BACnet devices and points, and setting up trend history extensions and alarm configurations on BAS points. Additional supervisory-level logic might include scheduling equipment via a BAS runtime weekly calendar widget and sharing global outside air temperature sensor data. BRICK data modeling can be used to assist in identifying equipment runtime points and outdoor air temperature sensor points for global outside air temperature sharing logic.

Step 4: TODO Switch to a Continuous Monitoring State

Once these configurations are in place, the BAS can continuously poll data and dial out alarms, as is standard in modern BAS systems. At this point, the LLM or AI can transition to a monitoring state as an optional service, assisting humans in overseeing the building's operations to ensure good indoor air quality (IAQ) and the optimal performance of mechanical systems.

Set Up the Environment

  1. Clone the Repository:
git clone https://github.com/bbartling/BAS-Tech-Assistant.git
cd Virtual-Building-Automation-Assistant
  1. Create a Virtual Environment:
python3 -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  1. Install Required Packages:
pip install bacpypes3 openai rdflib sqlite3
  1. Set the OpenAI API Key: Mac and linux:
export OPENAI_API_KEY='your_openai_api_key'

Windows:

set OPENAI_API_KEY='your_openai_api_key'

Run the Script

The discover-objects-rdf.py script is designed to discover BACnet devices and process their RDF data. To run the script, use the following command format:

python discover-objects-rdf.py <device_identifier> -o <output_file> [--building-name <building_name>] [--system-name <system_name>] [--vav-box <vav_box_file>] [--room-numbers <room_numbers>] [--debug]
  • <device_identifier>: The identifier of the BACnet device you want to discover.
  • -o <output_file>: Specifies the output file for the processed RDF data.
  • --building-name <building_name>: Optionally provide the building name (default is "Building1").
  • --system-name <system_name>: Optionally provide the name of the HVAC system (default is "System1"), which can be any * HVAC equipment such as a VAV box, central plant, AHU, FCU, boiler, etc.
  • --vav-box <vav_box_file>: Optionally provide the name of the VAV box file (default is "vav_10").
  • --room-numbers <room_numbers>: Optionally provide a list of room numbers (default is ["410", "411", "412"]).
  • --debug: Enables debugging mode for additional output during the script's execution.

For example, to process a device with identifier 10, output to processed_vav_10.ttl, and set the building name to "MyBuilding", system name to "System1", VAV box file to "vav_10", and room numbers to "410", "411", and "412", you would use:

python discover-objects-rdf.py 10 -o processed_vav_10.ttl --building-name MyBuilding --system-name System1 --vav-box vav_10 --room-numbers 410 411 412 --debug

This command will:

  • Discover the BACnet device with identifier 10.
  • Output the processed RDF data to processed_vav_10.ttl.
  • Use the provided building name, system name, VAV box file, and room numbers. Make sure to replace your_openai_api_key with your actual OpenAI API key. This setup allows for a flexible and maintainable way to manage your virtual building automation assistant.

About

Conceptual ideas for how AI can be used to help setup building automation system (BAS) at the supervisory programming level.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages