Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# Data Formats

## iSpindle format

This is the format used for standard http posts.

- `corr-gravity` is an extended parameter containing a temperature corrected gravity reading.

- `gravity-format` is an extended parameter containing the gravity format (G or P).

- `run-time` is an extended parameter containing the number of seconds the execution took.

    {
       "name" : "gravmon",
       "ID": "2E6753",
       "token" : "gravmon",
       "interval": 900,
       "temperature": 20.5,
       "temp-units": "C",
       "gravity": 1.0050,
       "angle": 45.34,
       "battery": 3.67,
       "rssi": -12,

       "corr-gravity": 1.0050,
       "gravity-unit": "G",
       "run-time": 6
    }

This is the format template used to create the json above.

    {
     "name" : "${mdns}",
     "ID": "${id}",
     "token" : "gravmon",
     "interval": ${sleep-interval},
     "temperature": ${temp},
     "temp-units": "${temp-unit}",
     "gravity": ${gravity},
     "angle": ${angle},
     "battery": ${battery},
     "rssi": ${rssi},
     "corr-gravity": ${corr-gravity},
     "gravity-unit": "${gravity-unit}",
     "run-time": ${run-time}
    }

## Brewfather format

This is the format for Brewfather. See: Brewfather API docs

    {
       "name" : "gravmon",
       "temp": 20.5,
       "temp_unit": "C",
       "battery": 3.67,
       "gravity": 1.0050,
       "gravity_unit": "G",
    }

## Influx DB v2

This is the format for InfluxDB v2

    measurement,host=<mdns>,device=<id>,temp-format=<C|F>,gravity-format=SG,gravity=1.0004,corr-gravity=1.0004,angle=45.45,temp=20.1,battery=3.96,rssi=-18

This is the format template used to create the json above.

    measurement,host=${mdns},device=${id},temp-format=${temp-unit},gravity-format=${gravity-unit} gravity=${gravity},corr-gravity=${corr-gravity},angle=${angle},temp=${temp},battery=${battery},rssi=${rssi}

## MQTT

This is the format used to send data to MQTT. Each of the lines are specific topics

    ispindel/device_name/tilt 89.96796
    ispindel/device_name/temperature 21.375
    ispindel/device_name/temp_units C
    ispindel/device_name/battery 0.04171
    ispindel/device_name/gravity 33.54894
    ispindel/device_name/interval 1
    ispindel/device_name/RSSI -58

This is the format template used to create the json above.

Tip

Each line in the format is treated as one topic. The | is used as separator between lines and the first : is used as separator between topic and value. Each line is formatted as <topic>:<value>

    ispindel/${mdns}/tilt:${angle}|
    ispindel/${mdns}/temperature:${temp}|
    ispindel/${mdns}/temp_units:${temp-unit}|
    ispindel/${mdns}/battery:${battery}|
    ispindel/${mdns}/gravity:${gravity}|
    ispindel/${mdns}/interval:${sleep-interval}|
    ispindel/${mdns}/RSSI:${rssi}|

This is a format template that is compatible with v0.6. Just replace the topic with the topic you want to post data to.

    topic:{"name":"gravmon","ID":"${id}","token":"gravmon","interval": ${sleep-interval},"temperature": ${temp},"temp-units": "${temp-unit}","gravity":${gravity},"angle": ${angle},"battery":${battery},"rssi": ${rssi},"corr-gravity":${corr-gravity},"gravity-unit": "${gravity-unit}","run-time": ${run-time}}|

## version.json

Contents version.json. The version is used by the device to check if the this version is newer. The html files will also be downloaded if the are present on the server. This way it’s easy to upgrade to a version that serve the html files from the file system. If they dont exist nothing will happen, the OTA flashing will still work. If the html files are missing from the file system they can be uploaded manually afterwards.

    {
       "project":"gravmon",
       "version":"0.7.0",
       "html": [
          "index.min.htm",
          "device.min.htm",
          "config.min.htm",
          "format.min.htm",
          "calibration.min.htm",
          "about.min.htm"
       ]
    }