Skip to main content

Synology Surveillance Station

Local-LAN driver for Synology Surveillance Station, the NVR that ships with DSM on every Synology NAS.

One Surveillance Station instance is the GEM device. Each GEM zone maps to one camera by its Surveillance Station camera id.

Prerequisites

  • Synology DSM 6.2 or newer with Surveillance Station installed.
  • At least one camera licensed and added in Surveillance Station (the bundled licenses on a DSx18+ unit are enough to start).
  • A dedicated DSM user account in the administrators group (or a custom role with full Surveillance Station privileges). Username and password are stored encrypted in GEM.
  • 2-step verification disabled on this account. The driver cannot complete a 2FA login in this release. Use a service account, not a person's account that has 2FA on.

Setup

  1. Add the device. Go to System → Devices, click Add Device (Open Devices), and choose Synology Surveillance Station (synology_surveillance) as the driver.

  2. Fill in the device attributes:

    • ip — LAN address of the NAS (e.g. 192.168.1.50).
    • username — DSM admin account name.
    • password — DSM admin password (stored encrypted).
    • port5000 for HTTP (default), 5001 for HTTPS.
    • protocolhttp (default) or https. HTTPS works against the NAS's own self-signed certificate; no certificate import is needed.

    Save and reload. On a good connection the device comes up Connected and starts polling the camera list every status_interval (default 15 s).

  3. Enumerate cameras. Open the device and run the get_cameras command. The result lists every camera with its integer id (this is what you use as the zone address), display name, connection status, and recording status.

  4. Create one zone per camera. For each camera, add a zone whose Address is the camera's integer id and whose Device is this Synology device. GEM does not create these zones for you — a camera only starts reporting state once a zone bound to this device carries its id.

  5. File the camera zones under the Cameras subsystem. Set each zone's Subsystem to Cameras. The zone editor pre-selects Security for this driver, so change it to Cameras by hand: the camera dashboards, zone-map, and zone-control widgets only recognize a camera when it lives in the Cameras subsystem (and the Active Zones widget deliberately hides that subsystem). Leaving the zones under Security keeps the cameras off the camera surfaces and counts them as active security zones.

  6. Enable external recording (only if you want GEM to record). For any camera you want GEM to start/stop recording on, set that camera's schedule in Surveillance Station to External Recording for the slots you'll control. Without this, start_recording silently no-ops — Surveillance Station ignores external triggers while the schedule is set to Continuous / Motion / Custom.

Attributes

Device

NameRequiredDescription
ipYesLAN address of the NAS.
usernameYesDSM account with Surveillance Station admin privileges.
passwordYesDSM password (stored encrypted).
portNoDSM HTTP/HTTPS port. Default 5000.
protocolNohttp (default) or https.
status_intervalNoHow often (ms) the camera list is polled. Default 15000.

Zone

NameRequiredDescription
addressYesSurveillance Station camera id (integer). Enumerate via get_cameras.

The driver writes the following zone attributes when polling:

AttributeValues
statenormal, disconnected, unavailable, ready_to_view, no_permission, license_not_enough, disabled, unrecognized, setting, server_disconnected, migrating, unauthorized, rtsp_error, no_video (plus a handful of less-common Synology codes). It is unknown when the camera id in the zone address no longer matches any camera in the last poll, and status_<n> for any status code GEM doesn't have a name for.
recordingtrue / false — whether Surveillance Station is currently recording the camera (any mode).
camera_nameSurveillance Station display name.

Commands

CommandArgsNotes
get_camerasList cameras with id, name, status, recording state.
get_snapshotaddressCapture a JPEG snapshot. Returns {data_uri: "data:image/jpeg;base64,…"} for use in UI / macros.
start_recordingaddressStart external recording on the camera. Requires the camera to be in External Recording mode in Surveillance Station.
stop_recordingaddressStop external recording on the camera.
ptz_moveaddress, direction, speedPan/tilt the camera. direction: up, down, left, right, home, up_left, up_right, down_left, down_right. speed: 1-5 (default 3).
ptz_presetaddress, presetRecall a PTZ preset by its id (a non-negative integer). The id is passed straight to the camera — there is no special "home" handling here, so whether 0 is your home position depends on how the camera's presets are numbered. For a guaranteed return-to-home, use ptz_move with direction: home.
arm_home_modeSwitch Surveillance Station Home Mode ON (typically arms motion recording / push).
disarm_home_modeSwitch Home Mode OFF.
get_home_modeRead the current Home Mode state.
get_eventslimitList the most recent recordings. limit defaults to 20, max 200.
get_infoRead the Surveillance Station Info document (version, license count, etc.).

Zone address format

address is the Surveillance Station integer camera id as returned in the id field of get_cameras. Camera ids are NOT the same as DSM device ids and do NOT change when you rename a camera, but they DO change if you remove and re-add a camera in Surveillance Station — re-run get_cameras and update the zone address after any add/remove.

Known limitations

  • No 2FA. The driver cannot complete a DSM login when 2-step verification is enabled on the account. Use a dedicated service account with 2FA off, or wait for a follow-up that handles otp_code.
  • External Recording dependency. start_recording / stop_recording only work when the camera's Surveillance Station schedule is set to External Recording for the slot you trigger on. This is a Surveillance Station design choice, not a driver bug.
  • PTZ preset numbering varies by camera vendor (some firmwares are zero-indexed, some one-indexed). The driver passes the preset id straight through, so confirm which number is your home position on the camera itself. The dedicated home recall is ptz_move with direction: home, which calls the camera's PTZ Home function directly.
  • Snapshot is JPEG only — no MJPEG / H.264 stream is exposed here. Live video stays in Surveillance Station's own player; GEM is for state and snapshot capture today.
  • No event subscription. State changes are detected by polling on status_interval, not push events. Default poll cadence (15 s) is conservative; tighten it if you need faster motion/disconnect detection.
  • Offline detection is command-driven. The device's online/offline status is set when it connects and is only re-evaluated when a command fails. If the NAS drops off the network mid-session, the device can keep showing Connected until you run a command against it; the camera zones simply hold their last polled state until the NAS answers again (the driver re-logs in transparently when it does).

Troubleshooting

SymptomCheck
Login fails (codes 400/401/403/406)DSM account does not have Surveillance Station admin privileges, or 2-step verification is enabled, or the password contains characters that DSM treats specially. Reset the password to ASCII-only and disable 2FA on this account.
get_snapshot returns error: unexpected snapshot responseCamera is in disconnected / unavailable / unrecognized state — check get_cameras and resolve in Surveillance Station first.
start_recording returns success but no clip landsCamera is not in External Recording mode. In Surveillance Station, set the camera schedule to External Recording for the relevant time slots.
Driver re-logs in repeatedlyDSM session may be capped (System > User > Advanced > limit concurrent sessions). Raise the limit or use a dedicated account for GEM.
Sessions expire after ~12 hoursExpected. The driver detects codes 105/106/107/119 and re-authenticates transparently.
Camera zone state stuck on unknownThe camera id in the zone address no longer matches any camera in get_cameras — usually because the camera was removed and re-added in Surveillance Station (which can change its id). Re-run get_cameras and update the zone address.
Camera doesn't appear on a camera dashboard / zone mapThe zone is filed under the wrong subsystem. Edit the zone and set Subsystem to Cameras (the editor pre-selects Security for this driver).
  • Devices — adding and configuring the Synology device.
  • Zones — creating the per-camera zones and binding them to the device.
  • Subsystems — why the Cameras subsystem matters for camera surfaces.
  • Commands — running the commands above from macros and triggers.