alerts

package
v0.2024.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

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).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factory factory

Functions

func Register

func Register(supporter node.Supporter)

Types

type System

type System struct {
	*service.Service[config.Root]
	// contains filtered or unexported fields
}

func NewSystem

func NewSystem(services system.Services) *System

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL