NAS Services Event Catalog 1.0.0
  • Proprietary

Event-driven architecture for nascoll monitoring services.

This specification documents all events published and consumed across the NAS services monorepo, providing type-safe message definitions and generating Go structs for runtime use.

Architecture

  • Transport: MQTT
  • Message Router: Watermill
  • Storage: RRD (Round Robin Database)

Principles

  • Device-agnostic message types (capability-based naming)
  • Origin field tracks vendor/platform
  • Millisecond-precision timestamps

Servers

  • mqtt://mqtt.local:1883/mqttproduction

    Production MQTT broker

Operations

  • RECEIVE power/{device}/metrics

    Power consumption metrics from monitoring devices.

    Topic pattern: power/{device}/metrics Example: power/vip130/metrics

    Compatible devices:

    • Shelly Pro PM
    • IoTaWatt
    • Any device reporting power/energy/voltage

    Receive power monitoring data from devices

    Subscribes to power metrics published by monitoring devices. Messages are routed to RRD storage for time-series persistence.

    Operation IDreceivePowerMetrics

    Available only on servers:

    object
    device
    required
    string

    Unique device identifier

      Examples values:
    • "vip130"
    • "server-rack-1"
    • "ups-main"

    Accepts the following message:

    Power Monitoring MessagepowerMonitoring

    Power consumption data from monitoring devices

    Message IDpowerMonitoring

    Represents power consumption data from any monitoring device.

    Compatible with Shelly Pro PM, IoTaWatt, and other devices that report power/energy/voltage metrics.

    Design Philosophy: Device-agnostic by default. The origin field identifies the vendor/platform while keeping the message structure generic. See ADR 007 for rationale.

    object

    Root message structure for power monitoring data

    Examples

  • RECEIVE sensor/{device}/metrics

    Temperature and humidity metrics from environmental sensors.

    Topic pattern: sensor/{device}/metrics Example: sensor/shelly-ht-001/metrics

    Compatible devices:

    • Shelly H&T
    • Zigbee sensors (Aqara, etc.)
    • Custom ESP32/Arduino sensors
    • Web-scraped sensor data

    Note: Location mapping is handled via separate configuration. Sensors can be mobile (battery-powered), so location is not part of the MQTT payload. See configs/device-locations.yaml.

    Receive environmental monitoring data from sensors

    Subscribes to temperature and humidity metrics published by environmental sensors. Messages are routed to RRD storage for time-series persistence. Device-to-location mapping is handled via external configuration.

    Operation IDreceiveSensorMetrics

    Available only on servers:

    object
    device
    required
    string

    Unique device identifier

      Examples values:
    • "shelly-ht-001"
    • "aqara-temp-01"
    • "esp32-sensor-garage"

    Accepts the following message:

    Sensor Monitoring MessagesensorMonitoring

    Temperature and humidity data from environmental sensors

    Message IDsensorMonitoring

    Represents temperature, humidity, and optional battery data from environmental sensors.

    Compatible with Shelly H&T, Zigbee sensors (Aqara), custom ESP32/Arduino sensors, and web-scraped sensor data.

    Design Philosophy: Device-agnostic and location-agnostic. The origin field identifies the vendor/platform. Location mapping is handled separately via configuration to support sensor mobility and centralized location management.

    object

    Root message structure for sensor monitoring data

    Examples

Messages

  • #1Power Monitoring MessagePowerMonitoring

    Power consumption data from monitoring devices

    Message IDPowerMonitoring

    Represents power consumption data from any monitoring device.

    Compatible with Shelly Pro PM, IoTaWatt, and other devices that report power/energy/voltage metrics.

    Design Philosophy: Device-agnostic by default. The origin field identifies the vendor/platform while keeping the message structure generic. See ADR 007 for rationale.

    object

    Root message structure for power monitoring data

  • #2Sensor Monitoring MessageSensorMonitoring

    Temperature and humidity data from environmental sensors

    Message IDSensorMonitoring

    Represents temperature, humidity, and optional battery data from environmental sensors.

    Compatible with Shelly H&T, Zigbee sensors (Aqara), custom ESP32/Arduino sensors, and web-scraped sensor data.

    Design Philosophy: Device-agnostic and location-agnostic. The origin field identifies the vendor/platform. Location mapping is handled separately via configuration to support sensor mobility and centralized location management.

    object

    Root message structure for sensor monitoring data

Schemas

  • object

    Root message structure for power monitoring data

  • object

    Actual power consumption measurements

  • object

    Root message structure for sensor monitoring data

  • object

    Actual sensor measurements