Skip to content

Instantly share code, notes, and snippets.

View bbartling's full-sized avatar

Ben Bartling bbartling

View GitHub Profile
@bbartling
bbartling / discharge_air_pressure_reset.md
Last active April 16, 2025 16:11
GL36 Java Script Gists

❄️ Supply Air Temperature Reset – ASHRAE G36 Trim & Respond

This logic implements a modular supply air temperature reset strategy based on ASHRAE Guideline 36, section 5.16.2. VAVs issue SAT requests based on zone-level temperature demand, which are summed and used by the AHU to reset the discharge air temperature via trim and respond logic.


1️⃣ VAV Cooling Request – sat-calculate-requests.hook.js

Each VAV compares zone temperature against the occupied cooling setpoint and determines how many SAT reset requests to send.

@bbartling
bbartling / docker_pi_notes.md
Last active March 22, 2025 15:34
How to run Node Red with custom flows with Docker on HTTPS with custom username and password

🐳 Node-RED Docker Cheat Sheet (with HTTPS/SSL, Flows, and Password)

✅ 1. Install Docker (on Raspberry Pi or Linux)

curl -sL https://get.docker.com | sh
sudo usermod -aG docker $USER

🔁 Reboot or log out/log in after adding yourself to the docker group.

@bbartling
bbartling / main.c
Created February 18, 2025 20:18
Minimal BACnet Server Attempt
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* BACnet Stack includes */
#include "bacnet/bacdef.h"
#include "bacnet/apdu.h"
#include "bacnet/bacdcode.h"
@bbartling
bbartling / kitControls_BOptimizedStartStop.java
Last active June 21, 2025 15:55
Modernized Optimal Start Efforts based on PNNL white paper
package com.tridium.kitControl.energy;
import java.text.DecimalFormat;
import javax.baja.log.Log;
import javax.baja.nre.annotations.NiagaraActions;
import javax.baja.nre.annotations.NiagaraProperties;
import javax.baja.nre.annotations.NiagaraType;
import javax.baja.status.BStatus;
import javax.baja.status.BStatusBoolean;
import javax.baja.status.BStatusNumeric;
@bbartling
bbartling / main.py
Last active April 8, 2024 13:32
PID logic sim for a HVAC VAV box
class VavBoxController:
'''
TODO add in -
state machines for sensor reliability
air flow PID control for damper
integral windup prevention
occupancy state for unoc setpoints
'''
def __init__(
@bbartling
bbartling / bacnet_test.py
Last active May 31, 2025 17:59
simple BAC0 scripts
import asyncio
import BAC0
"""
not tested yet
"""
async def main():
bacnet = BAC0.lite()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.