Teqlogy API / PowerMatrix-8

PowerMatrix-8

8-channel smart relay controller. Switch eight loads from your own code: relays on and off, auto-off timers, weekly automations, scenes and IR remote codes — over REST or live over a WebSocket.

Any key a read-only key and a full key may call it Full key only a full key only

Models

The type field of a device tells which one it is. Everything on this page applies to all of them unless an endpoint says otherwise.

typeWhat it is
PowerMatrix-8The production controller: 8 relays, physical buttons, IR receiver and transmitter.
PowerMatrix-8-betaThe beta-firmware build of the same controller. Same API, same device object.

The device object

Every endpoint that returns a device returns this object (also inside GET /api/devices/me and in the WebSocket deviceUpdated event). A key never sees the public IP address of a device or its internal settings.

Every device
_id
stringDatabase id of the device record.
deviceId
stringThe hardware id. Use it in every path (:deviceId).
userId
stringId of the account that owns the device.
name
stringThe name shown in the apps. Change it with PATCH …/preferences.
type
stringThe exact model, see the variants table.
model
stringModel text reported by the device.
firmware
stringFirmware version, e.g. 1.0.14.
status
booleantrue while the device is connected right now (online).
lastSeen
ISO dateWhen the device last reported.
rssi
number | nullWi-Fi signal in dBm (a negative number, closer to 0 is better). null / absent when the firmware does not report it.
reconnectCount
numberHow many times the device has reconnected.
uptimeSince
ISO date | nullWhen the current connection started.
createdAt / updatedAt
ISO dateWhen the record was created / last changed.
relays
number[]Output states, 1 = ON, 0 = OFF.
config
objectSettings stored for the device — see the table of this device family.
relays has 8 entries: index 0 is relay 1, index 7 is relay 8.
config (PowerMatrix-8)
relayMeta
object[]Name and icon of each relay: { index, name, icon }.
automations
object[]Weekly and one-shot automations (see PATCH …/preferences).
irCodes
object[]Saved IR codes: { id, relayIndex, code, name }.
relayTimers
object[]Pending auto-off timers: { relayIndex, expiresAt }.
scenes
object[]Scenes saved by the Teqlogy apps (free-form JSON, up to 50).
json · PowerMatrix-8
{
  "_id": "65f1a2b3c4d5e6f708192a10",
  "userId": "65f1a2b3c4d5e6f708192a01",
  "deviceId": "aabbcc112233",
  "name": "Living Room",
  "type": "PowerMatrix-8",
  "model": "PowerMatrix",
  "firmware": "1.0.14",
  "status": true,
  "rssi": -62,
  "relays": [1, 0, 1, 0, 0, 0, 0, 0],
  "config": {
    "relayMeta": [
      { "index": 0, "name": "Main Light", "icon": "light_ceiling" },
      { "index": 1, "name": "Fan", "icon": "fan" }
    ],
    "automations": [
      {
        "id": "auto_001",
        "name": "Morning Lights",
        "enabled": true,
        "relayIndex": 0,
        "targetState": "ON",
        "kind": "weekly",
        "time": "07:00",
        "days": [1, 2, 3, 4, 5],
        "timezoneOffsetMinutes": 300,
        "lastRunKey": null,
        "lastRunAt": null,
        "lastError": null
      }
    ],
    "irCodes": [
      {
        "id": "ir_abc123",
        "relayIndex": 0,
        "code": "F30CFF00",
        "name": "TV Power"
      }
    ],
    "relayTimers": [],
    "billRate": 0,
    "scenes": []
  },
  "lastSeen": "2026-10-03T14:20:00.000Z",
  "reconnectCount": 3,
  "uptimeSince": "2026-10-01T08:00:00.000Z",
  "createdAt": "2026-08-01T10:00:00.000Z",
  "updatedAt": "2026-10-03T14:20:00.000Z"
}

Endpoints

20 endpoints work with PowerMatrix-8. All of them take the base URL https://teqhome.teqlogy.com and your key in the Authorization header.

Devices
GET/devices/me Any key
GET/devices/d/:deviceId Any key
GET/devices/shared-with-me Any key
Control
POST/devices/:deviceId/relay Full key only
POST/devices/:deviceId/relay-timer Full key only
DELETE/devices/:deviceId/relay-timer/:relayIndex Full key only
POST/devices/:deviceId/ir/learn Full key only
POST/devices/:deviceId/ir/save Full key only
DELETE/devices/:deviceId/ir/:irId Full key only
Settings
PATCH/devices/:deviceId/preferences Full key only
History
GET/relay-logs/:deviceId Any key
GET/relay-logs/:deviceId/analytics Any key
Notifications
GET/notifications Any key
PATCH/notifications/:id/read Full key only
PATCH/notifications/read-all Full key only
DELETE/notifications/:id Full key only
Away Mode
GET/user/away-mode Any key
POST/user/away-mode/enable Full key only
POST/user/away-mode/disable Full key only
Real time
POST/ws-ticket Any key

Devices

List your devices and read their state.

GET/api/devices/me Any key

List your devices

Every device you own, most recently active first. Devices that other people shared with you are not in this list — see “Devices shared with you”.

  • The objects differ by device family: PowerMatrix-8 devices carry relays and config, EnergyMate devices carry meters and readings. Use type to tell them apart.
Request
bash
curl "https://teqhome.teqlogy.com/api/devices/me" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{
  "ok": true,
  "devices": [
    {
      "_id": "65f1a2b3c4d5e6f708192a11",
      "userId": "65f1a2b3c4d5e6f708192a01",
      "deviceId": "ddeeff445566",
      "name": "Main Panel",
      "type": "EnergyMate-3X",
      "model": "Teqlogy SmartDevice",
      "firmware": "1.0.0",
      "status": true,
      "rssi": -58,
      "relays": [1, 0, 0, 1, 0, 0],
      "voltage": 231.4,
      "current": 4.2,
      "power": 950.1,
      "energy": 12.345,
      "frequency": 50,
      "pf": 0.98,
      "voltMin": 190,
      "voltMax": 240,
      "meters": [
        {
          "index": 1,
          "voltage": 231.4,
          "current": 4.2,
          "power": 950.1,
          "energy": 4.25,
          "sessionEnergy": 1.25,
          "frequency": 50,
          "pf": 0.98,
          "limit": 10,
          "lifetimeWh": 152250,
          "off": false
        },
        {
          "index": 2,
          "voltage": 0,
          "current": 0,
          "power": 0,
          "energy": 6.5,
          "sessionEnergy": 0,
          "frequency": 0,
          "pf": 0,
          "limit": 10,
          "lifetimeWh": 210002,
          "off": true
        },
        {
          "index": 3,
          "voltage": 0,
          "current": 0,
          "power": 0,
          "energy": 0,
          "sessionEnergy": 0,
          "frequency": 0,
          "pf": 0,
          "limit": 10,
          "lifetimeWh": 0,
          "off": false
        }
      ],
      "counterEpoch": 2864434397,
      "ampMax": 16,
      "ampTrip": 0,
      "config": {
        "billRate": 12.5,
        "alertThresholds": {
          "maxPower": 5000,
          "maxCurrent": 25,
          "maxVoltage": 240,
          "minVoltage": 190
        }
      },
      "lastSeen": "2026-10-03T14:20:05.000Z",
      "reconnectCount": 5,
      "uptimeSince": "2026-10-02T06:00:00.000Z",
      "createdAt": "2026-08-05T10:00:00.000Z",
      "updatedAt": "2026-10-03T14:20:05.000Z"
    },
    {
      "_id": "65f1a2b3c4d5e6f708192a10",
      "userId": "65f1a2b3c4d5e6f708192a01",
      "deviceId": "aabbcc112233",
      "name": "Living Room",
      "type": "PowerMatrix-8",
      "model": "PowerMatrix",
      "firmware": "1.0.14",
      "status": true,
      "rssi": -62,
      "relays": [1, 0, 1, 0, 0, 0, 0, 0],
      "config": {
        "relayMeta": [
          { "index": 0, "name": "Main Light", "icon": "light_ceiling" },
          { "index": 1, "name": "Fan", "icon": "fan" }
        ],
        "automations": [
          {
            "id": "auto_001",
            "name": "Morning Lights",
            "enabled": true,
            "relayIndex": 0,
            "targetState": "ON",
            "kind": "weekly",
            "time": "07:00",
            "days": [1, 2, 3, 4, 5],
            "timezoneOffsetMinutes": 300,
            "lastRunKey": null,
            "lastRunAt": null,
            "lastError": null
          }
        ],
        "irCodes": [
          {
            "id": "ir_abc123",
            "relayIndex": 0,
            "code": "F30CFF00",
            "name": "TV Power"
          }
        ],
        "relayTimers": [],
        "billRate": 0,
        "scenes": []
      },
      "lastSeen": "2026-10-03T14:20:00.000Z",
      "reconnectCount": 3,
      "uptimeSince": "2026-10-01T08:00:00.000Z",
      "createdAt": "2026-08-01T10:00:00.000Z",
      "updatedAt": "2026-10-03T14:20:00.000Z"
    }
  ]
}
GET/api/devices/d/:deviceId Any key

Get one device

The full current state of one device: online or not, relays or meters, readings, settings.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
  • Owner, or a device shared with you (view or control), or a dealer assignment.
  • The answer is the same object as in the list. A key never sees the device’s public IP address or internal settings.
Request
bash
curl "https://teqhome.teqlogy.com/api/devices/d/aabbcc112233" \
  -H "Authorization: Bearer $KEY"
Response 200PowerMatrix-8
json
{
  "ok": true,
  "device": {
    "_id": "65f1a2b3c4d5e6f708192a10",
    "userId": "65f1a2b3c4d5e6f708192a01",
    "deviceId": "aabbcc112233",
    "name": "Living Room",
    "type": "PowerMatrix-8",
    "model": "PowerMatrix",
    "firmware": "1.0.14",
    "status": true,
    "rssi": -62,
    "relays": [1, 0, 1, 0, 0, 0, 0, 0],
    "config": {
      "relayMeta": [
        { "index": 0, "name": "Main Light", "icon": "light_ceiling" },
        { "index": 1, "name": "Fan", "icon": "fan" }
      ],
      "automations": [
        {
          "id": "auto_001",
          "name": "Morning Lights",
          "enabled": true,
          "relayIndex": 0,
          "targetState": "ON",
          "kind": "weekly",
          "time": "07:00",
          "days": [1, 2, 3, 4, 5],
          "timezoneOffsetMinutes": 300,
          "lastRunKey": null,
          "lastRunAt": null,
          "lastError": null
        }
      ],
      "irCodes": [
        {
          "id": "ir_abc123",
          "relayIndex": 0,
          "code": "F30CFF00",
          "name": "TV Power"
        }
      ],
      "relayTimers": [],
      "billRate": 0,
      "scenes": []
    },
    "lastSeen": "2026-10-03T14:20:00.000Z",
    "reconnectCount": 3,
    "uptimeSince": "2026-10-01T08:00:00.000Z",
    "createdAt": "2026-08-01T10:00:00.000Z",
    "updatedAt": "2026-10-03T14:20:00.000Z"
  }
}
200 · EnergyMate-3X
json
{
  "ok": true,
  "device": {
    "_id": "65f1a2b3c4d5e6f708192a11",
    "userId": "65f1a2b3c4d5e6f708192a01",
    "deviceId": "ddeeff445566",
    "name": "Main Panel",
    "type": "EnergyMate-3X",
    "model": "Teqlogy SmartDevice",
    "firmware": "1.0.0",
    "status": true,
    "rssi": -58,
    "relays": [1, 0, 0, 1, 0, 0],
    "voltage": 231.4,
    "current": 4.2,
    "power": 950.1,
    "energy": 12.345,
    "frequency": 50,
    "pf": 0.98,
    "voltMin": 190,
    "voltMax": 240,
    "meters": [
      {
        "index": 1,
        "voltage": 231.4,
        "current": 4.2,
        "power": 950.1,
        "energy": 4.25,
        "sessionEnergy": 1.25,
        "frequency": 50,
        "pf": 0.98,
        "limit": 10,
        "lifetimeWh": 152250,
        "off": false
      },
      {
        "index": 2,
        "voltage": 0,
        "current": 0,
        "power": 0,
        "energy": 6.5,
        "sessionEnergy": 0,
        "frequency": 0,
        "pf": 0,
        "limit": 10,
        "lifetimeWh": 210002,
        "off": true
      },
      {
        "index": 3,
        "voltage": 0,
        "current": 0,
        "power": 0,
        "energy": 0,
        "sessionEnergy": 0,
        "frequency": 0,
        "pf": 0,
        "limit": 10,
        "lifetimeWh": 0,
        "off": false
      }
    ],
    "counterEpoch": 2864434397,
    "ampMax": 16,
    "ampTrip": 0,
    "config": {
      "billRate": 12.5,
      "alertThresholds": {
        "maxPower": 5000,
        "maxCurrent": 25,
        "maxVoltage": 240,
        "minVoltage": 190
      }
    },
    "lastSeen": "2026-10-03T14:20:05.000Z",
    "reconnectCount": 5,
    "uptimeSince": "2026-10-02T06:00:00.000Z",
    "createdAt": "2026-08-05T10:00:00.000Z",
    "updatedAt": "2026-10-03T14:20:05.000Z"
  }
}
Errors of this endpoint
StatuscodeWhen
404message onlyThe device does not exist or is not yours — { ok: false, message: "Device not found" }
GET/api/devices/shared-with-me Any key

Devices shared with you

Devices other people shared with you. Each one is a device object plus what your share allows.

  • _access is "control" (you may change things) or "view" (read only). Shares that have expired are not listed.
  • _sharedByUserId is the account that shared the device with you.
Request
bash
curl "https://teqhome.teqlogy.com/api/devices/shared-with-me" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{
  "ok": true,
  "devices": [
    {
      "_id": "65f1a2b3c4d5e6f708192a12",
      "deviceId": "eeff00112233",
      "userId": "65f1a2b3c4d5e6f708192a02",
      "name": "Garage",
      "type": "PowerMatrix-8",
      "firmware": "1.0.14",
      "status": true,
      "relays": [0, 0, 0, 0, 0, 0, 0, 0],
      "config": {
        "relayMeta": []
      },
      "createdAt": "2026-09-01T10:00:00.000Z",
      "updatedAt": "2026-10-02T10:00:00.000Z",
      "_shareId": "65f1a2b3c4d5e6f708192a13",
      "_access": "control",
      "_sharedByUserId": "65f1a2b3c4d5e6f708192a02"
    }
  ]
}

Control

Switch things and set timers.

POST/api/devices/:deviceId/relay Full key only

Switch a relay

Turn one relay ON or OFF. The command is sent to the device over its live connection, so the device must be online.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
Request body (JSON)
relayrequired
integerWhich relay: 0–7 (relay 1 = 0 … relay 8 = 7).
staterequired
booleantrue = ON, false = OFF.
  • Owner, or a device shared with you with control access, or a dealer assignment. A view-only share is refused.
  • The answer means “the command was sent”, not “the relay has switched”. To confirm, listen for the telemetryUpdate event on the WebSocket, or read the device again.
  • While the owner’s Away Mode covers the device, turning a relay ON is refused with 403 AWAY_MODE_ACTIVE. Turning OFF always works.
Request
bash
curl -X POST "https://teqhome.teqlogy.com/api/devices/aabbcc112233/relay" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"relay":0,"state":true}'
Response 200
json
{ "ok": true }
Errors of this endpoint
StatuscodeWhen
400RELAY_INDEX_INVALIDrelay is not a non-negative integer
403API_KEY_READONLYA read-only key was used
403DEVICE_ACCESS_DENIEDThe device is shared with you as view-only
403AWAY_MODE_ACTIVEstate is true while Away Mode is on for the device
404DEVICE_NOT_FOUNDThe device does not exist or is not yours (the answer is the same)
503DEVICE_OFFLINEThe device is not connected
POST/api/devices/:deviceId/relay-timer Full key only

Set an auto-off timer

Turn a relay OFF automatically after a number of seconds. A new timer for the same relay replaces the old one.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
Request body (JSON)
relayIndexrequired
integerWhich relay: 0–7. Must be a JSON number.
secondsrequired
integerDelay in seconds, 1 to 86400 (24 hours).
  • Owner, or a device shared with you with control access, or a dealer assignment. A view-only share is refused.
  • The timer lives on our servers, not on the device, and is checked every 30 seconds — it can fire up to 30 seconds late. If the device is offline at that moment the OFF command is not delivered.
  • The timer only turns a relay OFF. Turn the relay ON yourself (POST …/relay) and set the timer afterwards.
Request
bash
curl -X POST "https://teqhome.teqlogy.com/api/devices/aabbcc112233/relay-timer" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"relayIndex":2,"seconds":1800}'
Response 200
json
{
  "ok": true,
  "relayIndex": 2,
  "expiresAt": "2026-10-04T06:00:00.000Z",
  "secondsRemaining": 1800
}
Errors of this endpoint
StatuscodeWhen
400message onlyrelayIndex is not a number, or seconds is outside 1–86400 — { ok: false, message }
403API_KEY_READONLYA read-only key was used
403message onlyThe device is not yours and not shared with you with control — { ok: false, message: "Access denied" }
DELETE/api/devices/:deviceId/relay-timer/:relayIndex Full key only

Cancel an auto-off timer

Cancel the pending auto-off timer of one relay.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
relayIndexrequired
integerThe relay: 0–7.
  • Owner, or a device shared with you with control access, or a dealer assignment. A view-only share is refused.
  • cancelled is false when there was no timer for that relay.
Request
bash
curl -X DELETE "https://teqhome.teqlogy.com/api/devices/aabbcc112233/relay-timer/2" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{ "ok": true, "relayIndex": 2, "cancelled": true }
Errors of this endpoint
StatuscodeWhen
403API_KEY_READONLYA read-only key was used
403message onlyNo access to the device — { ok: false, message: "Access denied" }
POST/api/devices/:deviceId/ir/learn Full key only

Start IR learning

Put the device in IR learn mode: point a remote at it and press a button. The captured code arrives as an irLearned event on the WebSocket.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
Request body (JSON)
relay
integerThe relay the code will belong to, 0–15. Default 0.
  • Owner, or a device shared with you with control access, or a dealer assignment. A view-only share is refused.
  • This call only starts the learning. Open the WebSocket first (see Real time) to receive { type: "irLearned", deviceId, relay, code }, then store the code with POST …/ir/save.
  • Learn mode ends when the device disconnects.
Request
bash
curl -X POST "https://teqhome.teqlogy.com/api/devices/aabbcc112233/ir/learn" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"relay":0}'
Response 200
json
{
  "ok": true,
  "waiting": true,
  "message": "Point your remote at the device and press a button."
}
Errors of this endpoint
StatuscodeWhen
400message onlyrelay is not an integer 0–15 — { ok: false, message: "Invalid relay index" }
403API_KEY_READONLYA read-only key was used
403message onlyThe device is shared with you as view-only — { ok: false, message: "View-only access …" }
404message onlyThe device does not exist or is not yours — { ok: false, message: "Device not found" }
503message onlyThe device is offline — { ok: false, message: "Device is offline" }
POST/api/devices/:deviceId/ir/save Full key only

Save an IR code

Store an IR code for a relay. The device keeps its own copy, so the remote keeps working when the internet is down.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
Request body (JSON)
relay
integerThe relay the code switches, 0–7. Default 0.
coderequired
stringThe code as a hex string of 1–16 characters, for example F30CFF00.
name
stringA label, up to 40 characters. Default "IR Code".
  • Owner, or a device shared with you with control access, or a dealer assignment. A view-only share is refused.
  • A device holds up to 32 codes. Saving the same relay and code again only changes its name.
Request
bash
curl -X POST "https://teqhome.teqlogy.com/api/devices/aabbcc112233/ir/save" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"relay":1,"code":"E0E040BF","name":"Fan toggle"}'
Response 200
json
{
  "ok": true,
  "irEntry": {
    "id": "8bae703eb2431aa0",
    "relayIndex": 1,
    "code": "E0E040BF",
    "name": "Fan toggle"
  },
  "irCodes": [
    {
      "id": "ir_abc123",
      "relayIndex": 0,
      "code": "F30CFF00",
      "name": "TV Power"
    },
    {
      "id": "8bae703eb2431aa0",
      "relayIndex": 1,
      "code": "E0E040BF",
      "name": "Fan toggle"
    }
  ]
}
Errors of this endpoint
StatuscodeWhen
400message onlycode missing or not hex, relay outside 0–7, or 32 codes already stored — { ok: false, message }
403API_KEY_READONLYA read-only key was used
403message onlyThe device is shared with you as view-only — { ok: false, message: "View-only access …" }
404message onlyThe device does not exist or is not yours — { ok: false, message: "Device not found" }
DELETE/api/devices/:deviceId/ir/:irId Full key only

Delete an IR code

Remove a saved IR code. The device drops its copy too.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
irIdrequired
stringThe id of the code: config.irCodes[].id.
  • Owner, or a device shared with you with control access, or a dealer assignment. A view-only share is refused.
  • Deleting an id that does not exist is not an error: the list simply comes back unchanged.
Request
bash
curl -X DELETE "https://teqhome.teqlogy.com/api/devices/aabbcc112233/ir/8bae703eb2431aa0" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{
  "ok": true,
  "irCodes": [
    {
      "id": "ir_abc123",
      "relayIndex": 0,
      "code": "F30CFF00",
      "name": "TV Power"
    }
  ]
}
Errors of this endpoint
StatuscodeWhen
403API_KEY_READONLYA read-only key was used
403message onlyThe device is shared with you as view-only — { ok: false, message: "View-only access …" }
404message onlyThe device does not exist or is not yours — { ok: false, message: "Device not found" }

Settings

Rename a device and change its settings.

PATCH/api/devices/:deviceId/preferences Full key only

Change device settings

Rename the device and change its settings. Send only the fields you want to change; everything else stays as it is.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
Request body (JSON)
name
stringDevice name, up to 60 characters.
relayMeta
object[]PowerMatrix-8. Names and icons of the relays: [{ index, name, icon }]. name up to 40 characters; icon must be one of the icons listed on the PowerMatrix-8 page (anything else becomes "power"). Replaces the whole list.
automations
object[]PowerMatrix-8. Weekly and one-shot automations, see the schema on the PowerMatrix-8 page. Replaces the whole list: send every automation you want to keep. Entries that are not valid are dropped.
scenes
object[]PowerMatrix-8. Free-form scene objects, up to 50 (the Teqlogy apps store theirs here). Replaces the whole list.
billRate
numberEnergyMate. Price per kWh, 0 or more, two decimals.
alertThresholds
objectEnergyMate. { maxPower ≤ 99999, maxCurrent ≤ 9999, maxVoltage ≤ 999, minVoltage ≤ 999 }. Values outside the range are ignored. Replaces the previous thresholds.
  • Owner, or a device shared with you with control access, or a dealer assignment. A view-only share is refused.
  • Everybody who watches the device on a WebSocket gets a deviceUpdated event with the new device object.
Request
bash
curl -X PATCH "https://teqhome.teqlogy.com/api/devices/aabbcc112233/preferences" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Living Room Lights",
    "relayMeta": [
      { "index": 0, "name": "Ceiling Light", "icon": "light_ceiling" },
      { "index": 1, "name": "Fan", "icon": "fan" }
    ]
  }'
Response 200PowerMatrix-8
json
{
  "ok": true,
  "device": {
    "_id": "65f1a2b3c4d5e6f708192a10",
    "userId": "65f1a2b3c4d5e6f708192a01",
    "deviceId": "aabbcc112233",
    "name": "Living Room Lights",
    "type": "PowerMatrix-8",
    "model": "PowerMatrix",
    "firmware": "1.0.14",
    "status": true,
    "rssi": -62,
    "relays": [1, 0, 1, 0, 0, 0, 0, 0],
    "config": {
      "relayMeta": [
        { "index": 0, "name": "Ceiling Light", "icon": "light_ceiling" },
        { "index": 1, "name": "Fan", "icon": "fan" }
      ],
      "automations": [
        {
          "id": "auto_001",
          "name": "Morning Lights",
          "enabled": true,
          "relayIndex": 0,
          "targetState": "ON",
          "kind": "weekly",
          "time": "07:00",
          "days": [1, 2, 3, 4, 5],
          "timezoneOffsetMinutes": 300,
          "lastRunKey": null,
          "lastRunAt": null,
          "lastError": null
        }
      ],
      "irCodes": [
        {
          "id": "ir_abc123",
          "relayIndex": 0,
          "code": "F30CFF00",
          "name": "TV Power"
        }
      ],
      "relayTimers": [],
      "billRate": 0,
      "scenes": []
    },
    "lastSeen": "2026-10-03T14:20:00.000Z",
    "reconnectCount": 3,
    "uptimeSince": "2026-10-01T08:00:00.000Z",
    "createdAt": "2026-08-01T10:00:00.000Z",
    "updatedAt": "2026-10-03T14:20:00.000Z"
  }
}
200 · EnergyMate: { "billRate": 14.5, "alertThresholds": { "maxPower": 5000, "maxCurrent": 25, "maxVoltage": 245, "minVoltage": 195 } }
json
{
  "ok": true,
  "device": {
    "_id": "65f1a2b3c4d5e6f708192a11",
    "userId": "65f1a2b3c4d5e6f708192a01",
    "deviceId": "ddeeff445566",
    "name": "Main Panel",
    "type": "EnergyMate-3X",
    "model": "Teqlogy SmartDevice",
    "firmware": "1.0.0",
    "status": true,
    "rssi": -58,
    "relays": [1, 0, 0, 1, 0, 0],
    "voltage": 231.4,
    "current": 4.2,
    "power": 950.1,
    "energy": 12.345,
    "frequency": 50,
    "pf": 0.98,
    "voltMin": 190,
    "voltMax": 240,
    "meters": [
      {
        "index": 1,
        "voltage": 231.4,
        "current": 4.2,
        "power": 950.1,
        "energy": 4.25,
        "sessionEnergy": 1.25,
        "frequency": 50,
        "pf": 0.98,
        "limit": 10,
        "lifetimeWh": 152250,
        "off": false
      },
      {
        "index": 2,
        "voltage": 0,
        "current": 0,
        "power": 0,
        "energy": 6.5,
        "sessionEnergy": 0,
        "frequency": 0,
        "pf": 0,
        "limit": 10,
        "lifetimeWh": 210002,
        "off": true
      },
      {
        "index": 3,
        "voltage": 0,
        "current": 0,
        "power": 0,
        "energy": 0,
        "sessionEnergy": 0,
        "frequency": 0,
        "pf": 0,
        "limit": 10,
        "lifetimeWh": 0,
        "off": false
      }
    ],
    "counterEpoch": 2864434397,
    "ampMax": 16,
    "ampTrip": 0,
    "config": {
      "billRate": 14.5,
      "alertThresholds": {
        "maxPower": 5000,
        "maxCurrent": 25,
        "maxVoltage": 245,
        "minVoltage": 195
      }
    },
    "lastSeen": "2026-10-03T14:20:05.000Z",
    "reconnectCount": 5,
    "uptimeSince": "2026-10-02T06:00:00.000Z",
    "createdAt": "2026-08-05T10:00:00.000Z",
    "updatedAt": "2026-10-03T14:20:05.000Z"
  }
}
Errors of this endpoint
StatuscodeWhen
403API_KEY_READONLYA read-only key was used
403message onlyThe device is shared with you as view-only — { ok: false, message: "View-only access …" }
404message onlyThe device does not exist or is not yours — { ok: false, message: "Device not found" }

History

What happened before.

GET/api/relay-logs/:deviceId Any key

Relay history

Who or what switched a relay, newest first. Entries are kept for 30 days.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
Query parameters
limit
integerHow many entries, default 100, at most 500.
relayIndex
integerOnly this relay (0–7).
  • Owner, or a device shared with you (view or control), or a dealer assignment.
  • source: app (the Teqlogy apps and any WebSocket command), web (the REST API: the dashboard and API keys), automation (a weekly or one-shot automation), schedule (an auto-off timer), admin.
  • triggeredBy is the id of the account, the name of the automation, or "relay-timer".
Request
bash
curl "https://teqhome.teqlogy.com/api/relay-logs/aabbcc112233?limit=20&relayIndex=0" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{
  "ok": true,
  "logs": [
    {
      "_id": "65f1a2b3c4d5e6f708192a20",
      "deviceId": "aabbcc112233",
      "userId": "65f1a2b3c4d5e6f708192a01",
      "relayIndex": 0,
      "state": "ON",
      "source": "web",
      "triggeredBy": "65f1a2b3c4d5e6f708192a01",
      "createdAt": "2026-10-03T14:20:00.000Z",
      "updatedAt": "2026-10-03T14:20:00.000Z"
    },
    {
      "_id": "65f1a2b3c4d5e6f708192a21",
      "deviceId": "aabbcc112233",
      "userId": "65f1a2b3c4d5e6f708192a01",
      "relayIndex": 2,
      "state": "OFF",
      "source": "schedule",
      "triggeredBy": "relay-timer",
      "createdAt": "2026-10-03T13:00:00.000Z",
      "updatedAt": "2026-10-03T13:00:00.000Z"
    }
  ]
}
Errors of this endpoint
StatuscodeWhen
404message onlyThe device does not exist or is not yours — { ok: false, message: "Device not found" }
GET/api/relay-logs/:deviceId/analytics Any key

Relay statistics

How often each relay was switched in the last days, and when the last switch happened.

Path parameters
deviceIdrequired
stringThe hardware id of the device (the deviceId of the device object).
Query parameters
days
integerHow many days to count, default 30, at most 90 (logs are kept for 30 days).
  • Owner, or a device shared with you (view or control), or a dealer assignment.
  • perRelay is sorted with the busiest relay first; _id is the relay index.
Request
bash
curl "https://teqhome.teqlogy.com/api/relay-logs/aabbcc112233/analytics?days=30" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{
  "ok": true,
  "days": 30,
  "perRelay": [
    {
      "_id": 0,
      "total": 14,
      "onCount": 7,
      "offCount": 7,
      "lastToggle": "2026-10-03T14:20:00.000Z"
    }
  ],
  "lastToggle": "2026-10-03T14:20:00.000Z"
}
Errors of this endpoint
StatuscodeWhen
404message onlyThe device does not exist or is not yours — { ok: false, message: "Device not found" }

Notifications

The notification list of your account.

GET/api/notifications Any key

List notifications

Your latest 50 notifications, newest first: devices going online or offline, alerts, quotas, resets, schedules, Away Mode.

  • type tells what happened. Known types: device_online, device_offline, alert_threshold, voltage_event, meter_limit, meter_reset, meter_reset_skipped, amp_protection, meter_off, meter_on, meter_on_failed, meter_off_skipped, away_mode, away_alert.
  • readAt is null while unread. meta carries the details of the event (it depends on the type). Notifications are kept for 90 days.
Request
bash
curl "https://teqhome.teqlogy.com/api/notifications" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{
  "ok": true,
  "notifications": [
    {
      "_id": "65f1a2b3c4d5e6f708192a70",
      "userId": "65f1a2b3c4d5e6f708192a01",
      "deviceId": "ddeeff445566",
      "type": "meter_limit",
      "title": "⚡ Main Panel — Meter 1 Limit Reached",
      "body": "Meter 1 hit its 10.0 kWh limit.",
      "meta": { "meterIndex": 0, "limit": 10 },
      "readAt": null,
      "createdAt": "2026-10-03T12:00:00.000Z",
      "updatedAt": "2026-10-03T12:00:00.000Z"
    }
  ]
}
PATCH/api/notifications/:id/read Full key only

Mark one notification as read

Mark one of your notifications as read.

Path parameters
idrequired
stringThe notification id: notifications[]._id.
  • An id that is not yours (or does not exist) changes nothing and still answers { ok: true }.
Request
bash
curl -X PATCH "https://teqhome.teqlogy.com/api/notifications/65f1a2b3c4d5e6f708192a70/read" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200
json
{ "ok": true }
PATCH/api/notifications/read-all Full key only

Mark all notifications as read

Mark every unread notification of yours as read.

Request
bash
curl -X PATCH "https://teqhome.teqlogy.com/api/notifications/read-all" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200
json
{ "ok": true }
DELETE/api/notifications/:id Full key only

Delete a notification

Delete one of your notifications.

Path parameters
idrequired
stringThe notification id.
Request
bash
curl -X DELETE "https://teqhome.teqlogy.com/api/notifications/65f1a2b3c4d5e6f708192a70" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{ "ok": true }

Away Mode

Lock everything OFF while you are away.

GET/api/user/away-mode Any key

Away Mode status

Whether your Away Mode is on, since when, and for which devices.

  • While Away Mode covers a device, turning anything ON is blocked: relays (REST and WebSocket), switching a meter, restarting amp protection, and physical buttons are switched back off. Turning OFF always works.
Request
bash
curl "https://teqhome.teqlogy.com/api/user/away-mode" \
  -H "Authorization: Bearer $KEY"
Response 200
json
{
  "ok": true,
  "awayMode": {
    "enabled": true,
    "deviceIds": ["aabbcc112233", "ddeeff445566"],
    "enabledAt": "2026-10-04T05:30:00.000Z"
  }
}
POST/api/user/away-mode/enable Full key only

Turn Away Mode on

Secure the listed devices: every relay is switched OFF (PowerMatrix-8) or the meters are stopped (EnergyMate) and nothing can be switched ON until Away Mode is turned off.

Request body (JSON)
deviceIdsrequired
string[]The devices, 1 to 100. Only devices you may control are used.
  • Devices that are not yours to control are ignored: they are listed in skipped and look exactly like ids that do not exist. If none of the ids is yours, the answer is 404 DEVICE_NOT_FOUND.
  • sent is true when the device was online and the command was delivered. A device that is offline is secured too: the lock applies as soon as it is back.
Request
bash
curl -X POST "https://teqhome.teqlogy.com/api/user/away-mode/enable" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"deviceIds":["aabbcc112233","ddeeff445566"]}'
Response 200
json
{
  "ok": true,
  "results": [
    { "deviceId": "aabbcc112233", "sent": true },
    { "deviceId": "ddeeff445566", "sent": true }
  ],
  "skipped": []
}
Errors of this endpoint
StatuscodeWhen
400message onlydeviceIds is missing, empty, longer than 100, or not a list of text ids — { ok: false, message }
403API_KEY_READONLYA read-only key was used
404DEVICE_NOT_FOUNDThe device does not exist or is not yours (the answer is the same)
POST/api/user/away-mode/disable Full key only

Turn Away Mode off

Unlock the devices. EnergyMate meters resume their sequence; PowerMatrix-8 relays stay as they are, you switch them ON yourself.

Request
bash
curl -X POST "https://teqhome.teqlogy.com/api/user/away-mode/disable" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200
json
{ "ok": true }
Errors of this endpoint
StatuscodeWhen
403API_KEY_READONLYA read-only key was used

Real time

Open the WebSocket.

POST/api/ws-ticket Any key

Get a WebSocket ticket

Exchange your key for a one-time ticket that opens the live WebSocket. A read-only key gets a socket that only listens.

  • The ticket is valid for 30 seconds and works once. Ask for a new one every time you open a connection.
  • The socket keeps the level of the key that made the ticket: a read-only key receives every event but may send nothing; a full key may send the commands listed under WebSocket.
Request
bash
curl -X POST "https://teqhome.teqlogy.com/api/ws-ticket" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200
json
{
  "ok": true,
  "ticket": "b95488af-59ef-4b30-8697-8da431c9e178",
  "ttlMs": 30000
}

WebSocket

Open the socket as described in Real time: get a ticket with POST /api/ws-ticket, then connect to wss://teqhome.teqlogy.com/ws/app?ticket=…. A read-only key receives all events below and sends nothing; a full key may also send the commands.

Commands you can send (full key)

WStoggleRelay{ type, deviceId, relay, state } Full key only

Turn one relay ON or OFF, live.

  • relay must be a JSON number (0–7), state a JSON boolean.
  • While Away Mode covers the device, state: true is blocked and the owner gets a notification.
json
{"type":"toggleRelay","deviceId":"aabbcc112233","relay":0,"state":true}

Events you receive

WStelemetryUpdate Any key

A device reported. PowerMatrix-8: data.relays is the list of relay states. EnergyMate: data is the whole frame the device sent (readings, meters[], relays, counterEpoch, ampMax …) without the device’s credentials.

json
{
  "type": "telemetryUpdate",
  "deviceId": "aabbcc112233",
  "userId": "65f1a2b3c4d5e6f708192a01",
  "deviceType": "PowerMatrix-8",
  "data": {
    "relays": [1, 0, 1, 0, 0, 0, 0, 0]
  },
  "timestamp": "2026-10-03T14:20:00.000Z"
}
WSdeviceOnline Any key

A device connected, or reported after being offline. device is a snapshot: deviceId, type, status, name, firmware, config, relays.

json
{
  "type": "deviceOnline",
  "userId": "65f1a2b3c4d5e6f708192a01",
  "deviceId": "aabbcc112233",
  "deviceType": "PowerMatrix-8",
  "device": {
    "deviceId": "aabbcc112233",
    "type": "PowerMatrix-8",
    "status": true,
    "name": "Living Room",
    "firmware": "1.0.14",
    "config": {
      "relayMeta": []
    },
    "relays": [0, 0, 0, 0, 0, 0, 0, 0]
  }
}
WSdeviceOffline Any key

A device lost its connection (after a short grace period). transferred: true means it now belongs to somebody else.

json
{ "type": "deviceOffline", "deviceId": "aabbcc112233" }
WSdeviceUpdated Any key

The settings of a device changed (name, relay names, automations …). device is the same object as GET /api/devices/d/:deviceId.

json
{
  "type": "deviceUpdated",
  "userId": "65f1a2b3c4d5e6f708192a01",
  "device": {
    "deviceId": "aabbcc112233",
    "name": "Living Room Lights",
    "type": "PowerMatrix-8",
    "config": {
      "relayMeta": []
    }
  }
}
WSappNotification Any key

A new notification of your account, the same object as in GET /api/notifications.

json
{
  "type": "appNotification",
  "notification": {
    "_id": "65f1a2b3c4d5e6f708192a70",
    "type": "meter_limit",
    "title": "⚡ Main Panel — Meter 1 Limit Reached",
    "body": "Meter 1 hit its 10.0 kWh limit.",
    "meta": { "meterIndex": 0, "limit": 10 },
    "createdAt": "2026-10-03T12:00:00.000Z"
  }
}
WSirLearned Any key

The device captured an IR code after POST …/ir/learn. Store it with POST …/ir/save.

json
{
  "type": "irLearned",
  "deviceId": "aabbcc112233",
  "relay": 0,
  "code": "F30CFF00",
  "userId": "65f1a2b3c4d5e6f708192a01"
}
WSotaResult Any key

A firmware update that was started from the apps finished or failed.

json
{
  "type": "otaResult",
  "deviceId": "aabbcc112233",
  "success": true,
  "version": "1.0.15",
  "expected": "1.0.15",
  "reason": "Firmware updated to v1.0.15"
}

Reference

Automation schema

Automations are stored in config.automations and sent with PATCH …/preferences. The server runs them once a minute and records what it did in the relay history.

idrequired
stringYour own unique id for the automation (up to 80 characters). Automations without an id are dropped.
name
stringA label, up to 60 characters. Default "Automation".
enabled
booleanfalse pauses it. Default true. A one-shot timer disables itself after it ran.
relayIndexrequired
integerThe relay: 0–7.
targetStaterequired
string"ON", "OFF", or "IR" (send a stored IR code: add irCodeId and irCodeName).
kindrequired
string"weekly" (repeats on days at time) or "timer" (runs once at runAt).
time
stringweekly only. HH:mm, 24-hour, in your local time.
days
integer[]weekly only. 1 = Monday … 7 = Sunday. At least one.
runAt
ISO datetimer only. When it runs.
timezoneOffsetMinutes
integerYour UTC offset in minutes (Pakistan = 300). Default 0 (UTC).
json · a weekly automation and a one-shot timer
[
  {
    "id": "auto_001",
    "name": "Morning Lights",
    "enabled": true,
    "relayIndex": 0,
    "targetState": "ON",
    "kind": "weekly",
    "time": "07:00",
    "days": [1, 2, 3, 4, 5],
    "timezoneOffsetMinutes": 300
  },
  {
    "id": "auto_002",
    "name": "Party Mode Off",
    "enabled": true,
    "relayIndex": 3,
    "targetState": "OFF",
    "kind": "timer",
    "runAt": "2026-10-10T18:00:00.000Z",
    "timezoneOffsetMinutes": 300
  }
]

Relay icons

Use one of these names as icon in relayMeta. Anything else becomes power.

General
powerplugrouter
Water and air
pumpfanfan_ceilingfan_exhaustaccoolerheatergeyser
Lighting
light_bulblight_ceilinglight_ceiling_multilight_recessedlight_tracklight_floorlight_tabletube_singletube_doubletube_tripletube_quadtube_panelspot_singlespot_doublechandelierstrip_ledlight_outdoor
Kitchen and home
kitchenmicrowavefridgemixerkettletoasterwashingironvacuumdispenser
Entertainment and office
tvspeakermonitorprojector
Security and automation
cameradoorbellgategaragealarm
Electrical
invertermotorsolar