Skip to content

Accessing Raw Data Remotely

Bryan Mayland edited this page May 9, 2021 · 20 revisions

This list may not always be fully up to date. The JSON data is pretty self-explanitory so always refer to a live LinkMeter system for the most up-to-date parameter information. This documentation refers to the LinkMeter v14 and above with dedicated REST API, for information about older access methods, refer to Accessing Raw Data Remotely (v13 and below)

All read functions must be called with the GET HTTP method. All write functions must be called with the POST HTTP method. Write functions also require a valid API key obtained from the configuration webui page. The key can either be added as part of the request URI with the name apikey (/luci/lm/api/set?apikey=XXXX) or as part of the POST body. POST bodies should use the application/x-www-form-urlencoded MIME type.


LinkMeter includes support for autodiscovery of devices via the ZeroConf/mDNS/DNS-SD (Bonjour/Avahi) protocol. The service is advertised as an _http._tcp (Web Site) service with the name HeaterMeter BBQ Controller on %h where %h is the hostname. The txt record contains a path key which is the URI of the LinkMeter webpage. All REST API functions are under the URI /luci/lm/api

A second method of finding devices on the user's network is to query the HeaterMeter Device Registry by GETing the URL A JSON object will be returned which lists the internal IP addresses for interfaces on the device. This list will only be populated if the request is made from the same public IP address as the device (they are both NATed through the same home router). That is, if the request is made from the cellphone network and the device is on home wifi, the device will not be found. Look through the interface list for an IP address with a non-zero packet count, or use the guess key to use server's best guess (will be null if no guess available). Multiple devices may be found as illustrated below.

  "ip": "",
  "guess": "",
  "total": {
    "all": 2006,
    "week": 244,
    "month": 628
  "devices": [
      "device_id": "1952",
      "model": "BCM2835",
      "revision": "000e",
      "serial": "0000000091752c9f",
      "hostname": "BencHM",
      "seen": "1498592611",
      "uptime": "54",
      "interfaces": [
          "name": "eth0",
          "addr": "",
          "packets": "0"
          "name": "wlan0",
          "addr": "",
          "packets": "44"
      "device_id": "1746",
      "model": "BCM2835",
      "revision": "0010",
      "serial": "0000000078c7f575",
      "hostname": "BencHM",
      "seen": "1498670612",
      "uptime": "55",
      "interfaces": [
          "name": "eth0",
          "addr": "",
          "packets": "0"
          "name": "wlan0",
          "addr": "",
          "packets": "59"


API version 1 (GET) - /luci/lm/api/version First thing an application wishing to interface with LinkMeter should do is query the version to determine the API version and what functions are available.

    "ucid": "20161230B",
    "api": 1
Field Example Description
api 1 Current version of the API. Each function in the documentation indicates what API version it was added
ucid 20161230B If HeaterMeter is present, this field will contain the version string for the AVR firmware. May not be present or value maye be null.

The HTTP result codes for this URL are unique in that it is a READ API that can return a 403 Forbidden code, indicating the user has disabled the API.

HTTP Result Text Description
403 Forbidden User has explicitly disabled external API (API exists but even read access is denied)
404 Not found LinkMeter v13 or below. API functions are not available, application should fall back to Accessing Raw Data Remotely (v13 and below)

Current Status

API version 1 (GET) - /luci/lm/api/status

The current status (probe temperatures, etc) in JSON format. Values from inside the current status JSON object can be requested by appending a path to the request URI. Array objects are referenced by their 0-based index. For example, to request the name of probe 0, request /luci/lm/api/status/temps/0/n. If the request is specific enough to result in a single value, the returned MIME type is text/plain as the result is no longer a valid JSON object. If a value is not found, null is returned.

      "n":"Probe 0",
Field Example Description
time 1405429467 Current time (hopefully in UTC) in UNIX timestamp format (example is Tue, 15 Jul 2014 13:04:27 UTC). Might be incorrect if device has no Internet access.
set 65 PID Set Point (can be C or F but doesn't specify)
lid 38 Lid Open countdown timer. Number of seconds remaining in lid mode or 0 if lid mode is off
fan.c 0 Current PID output percentage
fan.a 13 Average PID output percentage over last few minutes
fan.f 10 Current fan output percentage (restricted by min/max fan speed)
adc[] 0,0,0,0,0,3 ADC noise range indicator. Probe 0 is adc[5], Probe 1 is adc[4], etc. May be absent if not supported.
temps[X].n Probe 0 Name assigned to probe
temps[X].c 78.6 Current probe temperature
temps[X].dph 1.3 Degrees per hour calculated (least squares linear fit). May be null if not enough data, or missing if not supported
temps[X].a.l -40 Probe alarm low trigger. Negative numbers indicate alarm is disabled
temps[X].a.h 200 Probe alarm high trigger. Negative numbers indicate alarm is disabled
temps[X].a.r null Probe alarm ringing. "L" or "H" if the alarm is currently triggered or null if no alarm ringing
temps[X].rf.s 1 Assigned RF node signal strength 0-3. The RF object is not present if the probe is not of type "RF"
temps[X].rf.b 0 Assigned RF node battery low (0=OK, 1=Low). The RF object is not present if the probe is not of type "RF"

HeaterMeter Configuration

API version 1 (GET/POST) - /luci/lm/api/config

Perform a GET request to return the current HeaterMeter configuration JSON object. Like the status request, specific individual parameters can be returned by adding a path to the URI (e.g. /luci/lm/api/config/fsmax), or set with a POST to the same URI. Perform a POST request to the base URI to set one or more parameters by name in the POST body, which will return a text/plain result. For a list of settable parameters see, URLs and Commands

GET: application/json
    "sp": 225,
    "fflor": 0,
    "smax": 200,
    "ld": 30,
    "lb": "10",
    "pidp": 5,
    "fmin": 0,
    "pt2": "1",
    "pca2": "7.3431401e-4",
    "le1": "10",
    "pt3": "1",
    "pn2": "Probe 2",
    "fsmax": 100,
    "pn3": "Probe 3",
    "prfn2": "",
    "pcc2": "9.5156869e-8"

POST: text/plain
User api_write setting 2 values...
fsmax to 100 = OK
pn0 to Pit = OK

Example cURL set requests (POSTs):

  • curl --data "fsmax=100&pn0=Pit&apikey=XXXX" http://heatermeter.local/luci/lm/api/config
  • identical to first curl --data "fsmax=100&pn0=Pit" http://heatermeter.local/luci/lm/api/config?apikey=XXXX
  • just a single parameter (fsmax) curl --data "value=100" http://heatermeter.local/luci/lm/api/config/fsmax?apikey=XXXX

AVR Firmware Upload

API version 1 (POST) - /luci/lm/api/fw

The AVR firmware can be updated remotely by posting a IHEX formatted file. The file should be included in the POST body with the field name hexfile and is required or a 403 error will be returned.

Example cURL request: `curl --form hexfile=@"path/to/local/heatermeter.hex" "http://heatermeter.local/luci/lm/api/fw?apikey=XXX"

Streaming Status

The current status can also be streamed using the HTTP server-sent events protocol from the URI /luci/lm/stream. Updates are sent with between 1 and 5 seconds, depending on changes in the data.


event: hmstatus
data: {"time":1405429467,"set":65,"lid":38,...}

event: hmstatus
data: {"time":1405429469,"set":65,"lid":36,...}

event: hmstatus
data: {"time":1405429471,"set":65,"lid":34,...}
Event Description
hmstatus Current Status update
log Debugging log message
alarm Alarm was just triggered
noisedump Differential-encoded dump of the last ADC block read
peaks Last high and low Pit peaks
pidint PID internals dump enabled by the user

Historical Data

Graph data is in CSV format and is accessible from the URI /luci/lm/hist. Fields are:

  • UNIX timestamp - number of seconds since Jan 1, 1970 UTC (no timezone)
  • Setpoint or nan if manual mode
  • Probe 0 temperature
  • Probe 1 temperature
  • Probe 2 temperature
  • Probe 3 temperature
  • If positive, the PID output percentage or manual output percentage. If negative, Lid Open Cooldown remaining.

Probe fields can be "nan" if no probe was inserted at the time. Requesting the data with no parameters will autoscale and return the best range of data to fit the amount stored in the database. Adding the nancnt=X parameter to the query can adjust the range. The value in each field is the average over the time interval.

nancnt Range Interval per line
460 1 hour 10 seconds
360 6 hours 60 seconds / 1 minute
240 12 hours 120 seconds / 2 minutes
0 24 hours 180 seconds / 3 minutes
Clone this wiki locally