Why AI Agents and Logmor Work So Well Together
A Real-World Action
Agents are great at deciding what to do. Logmor lets them actually do it: reboot a frozen modem, start a heater, or cut power to equipment — at a cabin, rental, farm or remote site.
Five Simple HTTPS Calls
Standard REST requests with a bearer token. On, Off, a 30-second Power Cycle, live status, and an LED "find me" signal. Any AI model can learn the whole API from one short prompt.
Works When the Network Doesn't
Commands travel over the plug's own LTE connection, so your agent can still power-cycle a router when that router is the reason the internet is down.
The API at a glance
Base URL https://api.particle.io/v1/devices/DEVICE_ID
Header on every call Authorization: Bearer TOKEN
/control arg=1 · 0 · PowerCycleTurn on, turn off, or power-cycle (off 30 s, then on)/DataStatus: relay state, uptime, temperature, signal, power-restore setting/pingIs the outlet online right now?/Device info: name, last heard, firmware/ signal=1 · 0Flash the LED to find the outlet1Get Your Device ID and API Token
Sign in to the Device Console at device.logmor.com. Your device ID is shown on each device's page. Open Cloud API and click Generate Token. That page also lists every endpoint with examples you can copy.
2The Five Calls Your Agent Needs
# Replace YOUR_DEVICE_ID and YOUR_TOKEN with your own.
# 1. Turn ON (arg=1), OFF (arg=0), or power-cycle (arg=PowerCycle: off 30 s, then back on)
curl https://api.particle.io/v1/devices/YOUR_DEVICE_ID/control \
-d arg=PowerCycle \
-H "Authorization: Bearer YOUR_TOKEN"
# return_value: 1 = on, 0 = off, 3 = power cycle started, -1 = rejected
# 2. Read status: relay state, uptime, internal temperature, signal, power-restore setting
curl https://api.particle.io/v1/devices/YOUR_DEVICE_ID/Data \
-H "Authorization: Bearer YOUR_TOKEN"
# "result" is a JSON string, e.g. {"RelayStatus":1,"UpTime":344029,"TMP":100.4,"CellStrength":42.5,"CellQuality":50.0,"OnPowerRestore":1}
# 3. Is it online?
curl -X PUT https://api.particle.io/v1/devices/YOUR_DEVICE_ID/ping \
-H "Authorization: Bearer YOUR_TOKEN"
# 4. Device info (name, last heard, firmware)
curl https://api.particle.io/v1/devices/YOUR_DEVICE_ID \
-H "Authorization: Bearer YOUR_TOKEN"
# 5. Flash the LED to find the outlet (signal=1 start, signal=0 stop)
curl -X PUT https://api.particle.io/v1/devices/YOUR_DEVICE_ID \
-d signal=1 \
-H "Authorization: Bearer YOUR_TOKEN"
3Paste This Prompt into Any AI Assistant
Copy the prompt below into ChatGPT, Claude, Gemini or Copilot, then describe what you want to build. The assistant writes the script, the n8n workflow or the automation for you. Leave your real token out of the chat and paste it into your own setup afterwards.
I have a Logmor cellular smart plug. It is controlled with HTTPS calls to the Particle Cloud API, authenticated with the header "Authorization: Bearer TOKEN". - Control: POST https://api.particle.io/v1/devices/DEVICE_ID/control with form field arg = "1" (on), "0" (off) or "PowerCycle" (off for 30 seconds, then on). The response field return_value is 1 = on, 0 = off, 3 = power cycle started, -1 = rejected (unknown arg, or a power cycle isn't allowed: the outlet is off, a cycle is running, or it is within 60 seconds of the last one). - Status: GET https://api.particle.io/v1/devices/DEVICE_ID/Data. The field "result" is a JSON string with RelayStatus (0 off, 1 on), UpTime (seconds), TMP (internal temperature), CellStrength and CellQuality (percent) and OnPowerRestore. - Online check: PUT https://api.particle.io/v1/devices/DEVICE_ID/ping - Keep DEVICE_ID and TOKEN in environment variables or a secrets store, never in the code. Don't poll more often than every few minutes. Help me build: [describe your automation here]
4Give Your Agent the Outlet as a Tool
Most agent frameworks (OpenAI and Claude tool use, LangChain, n8n's AI Agent node, Zapier and Make) let you describe a "tool" the model can call. One tool covers everything:
{
"name": "logmor_outlet",
"description": "Controls a Logmor cellular smart plug. Use power_cycle to reboot a modem or router. Ask the user before turning the outlet off.",
"input_schema": {
"type": "object",
"properties": {
"action": { "type": "string", "enum": ["on", "off", "power_cycle", "status"] }
},
"required": ["action"]
}
}
And the code that runs when the agent calls it (Python):
import json, os, requests
API = "https://api.particle.io/v1/devices/" + os.environ["LOGMOR_DEVICE_ID"]
HEADERS = {"Authorization": "Bearer " + os.environ["LOGMOR_TOKEN"]}
ARGS = {"on": "1", "off": "0", "power_cycle": "PowerCycle"}
def logmor_outlet(action):
if action == "status":
r = requests.get(API + "/Data", headers=HEADERS, timeout=30)
r.raise_for_status()
return json.loads(r.json()["result"])
r = requests.post(API + "/control", data={"arg": ARGS[action]}, headers=HEADERS, timeout=30)
r.raise_for_status()
return {"return_value": r.json().get("return_value")}
No-code option: in n8n, attach an HTTP Request tool to the AI Agent node. In Zapier or Make, use a Webhooks / HTTP step. Use the same URL, header and arg values shown above.
Agent Workflow Ideas
Self-Healing Internet
An uptime monitor reports that a rental's internet is down. The agent checks that the outlet is online, sends PowerCycle to the modem, and messages you when the connection is back. See automating reboots with Globalping and Zapier.
Weather-Aware Heating
Each evening the agent reads the forecast for your cabin. If it will drop below freezing, it turns the heater on, and off again when it warms up. See remote cabin heater control.
Ask in Plain English
"Is the well pump on at the farm?" or "Reboot the Starlink at the lake house." A chat assistant with the outlet tool answers and acts, so there's no dashboard to open.
Keep it safe
- Treat the token like a password. Store it in environment variables or your platform's secrets store, never in a prompt or shared workflow. If it leaks, click Generate New Token in the Cloud API page. The old token stops working immediately.
- Prefer PowerCycle for network gear. It always turns the outlet back on after 30 seconds. A plain "off" leaves it off until something turns it on again.
- Have the agent ask first before switching off anything important, such as heaters, pumps or freezers.
- Power cycles are rate-limited by the outlet: one at a time, with at least 60 seconds between them, so a looping agent can't keep rebooting your equipment.
- Your schedules keep running. Up to 10 schedule rules live on the outlet itself and keep working even if your agent or the connection is down.
FAQ
Do I need to know how to code?
No. Paste the prompt above into an AI assistant and it will write the code or workflow. No-code tools like n8n, Zapier and Make work with simple HTTP steps.
Which AI assistants work?
Any assistant or agent platform that can call an HTTPS API or run a script. ChatGPT, Claude, Gemini, n8n, Zapier, Make and LangChain all qualify. These work through the open REST API; Logmor is not an officially certified integration for these platforms.
Are there API limits or per-call fees?
There are no per-call fees. Polling every few minutes is fine; polling every few seconds may be throttled under fair use.
Does it need Wi-Fi?
No. The plug has its own 4G LTE connection (AT&T, T-Mobile, Rogers, Telus, Bell and AT&T Mexico networks), so it works anywhere with cell signal.
What does it cost?
$169.99 for the outlet plus shipping ($10 US, $20 Canada; ask us about Mexico). Service, including unlimited LTE data, the Device Console and the API, is free for 14 days, then $15/month per outlet. No contract; cancel online anytime.
14 days of service free · No contract · Cancel anytime online