Quick overview
Youtube Video: https://www.youtube.com/shorts/vwW0553ZAJE
This workflow monitors campus building power use by combining BMS telemetry with smart meter snapshots, Sheets baselines, Calendar occupancy signals, and local weather, then uses Gemini to diagnose after-hours energy leaks, alerts the right Slack channels, logs ROI to Sheets, and opens a CMMS work order.
How it works
- Runs every 15 minutes and can also be triggered by a BMS telemetry webhook to start an energy monitoring cycle.
- Pulls live smart meter snapshots from an internal HTTP API, then splits the payload into one item per campus building.
- Looks up each building’s baseline thresholds and metadata in Google Sheets, checks the building’s Google Calendar for current events/holidays, and fetches current outdoor conditions from the Open-Meteo API.
- Calculates the expected occupancy state, applies weather/grace-period adjustments, computes excess kW and financial waste estimates, and flags buildings that exceed the unoccupied baseline.
- Keeps only active leaks (e.g., after-hours/holiday over-baseline conditions) and deduplicates alerts so each building only triggers once per hour.
- Uses Google Gemini with a Google Sheets tool that queries historical HVAC override logs to produce a structured root-cause diagnosis, technician checklist, and CFO ROI headline.
- Routes CRITICAL vs WARNING leaks to different Slack channels, appends the incident and savings estimates to a Google Sheets ROI ledger, and creates a CMMS work order via an HTTP request for critical alerts.
Setup
- Configure the HTTP Header Auth credentials for the smart meter API endpoint and the CMMS (MaintainX) work order API, and update the URLs if your endpoints differ.
- Add Google Service Account credentials and ensure the Google Sheets file contains the Building_Baselines, HVAC_Override_History, and CFO_Savings_Ledger tabs with the expected columns (e.g., building_id, calendar_id, baselines, rate_per_kwh, latitude/longitude, grace_period_mins).
- Add Google Calendar OAuth2 credentials and ensure each building record in the baseline sheet references a valid calendar ID.
- Add Google Gemini (PaLM) credentials for the AI diagnosis step.
- Add Slack credentials and update the target channel IDs for urgent dispatch and operations digest notifications.
- If using the webhook trigger, copy the production webhook URL from n8n and configure your BMS to POST telemetry to /bms-telemetry-ingest.