Skip to main content

Axis VAPIX (Relay)

Drive the relay / I-O output ports on Axis network cameras, door stations, and standalone I-O modules over the VAPIX HTTP API (/axis-cgi/io/port.cgi). Each Axis unit becomes one GEM device, and each output port you wire — a gate strike, a door strike, a light contactor, a garage operator — becomes one zone whose address is the VAPIX port number.

This is a relay-focused shell of the full Axis VAPIX driver — the same code base, presented with relay-friendly defaults (relay category, gate/door/lights subsystem hints) and kept for upgrade safety on sites provisioned before the Axis drivers were merged. For a new install, use the Axis VAPIX driver instead: it does everything this one does plus PTZ, snapshots, privacy masking, audio, and live door/intercom events, and it is the driver Axis integrations should be built on going forward.

Communication is HTTP or HTTPS to the camera's web port (default 80) using digest authentication.

What this driver controls

  • Relay outputsclose energizes a port, open de-energizes it, and pulse flips it momentarily and releases (the classic "buzz the door / trigger the gate" action).
  • Live state — the driver polls each relay-bound zone and reports whether the contact is energized, so the zone tile reflects the port's real state, not just the last command you sent.

Because this is a thin shell over the shared Axis driver, a device added with it also carries that driver's other commands (PTZ, snapshot, audio, events). Those are harmless to leave unused on a plain I-O module — the relay commands below are the ones you drive. If you actually need those other features, add the unit with the full Axis VAPIX driver and get them documented and supported.

Prerequisites

  • An Axis camera, door station, or I-O module reachable on the LAN, with at least one I-O port configured as an Output in the unit's own web UI. A port left as an Input will not respond to relay commands.
  • A VAPIX account with at least Operator rights.
  • Digest authentication available on the account — modern AXIS OS firmware disables Basic auth by default, and this driver authenticates with digest.
  • The 1-based port number for each relay you plan to drive (Port 1, Port 2, …). These become zone addresses.

Setup

  1. In the camera / I-O module's own web UI, set every port that should drive a relay to Output (not Input), and note its port number. On door stations, an output already labelled Door is the strike relay.
  2. In GEM, open Devices (System → Devices) and click Add Device.
  3. Choose the Axis VAPIX (Relay) driver. GEM shows the matching device fields and a View integration guide link to this page. (For a new deployment, pick Axis VAPIX instead — see above.)
  4. Fill in the device attributes below and Save.
  5. Create one zone per relayOpen Zones, New Zone, bind it to this device, and set its Address to the VAPIX port number for that relay. Put the zone under the subsystem that matches what the relay drives (Gates, Doors, Garages, Lights, …) — the subsystem decides how the contact reads as a logical state (see Subsystem and state). GEM does not create these zones for you.
  6. Command the zone from the Commands page or a quick macro to confirm the relay clicks.
Subsystem placement

The driver hints the Gates, Doors/Access, and Lights subsystems, so the New Zone editor pre-selects one of those. A stock GEM install seeds Gates, Doors, Garages, Lifts, and Lights subsystems, which are the natural homes for the loads a relay drives. Pick the one that matches the wiring — it governs the state mapping below.

Device attributes

AttributeRequiredDefaultDescription
ipyesLAN IP or hostname of the camera / door station / I-O module.
usernameyesVAPIX account (Operator rights).
passwordyesVAPIX account password. Stored encrypted.
portno80Web port of the Axis unit.
protocolnohttphttp or https. Switch to https if the unit requires TLS.
Change the poll rate if you need to

The relay form shows only the five fields above, but the device still polls relay state on the shared Axis driver's schedule — every 3000 ms by default. To slow it down (or speed it up), add a status_interval attribute in milliseconds from the Attribute editor on the device. It is optional; leave it off to keep the 3-second default.

Zone address = VAPIX port

Each zone bound to this device targets one output port. Set the zone's Address to the VAPIX port number1 for Port 1, 2 for Port 2, and so on. On a door station, the strike port that the unit labels Door is auto-discovered at connect and surfaced on the device as a door_relay_port hint, so you can read off which number to use as the zone address without trial and error.

Commands

CommandArgsWhat it does
closeaddressEnergizes the relay — the contact closes / the port goes active.
openaddressDe-energizes the relay — the contact opens / the port goes inactive.
pulseaddress, delayEnergizes the relay, waits delay milliseconds, then releases it. delay defaults to 500 ms if omitted.
get_stateaddressReads the port's active / inactive state and updates the zone.

address is filled from the zone's Address automatically, so when you control the zone you never type the port number by hand. In day-to-day use you rarely call close / open / pulse by name at all: controlling the zone with the ordinary verbs a touchpanel or macro sends — on / off, open / close, lock / unlock — is translated by GEM into the right relay action for that zone's subsystem. Call the raw commands directly only when testing a specific port or scripting an exact sequence in a macro.

Pulse for momentary triggers

pulse is the action for gate operators, garage doors, and door strikes that expect a brief contact rather than a held one. Many operators need more than half a second to register, so if a default pulse does nothing, pass a longer delay — e.g. 3000 for a three-second release.

Subsystem and state

The zone's subsystem decides how the relay's raw contact (energized / de-energized) reads as a logical state on control surfaces:

  • Under Doors / Locks, an energized (closed) contact reads as unlocked.
  • Under Gates / Garages / Lifts, an energized (closed) contact reads as open.
  • Under Lights / Fans / Power, an energized (closed) contact reads as on.

If the relay fires the correct way but the state word is backwards for your wiring (for example it reads "locked" when the strike is actually released), flip the zone's Normally Closed toggle, or set a relay_states override on the zone. The full mapping — including custom subsystems that have no built-in meaning — is covered in Relay semantics.

This driver monitors as well as drives

Unlike a drive-only relay path, the VAPIX relay device polls each relay-bound zone and reports live contact state, so a port toggled on the hardware (a wired input, the camera's own action rules, or another controller) is reflected back in GEM. Polling only runs for zones under a relay-mapped subsystem (Gates, Doors, Lights, …); a camera or PTZ zone on the same device is skipped.

Troubleshooting

SymptomCheck
Relay command returns 200 / no error but the relay does not clickConfirm the I-O port is set to Output in the unit's web UI, and that nothing else (the camera's rule / action engine, another controller) is driving the same port.
Commands return 401 UnauthorizedThe VAPIX account lacks Operator rights, or digest auth failed (wrong password, or a Basic-only account on firmware that requires digest). Re-enter the username / password on the device. Test with curl --digest -u user:pass "http://<ip>/axis-cgi/io/port.cgi?check=1".
The zone state word is backwards for the wiringThe zone's subsystem or mapping. Flip the zone's Normally Closed toggle, or set a relay_states override — see Relay semantics.
A pulse does nothing on a gate / garage operatorThe pulse is too short. Pass a longer delay (e.g. 3000 ms) so the contact holds long enough for the operator to register.
The device also lists PTZ / snapshot / audio commands you don't wantExpected — this shell carries the full Axis command set. Ignore them on a plain relay/I-O unit, or (better for a real camera) add the unit with the full Axis VAPIX driver.
  • Axis VAPIX — the full Axis driver this shell is a subset of; use it for new installs and for PTZ, snapshots, privacy, audio, and live door/intercom events.
  • Axis VAPIX (PTZ) — the equivalent movement-focused shell for pan/tilt/zoom cameras.
  • Generic Relay — modelling a single relay channel on a non-Axis controller as its own device.
  • Devices — adding and configuring the Axis device row.
  • Zones — binding a zone per port and setting its Address and subsystem.
  • Subsystems — where each relay zone lives and how its default state mapping is chosen.
  • Commands — running close / open / pulse and how zone verbs route to them.
  • Relay semantics — how relay open/closed maps to on/off, locked/unlocked, and open/closed across subsystems.