Skip to main content

Sector Alarm smart home integration, free and open source

Sector Alarm integration for Gladys Assistant

Arm and disarm your Sector Alarm system, drive its locks and plugs, follow its sensors.

This integration connects Gladys to your Sector Alarm home alarm system: arm and disarm the panel, lock and unlock the smart locks, switch the smart plugs, and follow the sensors (doors and windows, smoke, water leaks, temperature, humidity).

Before you start​

  • Gladys 5.3 or later is required.
  • A Sector Alarm account: the email and password you use in the Sector Alarm mobile app.
  • Gladys needs internet access. Sector Alarm has no local API: everything goes through the Sector Alarm cloud (mypagesapi.sectoralarm.net). That is why the integration is tagged cloud.

Configuration​

FieldWhat to put in it
EmailThe email of your Sector Alarm account.
PasswordIts password. Stored as a secret, never written to the logs.
Panel codeThe code you type on the keypad. Optional, see below.
Panel idEmpty to follow every panel of the account. Otherwise one id, or several separated by commas.
Refresh interval (s)How often Sector Alarm is read. 60 s by default, 30 s minimum. Sector Alarm limits requests: below a minute brings little.

Save, then click Test the connection: the answer lists the panels found, their mode, whether they are online and how many accessories they have. Then open the Discovery tab of the integration and create the devices you want.

The panel code​

The code is only needed to:

  • disarm the alarm from Gladys (a scene, the device card);
  • lock or unlock a smart lock;
  • arm a panel whose quick arm is turned off.

Without a code, Gladys can still read everything and arm a panel that has quick arm on. Leave it empty if you do not want Gladys to be able to disarm.

Devices​

Device in GladysFeaturesValues
Panel (one per panel)Alarm mode (a list: Disarmed, Partially armed, Armed)disarmed, partial, armed
Smart lockLock (controllable), Battery low1 = locked, 0 = unlocked
Smart plugPower (controllable)1 = on, 0 = off
Door / window sensorOpening, Battery low1 = closed, 0 = open
Smoke detectorSmoke, often Temperature1 = smoke detected
Leakage detectorWater leak1 = leak detected
Temperature / humidityTemperature (°C), Humidity (%)

"Partially armed" only appears on a panel that supports it. Each device shows a cloud badge; it turns unreachable when the panel is offline or when Sector Alarm does not answer.

Gladys does not poll the devices one by one: the integration reads each panel as a whole, at the refresh interval, and only sends Gladys the values that changed. After an order, the panel is read again a few seconds later to confirm.

Dashboard widget​

Add the Sector Alarm widget to a dashboard. It shows:

  • the alarm mode (red armed, orange partially armed, green disarmed);
  • the connection of the panel;
  • the doors and windows left open, the locks left unlocked;
  • a smoke or water alert.

Its buttons: Arm and Partial (with a confirmation), Disarm, Refresh.

Security. A dashboard can hang on a wall, and anyone can tap it. The Disarm button therefore never uses the code of the configuration: it opens a small form where the code must be typed every time.

With several panels, pick the one to show in the widget settings.

Scenes​

Triggers​

TriggerKeyFiltersVariables
The alarm mode changesalarm_mode_changedPanel, New modemode, previous_mode, panel_name, user, channel
A panel goes offline or comes backpanel_connection_changedPanel, Connectionstate (offline / online), panel_name
A smart lock is usedlock_operatedLock, What happenedaction (lock / unlock / lock_failed), lock_name, user, channel

user and channel come from the Sector Alarm event log (who, and with what: keypad, app, tag…); they are empty when the log does not say.

The triggers fire on changes seen between two refreshes, from wherever they come (keypad, app, tag or Gladys). Nothing fires for the first read after a start: the history is not news. A change that comes and goes between two refreshes may be missed: lower the refresh interval if that matters.

Examples:

  • When the alarm is disarmed, if nobody is home, send me a notification with {{triggerEvent.data.user}}.
  • When the panel goes offline, send a message.
  • When the front door is unlocked, turn on the hall light.

Actions​

ActionKeyFieldsOutputs
Set the alarm modeset_alarm_modePanel, Modeapplied (yes/no), mode, error
Read Sector Alarm nowrefresh_nowPanel (optional)mode, online

set_alarm_mode uses the panel code of the configuration. A refused order does not stop the scene: check applied in a condition, and use error in a notification. Example: at 11 pm, arm the alarm partially; if applied is no, send me error.

The standard Gladys actions also drive the devices: the alarm mode, the locks and the plugs can be set with Control a device.

Buttons of the configuration screen​

  • Test the connection: logs in again and reads every panel.
  • Refresh now: reads Sector Alarm without waiting.

Troubleshooting​

What you seeWhat to do
"Sector Alarm refused the email or the password"Check them in the Sector Alarm app, then save again.
"Sector Alarm asks to slow down"Sector Alarm limits requests. The integration waits longer between reads, then goes back to normal. Raise the refresh interval.
"Sector Alarm cannot be reached"Check the internet access of Gladys.
"The panel code is required…"Fill in the panel code, or arm only with quick arm.
A sensor is missingClick Refresh now, then look at the Discovery tab: a new accessory appears there.
The mode is stuck while the panel is offlineOn purpose: an offline panel reports "armed" whatever it is, so Gladys keeps the last known mode.

Privacy​

Your email, password and panel code stay in Gladys, as secrets, and are sent only to Sector Alarm (mypagesapi.sectoralarm.net). The integration does not use any other service.

This integration is not made by, nor endorsed by, Sector Alarm. It uses the same API as the Sector Alarm app, which may change without notice.

Configuration settings​

These are the settings Sector Alarm asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Getting startedsectionNoSector Alarm has no local API: the integration talks to the Sector Alarm cloud with the account of the Sector Alarm app. Fill in its email and password; the panels, locks, smart plugs and sensors of the account then appear in Discovery. The panel code is only needed to disarm, to drive the locks, and to arm a panel whose quick arm is off.
EmailstringYesThe email you sign in to the Sector Alarm app with.
PasswordsecretYesThe password of that Sector Alarm account. It is never written to the logs.
Panel codesecretNoThe code you type on the keypad. Needed to disarm from Gladys, to lock or unlock a door, and to arm a panel whose quick arm is off. Leave it empty and Gladys can only arm (with quick arm on). The dashboard widget never uses it to disarm: it asks for the code every time.
Panel idstringNoLeave empty to follow every panel of the account. To follow only some, type their ids separated by commas: "Test the connection" lists them.
Refresh interval (s)numberNoHow often the Sector Alarm cloud is read, in seconds (30 minimum). Sector Alarm limits the number of requests: below a minute brings little and risks being slowed down.

How to install Sector Alarm in Gladys​

  1. In Gladys, open Integrations: Sector Alarm appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/prohand/gladys-sectoralarm:1.0.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/prohand/gladys-sectoralarm.

Sector Alarm requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Sector Alarm is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by prohand, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂