KW Knowledge base

Notifications & SMTP

How alarms reach you outside the web UI: MQTT push (in-browser / PWA), email (SMTP), and Home Assistant.

Mitch Wigham
Updated 24 June 2026 · 6 views

Notifications & SMTP

How alarms reach you outside the web UI: MQTT push (in-browser / PWA), email (SMTP), and Home Assistant.

Channels

Channel Configured where Reaches
MQTT Always on (embedded broker) Web UI, PWA install, custom MQTT clients
Email Settings → SMTP Any inbox
Home Assistant Auto-published on the same MQTT Your HA dashboard

MQTT push

Vistralio runs its own MQTT broker on localhost:1883 (TCP) and exposes a WebSocket listener on 1884 so the browser can subscribe directly. Every event publishes to:

sentinel/events/<camera_id>/<label>

with a JSON payload. The web UI subscribes via MQTT-over-WebSocket and shows in-browser notifications. If you've installed the page as a PWA / Chrome desktop app, the notifications appear as native OS notifications.

Installing as a desktop app

In Chrome: open Vistralio → menu → Install Vistralio…. In Firefox: similar via the URL bar address-icon menu. In Safari iOS: Share → Add to Home Screen.

Once installed, push notifications behave like a real mobile app — they fire even when the browser tab isn't focused.

Subscribing from your own client

import paho.mqtt.client as mqtt

def on_msg(client, userdata, msg):
    print(msg.topic, msg.payload.decode())

c = mqtt.Client()
c.username_pw_set("sentinel", "<broker password from /etc/vistralio/vistralio.yaml>")
c.connect("cctv.example.com", 1883)
c.subscribe("sentinel/events/+/+")
c.on_message = on_msg
c.loop_forever()

SMTP / email

Vistralio does not run its own SMTP server. It runs an SMTP client that uses any provider you point it at — Gmail, Office 365, SES, Mailgun, your own postfix, whatever.

Configuring

Settings → SMTP (admin only). Fill in:

  • Hostsmtp.gmail.com, smtp.office365.com, etc.
  • Port — usually 587
  • Username — your account
  • Password — your account password or app password
  • From address — what appears in the From: header
  • Use TLS — leave on for almost any modern provider

Settings are stored in the regular settings table under keys smtp.host, smtp.port, smtp.username, smtp.password, smtp.from, smtp.tls.

Sending a test

The notifier calls services/smtp.send_email() automatically when an event matches a known face/plate with a webhook or email action. To test from the API:

curl -X POST /api/notifications/test-email \
     -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"to":"you@example.com","subject":"test","body":"hello"}'

(Endpoint planned for the next iteration; for now, trigger a real event with an action attached.)

Home Assistant

See Home Assistant integration.

Permissions

Action Permission
Read SMTP settings settings.admin
Edit SMTP settings settings.admin

Still need help?

Log a support ticket and the team will pick it up from this page.