Skip to content

Sensors

Send sensor data to update building states in real-time.

Basic Usage

wt sensor send --id <building-uuid> --status online --activity normal

Parameters

Required

Parameter Description
--id Building UUID (from layout)

Status Values

Status Description
online Service operational
offline Service stopped
warning Service degraded
critical Service in error

Activity Values

Activity Description
slow Low activity (0.5x animation)
normal Standard activity (1.0x)
fast High activity (2.0x animation)

Send from JSON File

wt sensor send -f sensor.json

sensor.json:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "online",
  "activity": "normal"
}

Extra Fields

Some building types support additional properties via --extra flags.

Syntax

wt sensor send --id <id> --status online \
  --extra key1=value1 \
  --extra key2=value2

Data Center Fields

wt sensor send --id <id> --status online \
  --extra cpuUsage=75 \
  --extra ramUsage=60 \
  --extra networkTraffic=45 \
  --extra activeConnections=1234 \
  --extra temperature=42 \
  --extra alertLevel=normal
Field Type Range Description
cpuUsage int 0-100 CPU utilization %
ramUsage int 0-100 Memory usage %
networkTraffic int 0-100 Network load %
activeConnections int any Connection count
temperature int 0-100 Temperature %
alertLevel string normal/warning/critical Alert state

Bank Fields

wt sensor send --id <id> --status online \
  --extra quantity=high \
  --extra amount=42000
Field Type Values Description
quantity string none/low/medium/high Gold bar display
amount int any Amount shown

Display A Fields

wt sensor send --id <id> --status online \
  --extra ringCount=5 \
  --extra text1="Line 1" \
  --extra text2="Line 2" \
  --extra text3="Line 3"
Field Type Range Description
ringCount int 1-8 Number of LED rings
text1 string any First line text
text2 string any Second line text
text3 string any Third line text

Tower Fields

wt sensor send --id <id> --status online \
  --extra towerText="ONLINE"
Field Type Description
towerText string Tower A LED text
towerBText string Tower B LED text

Arcade Fields

wt sensor send --id <id> --status online \
  --extra signText="ARCADE" \
  --extra dancerEnabled=true \
  --extra musicEnabled=true
Field Type Description
signText string Neon sign text
dancerEnabled bool Holographic dancer on/off
musicEnabled bool Equalizer on/off

Supervisor Fields

wt sensor send --id <id> --status online \
  --extra faceRotationEnabled=true
Field Type Description
faceRotationEnabled bool Face animation on/off

Monitor Tube Fields

wt sensor send --id <id> --status online \
  --extra bandCount=5 \
  --extra bands="80,60,40,70,55"
Field Type Description
bandCount int Number of bands (3-7)
bands string Comma-separated values

JSON with Extra Fields

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "online",
  "activity": "fast",
  "extra": {
    "cpuUsage": 75,
    "ramUsage": 60,
    "temperature": 42
  }
}

Scripting Examples

Monitor Script

#!/bin/bash
BUILDING_ID="your-building-uuid"

# Get CPU usage
CPU=$(top -bn1 | grep "Cpu(s)" | awk '{print int($2)}')

# Determine status
if [ $CPU -gt 90 ]; then
  STATUS="critical"
  ACTIVITY="fast"
elif [ $CPU -gt 70 ]; then
  STATUS="warning"
  ACTIVITY="fast"
else
  STATUS="online"
  ACTIVITY="normal"
fi

wt sensor send --id $BUILDING_ID --status $STATUS --activity $ACTIVITY \
  --extra cpuUsage=$CPU

CI/CD Integration

#!/bin/bash
BUILDING_ID="deployment-building-uuid"

# Deployment starting
wt sensor send --id $BUILDING_ID --status warning --activity fast \
  --extra towerText="DEPLOYING"

# Run deployment
if ./deploy.sh; then
  wt sensor send --id $BUILDING_ID --status online --activity normal \
    --extra towerText="DEPLOYED"
else
  wt sensor send --id $BUILDING_ID --status critical --activity slow \
    --extra towerText="FAILED"
fi

Prometheus Webhook

#!/bin/bash
# Called by Prometheus AlertManager

BUILDING_ID="$1"
STATUS="$2"

case $STATUS in
  firing)
    wt sensor send --id $BUILDING_ID --status critical
    ;;
  resolved)
    wt sensor send --id $BUILDING_ID --status online
    ;;
esac

Using Sensor Tokens

For automated integrations, use a sensor-type token:

# Create sensor token
wt token create --name "monitoring" --type sensor

# Use in scripts
wt --token <sensor-token> sensor send --id <id> --status online

Sensor tokens have minimal permissions - they can only send sensor data.