package
1.0.0-beta.2
Repository: https://github.com/vanti-dev/sc-bos.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Alerts System

The alerts system manages a collection of alerts, these are records that indicate a change to the controller that can be acknowledged by an operator.

Example alerts:

  • Toilet paper is low in cubical 2
  • Unable to communicate with BMS subsystem
  • Power has been restored to floor 6

The alert system as implemented is backed by a database holding the alerts themselves, one row per alert. The alert system will setup the relevant tables in the database when started.

Alert metadata

Alerts can contain some metadata, typically to describe where the alert originated. This metadata is fairly unstructured including the fields floor, zone, and source which are intended to aid with filtering in user interfaces. For example to show only the alerts on floor 3, or that involve Meeting Room 2.

Implementations

The primary implementation is backed by a postgres database as the alert system is supposed to run on the building controller. As we try to allow any controller to run any system, you can setup an area controller to run this alert backend by configuring the system to point to an existing postgres database:

// .data/area-controller-01/area-controller.local.json
{
  // other config
  "systems": {
    // other systems
    "alerts": {
      "storage": {
        "type": "postgres",
        "uri": "postgres://username@localhost:5432/smart_core",
        "passwordFile": "/secrets/postgres-password"
      }
    }
  }
}

For development, you can use the same postgres database setup via the docker-compose.yaml file located at the root of the project. See the dev guide for more info.

You'll then need to update the username above to postgres and create a secrets file with the password in ( also postgres) and update the file path above (relative to the project root).