Overview
The Teqlogy API lets you control your smart devices, read real-time sensor data, and receive live state updates — from Postman, scripts, or custom integrations.
Request format
Content-Type: application/json
Authorization: Bearer tk_live_<your-key>Device Types
Teqlogy supports two device families. Each has different fields in API responses and different available endpoints.
- ✓8 individually controllable relays
- ✓Physical button overrides
- ✓IR remote learning & control
- ✓Relay automations (weekly / one-shot)
- ✓Server-side auto-off timers
- ✓Named relay labels & icons
- ✓Real-time voltage, current, power
- ✓Energy consumption (kWh)
- ✓3 independent meter readings
- ✓Power factor & frequency
- ✓Hourly/daily energy history
- ✓Configurable alert thresholds
type field in every device response tells you which family it belongs to: "PowerMatrix-8", "PowerMatrix-8-beta", or "EnergyMate-3".Authentication
Every request must include a Personal API Key in the Authorization header.
Authorization: Bearer tk_live_a3f9b2c1d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1Get an API Key
Rate Limits
Exceeding the limit returns 429 Too Many Requests. Check the Retry-After header.
Endpoints
All endpoints require a valid API key. Endpoints tagged with a device badge only apply to that device family.
List Devices
/api/devices/mePowerMatrix-8EnergyMate-3Returns all devices owned by or shared with your account, sorted by last activity.
curl https://teqhome.teqlogy.com/api/devices/me \
-H "Authorization: Bearer tk_live_..."Response
{
"ok": true,
"devices": [
{
"deviceId": "aabbcc112233",
"name": "Living Room",
"type": "PowerMatrix-8",
"status": true,
"relays": [1, 0, 1, 0, 0, 0, 0, 0],
"firmware": "1.0.14",
"lastSeen": "2026-05-31T14:20:00.000Z"
},
{
"deviceId": "ddeeff445566",
"name": "Main Panel",
"type": "EnergyMate-3",
"status": true,
"voltage": 231.4,
"current": 4.82,
"power": 1112.5,
"energy": 48.32,
"frequency": 50.01,
"pf": 0.994,
"firmware": "2.1.3",
"lastSeen": "2026-05-31T14:20:05.000Z"
}
]
}Device State
/api/devices/d/:deviceIdPowerMatrix-8EnergyMate-3Full state of a single device. The response shape differs by device type.
curl https://teqhome.teqlogy.com/api/devices/d/aabbcc112233 \
-H "Authorization: Bearer tk_live_..."PowerMatrix-8 response
PowerMatrix-8{
"ok": true,
"device": {
"deviceId": "aabbcc112233",
"name": "Living Room",
"type": "PowerMatrix-8",
"status": true,
"relays": [1, 0, 1, 0, 0, 0, 0, 0],
"firmware": "1.0.14",
"rssi": -62,
"lastSeen": "2026-05-31T14:20:00.000Z",
"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]
}
],
"irCodes": [
{ "id": "ir_abc123", "relayIndex": 0, "code": "F30CFF00", "name": "TV Remote 1" }
],
"relayTimers": [
{ "relayIndex": 2, "expiresAt": "2026-05-31T15:00:00.000Z" }
]
}
}
}relays[] — 8 integers: 1 = ON, 0 = OFF. Index 0 = relay 1.EnergyMate-3 response
EnergyMate-3{
"ok": true,
"device": {
"deviceId": "ddeeff445566",
"name": "Main Panel",
"type": "EnergyMate-3",
"status": true,
"voltage": 231.4,
"current": 4.82,
"power": 1112.5,
"energy": 48.32,
"frequency": 50.01,
"pf": 0.994,
"voltMin": 190,
"voltMax": 240,
"firmware": "2.1.3",
"meters": [
{ "index": 0, "voltage": 231.4, "current": 2.10, "power": 486.0, "energy": 18.3, "pf": 0.998 },
{ "index": 1, "voltage": 230.8, "current": 1.60, "power": 369.3, "energy": 16.1, "pf": 0.994 },
{ "index": 2, "voltage": 231.9, "current": 1.12, "power": 259.7, "energy": 13.9, "pf": 0.990 }
],
"config": {
"alertThresholds": {
"maxPower": 5000,
"maxCurrent": 25,
"maxVoltage": 240,
"minVoltage": 190
}
}
}
}Update Preferences
/api/devices/:deviceId/preferencesPowerMatrix-8EnergyMate-3Update device name, relay labels/icons, automations, energy bill rate, alert thresholds, or scenes. Send only the fields you want to change — all others are preserved.
Body fields
Relay meta schema
PowerMatrix-8[
{ "index": 0, "name": "Main Light", "icon": "light_ceiling" },
{ "index": 1, "name": "Fan", "icon": "fan" }
]Supported icons: power · plug · fan · fan_ceiling · ac · heater · geyser · light_bulb · light_ceiling · tube_single · tv · speaker · camera · gate · garage · motor · solar · router and more.
Automation schema
PowerMatrix-8// Weekly automation — runs every Mon-Fri at 07:00
{
"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
}
// One-shot timer — runs once at specific ISO timestamp
{
"id": "auto_002",
"name": "Party Mode Off",
"enabled": true,
"relayIndex": 3,
"targetState": "OFF",
"kind": "timer",
"runAt": "2026-06-01T23:00:00.000Z",
"timezoneOffsetMinutes": 300
}Alert thresholds schema
EnergyMate-3{
"alertThresholds": {
"maxPower": 5000,
"maxCurrent": 25,
"maxVoltage": 240,
"minVoltage": 190
}
}Full example — rename + set relay labels
curl -X PATCH https://teqhome.teqlogy.com/api/devices/aabbcc112233/preferences \
-H "Authorization: Bearer tk_live_..." \
-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" }
]
}'Relay Control
/api/devices/:deviceId/relayPowerMatrix-8Turn a relay ON or OFF in real-time. The command is forwarded to the device over WebSocket. Device must be online.
curl -X POST https://teqhome.teqlogy.com/api/devices/aabbcc112233/relay \
-H "Authorization: Bearer tk_live_..." \
-H "Content-Type: application/json" \
-d '{ "relay": 0, "state": true }'JavaScript
await fetch('https://teqhome.teqlogy.com/api/devices/aabbcc112233/relay', {
method: 'POST',
headers: { 'Authorization': 'Bearer tk_live_...', 'Content-Type': 'application/json' },
body: JSON.stringify({ relay: 0, state: true })
})Python
import requests
r = requests.post(
'https://teqhome.teqlogy.com/api/devices/aabbcc112233/relay',
headers={'Authorization': 'Bearer tk_live_...'},
json={'relay': 0, 'state': True}
)
print(r.json()) # {'ok': True}Relay Timer (Auto-Off)
Set a server-side timer that automatically turns a relay OFF after a specified number of seconds. Useful for "turn on for X minutes" automations. The timer survives app restarts and runs even if your client disconnects.
/api/devices/:deviceId/relay-timerPowerMatrix-8# Turn relay 2 off automatically after 30 minutes
curl -X POST https://teqhome.teqlogy.com/api/devices/aabbcc112233/relay-timer \
-H "Authorization: Bearer tk_live_..." \
-H "Content-Type: application/json" \
-d '{ "relayIndex": 2, "seconds": 1800 }'Response
{ "ok": true, "relayIndex": 2, "expiresAt": "2026-05-31T15:00:00.000Z", "secondsRemaining": 1800 }/api/devices/:deviceId/relay-timer/:relayIndexPowerMatrix-8Cancel a pending auto-off timer for a relay.
curl -X DELETE https://teqhome.teqlogy.com/api/devices/aabbcc112233/relay-timer/2 \
-H "Authorization: Bearer tk_live_..."Response
{ "ok": true, "relayIndex": 2, "cancelled": true }IR Remote Codes
PowerMatrix-8 has a built-in IR receiver/transmitter. You can teach it to recognize remote control buttons and use them as relay triggers.
/api/devices/:deviceId/ir/learnPowerMatrix-8Puts the device into IR learn mode for one relay. Point your remote at the device and press the button — the device captures the code and sends it back via WebSocket as an irLearned event.
curl -X POST https://teqhome.teqlogy.com/api/devices/aabbcc112233/ir/learn \
-H "Authorization: Bearer tk_live_..." \
-H "Content-Type: application/json" \
-d '{ "relay": 0 }'Response
{ "ok": true, "waiting": true, "message": "Point your remote at the device and press a button." }irLearned WebSocket event to your app with the captured hex code. You then call ir/save to store it./api/devices/:deviceId/ir/savePowerMatrix-8Save a captured (or manually entered) IR hex code to the device config. Saved codes are pushed to the device NVS so they work offline.
curl -X POST https://teqhome.teqlogy.com/api/devices/aabbcc112233/ir/save \
-H "Authorization: Bearer tk_live_..." \
-H "Content-Type: application/json" \
-d '{ "relay": 0, "code": "F30CFF00", "name": "TV Power" }'/api/devices/:deviceId/ir/:irIdPowerMatrix-8Remove a saved IR code by its ID (returned in the device state response under config.irCodes[].id).
curl -X DELETE https://teqhome.teqlogy.com/api/devices/aabbcc112233/ir/ir_abc123 \
-H "Authorization: Bearer tk_live_..."Energy History
/api/devices/:deviceId/energy-historyEnergyMate-3Returns averaged energy snapshots grouped by hour or day for an EnergyMate-3 device. Default window is the last 24 hours.
Query parameters
# Last 7 days, grouped by day
curl "https://teqhome.teqlogy.com/api/devices/ddeeff445566/energy-history?resolution=daily&from=2026-05-24T00:00:00Z&to=2026-05-31T23:59:59Z" \
-H "Authorization: Bearer tk_live_..."Response
{
"ok": true,
"resolution": "daily",
"from": "2026-05-24T00:00:00.000Z",
"to": "2026-05-31T23:59:59.000Z",
"data": [
{
"timestamp": "2026-05-24",
"voltage": 230.8,
"current": 4.51,
"power": 1040.3,
"energy": 24.97,
"frequency": 50.00,
"pf": 0.993,
"count": 144
}
]
}energy is cumulative kWh at that point in time. count is how many raw snapshots were averaged into this bucket.Relay Logs
/api/relay-logs/:deviceIdPowerMatrix-8Relay toggle history for a device. Records are auto-deleted after 30 days.
curl "https://teqhome.teqlogy.com/api/relay-logs/aabbcc112233?limit=20&relayIndex=0" \
-H "Authorization: Bearer tk_live_..."Response
[
{ "relayIndex": 0, "state": "ON", "source": "api", "createdAt": "2026-05-31T14:20:00.000Z" },
{ "relayIndex": 0, "state": "OFF", "source": "button", "createdAt": "2026-05-31T14:18:30.000Z" },
{ "relayIndex": 0, "state": "ON", "source": "automation","createdAt": "2026-05-31T07:00:01.000Z" }
]source: app · api · button · automation · ir · scheduleWebSocket Ticket
/api/ws-ticketExchange your API key for a 30-second single-use WebSocket ticket.
curl -X POST https://teqhome.teqlogy.com/api/ws-ticket \
-H "Authorization: Bearer tk_live_..."Response
{ "ticket": "3f9b2c1d-4e5f-6a7b-8c9d-0e1f2a3b4c5d" }WebSocket
Real-time bidirectional connection. Receive device state changes, relay events, and energy updates without polling.
Connect
// Step 1 — exchange API key for a ticket
const { ticket } = await fetch(
'https://teqhome.teqlogy.com/api/ws-ticket',
{ method: 'POST', headers: { 'Authorization': 'Bearer tk_live_...' } }
).then(r => r.json())
// Step 2 — open connection
const ws = new WebSocket(`wss://teqhome.teqlogy.com/ws/app?ticket=${ticket}`)
ws.onmessage = ({ data }) => console.log(JSON.parse(data))Commands you can send
toggleRelay{ type, deviceId, relay, state }ping{ type: "ping" }Events you receive
deviceOnlinebothdeviceId, device (full state)deviceOfflinebothdeviceIdtelemetryUpdatebothdeviceId, data.relays[] OR data.voltage/power/energydeviceUpdatedbothdeviceId, device (config changed)irLearnedPowerMatrix-8deviceId, relay, codeotaResultbothdeviceId, success, versionappNotificationbothnotification.title, .bodyFull example — live monitor
async function connect(apiKey) {
const { ticket } = await fetch(
'https://teqhome.teqlogy.com/api/ws-ticket',
{ method: 'POST', headers: { Authorization: `Bearer ${apiKey}` } }
).then(r => r.json())
const ws = new WebSocket(`wss://teqhome.teqlogy.com/ws/app?ticket=${ticket}`)
ws.onopen = () => console.log('Connected')
ws.onclose = () => setTimeout(() => connect(apiKey), 5000) // auto-reconnect
ws.onmessage = ({ data }) => {
const msg = JSON.parse(data)
if (msg.type === 'telemetryUpdate') {
if (msg.data?.relays) {
// PowerMatrix-8 relay states
console.log(`${msg.deviceId} relays:`, msg.data.relays)
} else {
// EnergyMate-3 energy data
console.log(`${msg.deviceId} power: ${msg.data?.power}W`)
}
}
if (msg.type === 'irLearned') {
console.log(`IR code captured: relay=${msg.relay} code=${msg.code}`)
// Now call POST /ir/save to store it
}
}
}Read-Only Keys
- ✓GET /api/devices/me
- ✓GET /api/devices/d/:id
- ✓GET /api/devices/:id/energy-history
- ✓GET /api/relay-logs/:id
- ✓POST /api/ws-ticket
- ✓WebSocket — receive all events
- ✗POST /api/devices/:id/relay
- ✗PATCH /api/devices/:id/preferences
- ✗POST /api/devices/:id/relay-timer
- ✗POST /api/devices/:id/ir/learn
- ✗POST /api/devices/:id/ir/save
- ✗DELETE /api/devices/:id/ir/:irId
- ✗WebSocket — toggleRelay
Errors
Every error response includes a stable code, a human-readable message, and a requestId for support tracing.
Error response format
{
"ok": false,
"code": "DEVICE_OFFLINE",
"message": "Device is offline — cannot push command",
"requestId": "req_a1b2c3d4e5f6g7h8"
}X-Request-Id HTTP response header contains the same ID — log it on your client. Share it with support for exact log lookup.HTTP status codes
401UnauthorizedMissing, invalid, or expired credential403ForbiddenAPI disabled / expired / read-only key / banned account404Not FoundDevice or endpoint does not exist429Too Many RequestsRate limit exceeded — check Retry-After503Service Unavail.Device is offline500Server ErrorUnexpected error — safe to retryError codes
Use code for programmatic handling — stable across versions. message may change.
AUTH_MISSING401No Authorization headerAUTH_INVALID401JWT or API key invalid / not foundAUTH_EXPIRED401JWT token has expiredAUTH_BANNED403Account suspendedAUTH_DELETED410Account permanently deletedAPI_ACCESS_DISABLED403Admin has not enabled API access for this accountAPI_ACCESS_EXPIRED403API access period has endedAPI_KEY_READONLY403Write op with read-only keyAPI_KEY_LIMIT40010-key limit reachedAPI_KEY_NOT_FOUND404Key ID not foundDEVICE_NOT_FOUND404Device not found or not yoursDEVICE_OFFLINE503Device WebSocket not connectedDEVICE_ACCESS_DENIED403Not owner and not shared with youVALIDATION_ERROR400Missing / invalid fieldRELAY_INDEX_INVALID400relay must be 0–7IR_CODE_INVALID400IR code must be valid hexIR_CODE_LIMIT40032-code limit per deviceTIMER_SECONDS_INVALID400seconds must be 1–86400RATE_LIMITED429Too many requestsNOT_FOUND404Endpoint does not existSERVER_ERROR500Unexpected server errorrequestId — tracing
// From response header (every request)
const requestId = response.headers.get('X-Request-Id')
// "req_a1b2c3d4e5f6g7h8"
// Or from error body
const { code, message, requestId } = await response.json()
if (code === 'DEVICE_OFFLINE') {
console.error('Device is offline, requestId:', requestId)
}Ready to build?
Sign in, generate an API key, and start controlling your Teqlogy devices in minutes.