Update documentation

This commit is contained in:
GitHub Action 2022-01-30 13:36:18 +00:00
parent 689e1d3fd5
commit be3bdc4442
27 changed files with 2898 additions and 1298 deletions

View File

@ -0,0 +1,92 @@
Advanced Configuration
######################
.. _format-editor:
Format editor
+++++++++++++
To reduce the need for adding custom endpoints for various services there is an built in format editor that allows the user to customize the format being sent to the push target.
.. warning::
Since the format templates can be big this function can be quite slow on a small device such as the esp8266.
.. image:: images/format.png
:width: 800
:alt: Format editor
You enter the format data in the text field and the test button will show an example on what the output would look like. If the data cannot be formatted in json it will just be displayed as a long string.
The save button will save the current formla and reload the data from the device.
.. tip::
If you save a blank string the default template will be loaded.
These are the format keys available for use in the format.
.. list-table:: Directory structure
:widths: 30 50 20
:header-rows: 1
* - key
- description
- example
* - ${mdns}
- Name of the device
- gravmon2
* - ${id}
- Unique id of the device
- e422a3
* - ${sleep-interval}
- Seconds between data is pushed
- 900
* - ${temp}
- Temperature in format configured on device, one decimal
- 21.2
* - ${temp-c}
- Temperature in C, one decimal
- 21.2
* - ${temp-f}
- Temperature in F, one decimal
- 58.0
* - ${temp-unit}
- Temperature format `C` or `F`
- C
* - ${battery}
- Battery voltage, two decimals
- 3.89
* - ${rssi}
- Wifi signal strength
- -75
* - ${run-time}
- How long the last measurement took, two decimals
- 3.87
* - ${angle}
- Angle of the gyro, two decimals
- 28.67
* - ${tilt}
- Same as angle.
- 28.67
* - ${gravity}
- Calculated gravity, 4 decimals for SG and 1 for Plato.
- 1.0456
* - ${gravity-sg}
- Calculated gravity in SG, 4 decimals
- 1.0456
* - ${gravity-plato}
- Calculated gravity in Plato, 1 decimal
- 8.5
* - ${corr-gravity}
- Temperature corrected gravity, 4 decimals for SG and 1 for Plato.
- 1.0456
* - ${corr-gravity-sg}
- Temperature corrected gravity in SG, 4 decimals
- 1.0456
* - ${corr-gravity-plato}
- Temperature corrected gravity in Plato, 1 decimal
- 8.5
* - ${gravity-unit}
- Gravity format, `G` or `P`
- G

322
docs/_sources/api.rst.txt Normal file
View File

@ -0,0 +1,322 @@
.. _rest-api:
REST API
########
All the API's use a key called ``ID`` which is the unique device id (chip id). This is used as an API key when sending requests to the device.
GET: /api/config
================
Retrive the current configuation of the device via an HTTP GET command. Payload is in JSON format.
* ``temp-format`` can be either ``C`` or ``F``
* ``gravity-format`` is always ``G`` (plato is not yet supported)
Other parameters are the same as in the configuration guide.
.. code-block:: json
{
"mdns": "gravmon",
"id": "ee1bfc",
"ota-url": "http://192.168.1.50:80/firmware/gravmon/",
"temp-format": "C",
"brewfather-push": "http://log.brewfather.net/stream?id=Qwerty",
"http-push": "http://192.168.1.50:9090/api/v1/Qwerty/telemetry",
"http-push-h1": "header: value",
"http-push-h2": "header: value",
"http-push2": "http://192.168.1.50/ispindel",
"http-push2-h1": "header: value",
"http-push2-h2": "header: value",
"influxdb2-push": "http://192.168.1.50:8086",
"influxdb2-org": "org",
"influxdb2-bucket": "bucket_id",
"influxdb2-auth": "token",
"mqtt-push": "192.168.1.50",
"mqtt-port": 1883,
"mqtt-user": "user",
"mqtt-pass": "pass",
"sleep-interval": 30,
"voltage-factor": 1.59,
"gravity-formula": "0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436",
"gravity-format": "G",
"temp-adjustment-value": 0,
"gravity-temp-adjustment": false,
"gyro-temp": true,
"gyro-calibration-data": {
"ax": -330,
"ay": -2249,
"az": 1170,
"gx": 99,
"gy": -6,
"gz": 4
},
"angle": 90.93,
"gravity": 1.105,
"battery": 0.04
}
GET: /api/device
================
Retrive the current device settings via an HTTP GET command. Payload is in JSON format.
.. code-block:: json
{
"app-name": "GravityMon",
"app-ver": "0.0.0",
"id": "ee1bfc",
"mdns": "gravmon"
}
GET: /api/status
================
Retrive the current device status via an HTTP GET command. Payload is in JSON format.
* ``temp-format`` can be either ``C`` or ``F``
Other parameters are the same as in the configuration guide.
.. code-block:: json
{
"id": "ee1bfc",
"angle": 89.86,
"gravity": 1.1052,
"gravity-tempcorr": 1.1031,
"temp-c": 0,
"temp-f": 32,
"battery": 0,
"temp-format": "C",
"sleep-mode": false,
"rssi": -56
}
GET: /api/config/formula
========================
Retrive the data used for formula calculation data via an HTTP GET command. Payload is in JSON format.
* ``a1``-``a4`` are the angles/tilt readings (up to 5 are currently supported)
* ``g1``-``g4`` are the corresponding gravity reaadings in SG or Plato depending on the device-format.
.. code-block:: json
{
"id": "ee1bfc",
"a1": 22.4,
"a2": 54.4,
"a3": 58,
"a4": 0,
"a5": 0,
"g1": 1.000,
"g2": 1.053,
"g3": 1.062,
"g4": 1,
"g5": 1,
"gravity-format": "G",
"gravity-formula": "0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436"
}
POST: /api/config/device
========================
Used to update device settings via an HTTP POST command.
Payload should be in standard format used for posting a form. Such as as: `id=value&mdns=value` etc. Key value pairs are shown below.
* ``temp-format`` can be either ``C`` (Celcius) or ``F`` (Farenheight)
.. code-block::
id=ee1bfc
mdns=gravmon
temp-format=C
sleep-interval=30
POST: /api/config/push
======================
Used to update push settings via an HTTP POST command. Payload is in JSON format.
Payload should be in standard format used for posting a form. Such as as: `id=value&mdns=value` etc. Key value pairs are shown below.
.. code-block::
id=ee1bfc
http-push=http://192.168.1.50/ispindel
http-push2=
http-push-h1=
http-push-h2=
http-push2-h1=
http-push2-h2=
brewfather-push=
influxdb2-push=http://192.168.1.50:8086
influxdb2-org=
influxdb2-bucket=
influxdb2-auth=
mqtt-push=192.168.1.50
mqtt-port=1883
mqtt-user=
mqtt-pass=
POST: /api/config/gravity
=========================
Used to update gravity settings via an HTTP POST command. Payload is in JSON format.
* ``gravity-formula`` keywords ``temp`` and ``tilt`` are supported.
* ``gravity-format`` can be either ``G`` (SG) or ``P`` (PLATO)
.. note::
``gravity-temp-adjustment`` is defined as "on" or "off" when posting since this is the output values
from a checkbox, when reading data it's sent as boolean (true,false).
Payload should be in standard format used for posting a form. Such as as: `id=value&mdns=value` etc. Key value pairs are shown below.
.. code-block::
id=ee1bfc
gravity-formula=0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436,
gravity-format=P
gravity-temp-adjustment=off
POST: /api/config/hardware
==========================
Used to update hardware settings via an HTTP POST command. Payload is in JSON format.
.. note::
``gyro-temp`` is defined as "on" or "off" when posting since this is the output values from a checkbox, when
reading data it's sent as boolean (true,false).
Payload should be in standard format used for posting a form. Such as as: `id=value&mdns=value` etc. Key value pairs are shown below.
.. code-block::
id=ee1bfc
voltage-factor=1.59
temp-adjustment=0
gyro-temp=off
ota-url=http://192.168.1.50/firmware/gravmon/
POST: /api/config/formula
=========================
Used to update formula calculation data via an HTTP POST command. Payload is in JSON format.
* ``a1``-``a4`` are the angles/tilt readings (up to 5 are currently supported)
* ``g1``-``g4`` are the corresponding gravity reaadings (in SG)
Payload should be in standard format used for posting a form. Such as as: `id=value&mdns=value` etc. Key value pairs are shown below.
.. code-block::
id=ee1bfc
a1=22.4
a2=54.4
a3=58
a4=0
a5=0
g1=1.000
g2=1.053
g3=1.062
g4=1
g5=1
Calling the API's from Python
=============================
Here is some example code for how to access the API's from a python script. Keys should always be
present or the API call will fail.
The requests package converts the json to standard form post format.
.. code-block:: python
import requests
import json
host = "192.168.1.1" # IP adress (or name) of the device to send these settings to
id = "ee1bfc" # Device ID (shown in serial console during startup or in UI)
def set_config( url, json ):
headers = { "ContentType": "application/json" }
print( url )
resp = requests.post( url, headers=headers, data=json )
if resp.status_code != 200 :
print ( "Failed " )
else :
print ( "Success " )
url = "http://" + host + "/api/config/device"
json = { "id": id,
"mdns": "gravmon", # Name of the device
"temp-format": "C", # Temperature format C or F
"sleep-interval": 30 # Sleep interval in seconds
}
set_config( url, json )
url = "http://" + host + "/api/config/push"
json = { "id": id,
"http-push": "http://192.168.1.1/ispindel",
"http-push2": "",
"http-push-h1": "",
"http-push-h2": "",
"http-push2-h1": "",
"http-push2-h2": "",
"brewfather-push": "",
"influxdb2-push": "",
"influxdb2-org": "",
"influxdb2-bucket": "",
"influxdb2-auth": "",
"mqtt-push": "192.168.1.50",
"mqtt-port": 1883,
"mqtt-user": "Qwerty",
"mqtt-pass": "Qwerty"
}
set_config( url, json )
url = "http://" + host + "/api/config/gravity"
json = { "id": id,
"gravity-formula": "",
"gravity-format": "P",
"gravity-temp-adjustment": "off" # Adjust gravity (on/off)
}
set_config( url, json )
url = "http://" + host + "/api/config/hardware"
json = { "id": id,
"voltage-factor": 1.59, # Default value for voltage calculation
"temp-adjustment": 0, # If temp sensor needs to be corrected
"gyro-temp": "on", # Use the temp sensor in the gyro instead (on/off)
"ota-url": "" # if the device should seach for a new update when active
}
set_config( url, json )
url = "http://" + host + "/api/formula"
json = { "id": id,
"a1": 22.4,
"a2": 54.4,
"a3": 58,
"a4": 0,
"a5": 0,
"g1": 1.000,
"g2": 1.053,
"g3": 1.062,
"g4": 1,
"g5": 1
}
set_config( url, json )

View File

@ -1,7 +1,7 @@
.. _setting-up-device:
Setting up device
#################
Configuration
#############
The device can operate in two modes and must be in ``configuration mode`` in order for the web server to be active.
@ -48,11 +48,12 @@ URL: (http://gravmon.local/device)
* **Device name:**
This is unique name of the device.
This is unique name of the device which is set in the configuration, also known as MDNS name.
* **Device ID:**
This is unique identifier for the device (ESP8266 id), this is required when using the API as an API Key to safeguard against faulty requests.
This is unique identifier for the device (ESP8266 id), this is required when using the API as an API Key to safeguard
against faulty requests. This is the ESP8266 chip ID, so it should be unique.
Configuration
@ -73,15 +74,19 @@ Device Setting
* **Temperature format:**
Choose between Celsius and Farenheight
Choose between Celsius and Farenheight when displaying temperature.
* **Interval:**
This defines how long the device should be sleeping between the readings when in `gravity monitoring` mode. You will also see the values in minutes/seconds to easier set the interval. 900s is a recommended interval.
This defines how long the device should be sleeping between the readings when in `gravity monitoring` mode. You will also see
the values in minutes/seconds to easier set the interval. 900s is a recommended interval. The sleep interval can
be set between 10 - 3600 seconds (60 minutes).
.. note::
The sleep interval can be set between 10 - 3600 seconds (60 minutes).
A low value such as 30s will give a lifespan of 1-2 weeks and 300s (5 min) would last for 3+ weeks. This assumes that
there is good wifi connection that takes less than 1s to reconnect. Poor wifi connection is the main reason for battery drain.
* **Calibration values:**
@ -166,16 +171,20 @@ Gravity Settings
* **Gravity format:**
Gravity format can be eihter `SG` or `Plato`. The device will use SG Internally and convert to Plato when displaying data.
Gravity format can be eihter `SG` or `Plato`. The device will use SG Internally and convert to Plato when displaying or sending data.
* **Gravity formula:**
Gravity formula is compatible with standard iSpindle formulas so any existing calculation option can be used. You can also use
the feature to create the formula by supplying the raw data. See :ref:`create-formula`
The gravity formula accepts to paramaters, **tilt** for the angle or **temp** for temperature (temperature inserted into the formula
will be in celsius). I would recommend to use the formula calculation feature instead since this is much easier.
* **Temperature correct gravity:**
Will apply a temperature calibration formula to the gravity as a second step.
Will apply a temperature calibration formula to the gravity as a second step after gravity has been calculated. It's also possible to
build this into the gravity formula.
.. warning::
This formula assumes that the calibration has been done at 20°C / 68°F.
@ -213,7 +222,7 @@ Hardware Settings
* **OTA URL:**
Should point to a URL where the .bin file + version.json file is located.
Should point to a URL where the firmware.bin file + version.json file are located.
For the OTA to work, place the following files (version.json + firmware.bin) at the location that you pointed out in OTA URL. If the version number in the json file is newer than in the
code the update will be done during startup.
@ -227,576 +236,3 @@ Hardware Settings
http://192.168.1.1/firmware/gravmon/
.. _format-editor:
Format editor
#############
To reduce the need for adding custom endpoints for various services there is an built in format editor that allows the user to customize the format being sent to the push target.
.. warning::
Since the format templates can be big this function can be quite slow on a small device such as the esp8266.
.. image:: images/format.png
:width: 800
:alt: Format editor
You enter the format data in the text field and the test button will show an example on what the output would look like. If the data cannot be formatted in json it will just be displayed as a long string.
The save button will save the current formla and reload the data from the device.
.. tip::
If you save a blank string the default template will be loaded.
These are the format keys available for use in the format.
.. list-table:: Directory structure
:widths: 30 50 20
:header-rows: 1
* - key
- description
- example
* - ${mdns}
- Name of the device
- gravmon2
* - ${id}
- Unique id of the device
- e422a3
* - ${sleep-interval}
- Seconds between data is pushed
- 900
* - ${temp}
- Temperature in format configured on device, one decimal
- 21.2
* - ${temp-c}
- Temperature in C, one decimal
- 21.2
* - ${temp-f}
- Temperature in F, one decimal
- 58.0
* - ${temp-unit}
- Temperature format `C` or `F`
- C
* - ${battery}
- Battery voltage, two decimals
- 3.89
* - ${rssi}
- Wifi signal strength
- -75
* - ${run-time}
- How long the last measurement took, two decimals
- 3.87
* - ${angle}
- Angle of the gyro, two decimals
- 28.67
* - ${tilt}
- Same as angle.
- 28.67
* - ${gravity}
- Calculated gravity, 4 decimals for SG and 1 for Plato.
- 1.0456
* - ${gravity-sg}
- Calculated gravity in SG, 4 decimals
- 1.0456
* - ${gravity-plato}
- Calculated gravity in Plato, 1 decimal
- 8.5
* - ${corr-gravity}
- Temperature corrected gravity, 4 decimals for SG and 1 for Plato.
- 1.0456
* - ${corr-gravity-sg}
- Temperature corrected gravity in SG, 4 decimals
- 1.0456
* - ${corr-gravity-plato}
- Temperature corrected gravity in Plato, 1 decimal
- 8.5
* - ${gravity-unit}
- Gravity format, `G` or `P`
- G
.. _create-formula:
Create formula
##############
.. image:: images/formula1.png
:width: 800
:alt: Formula data
Here you can enter up to 5 values (angles + gravity) that is then used to create the formula. Angles equal to zero will be regarded as empty even if there is a gravity reading.
.. image:: images/formula2.png
:width: 800
:alt: Formula graph
Once the formula is created a graph over the entered values and a simulation of the formula will give you a nice overview on how the formula will work.
.. _rest-api:
REST API
########
All the API's use a key called ``ID`` which is the unique device id (chip id). This is used as an API key when sending requests to the device.
GET: /api/config
================
Retrive the current configuation of the device via an HTTP GET command. Payload is in JSON format.
* ``temp-format`` can be either ``C`` or ``F``
* ``gravity-format`` is always ``G`` (plato is not yet supported)
Other parameters are the same as in the configuration guide.
.. code-block:: json
{
"mdns": "gravmon",
"id": "ee1bfc",
"ota-url": "http://192.168.1.50:80/firmware/gravmon/",
"temp-format": "C",
"brewfather-push": "http://log.brewfather.net/stream?id=Qwerty",
"http-push": "http://192.168.1.50:9090/api/v1/Qwerty/telemetry",
"http-push2": "http://192.168.1.50/ispindel",
"influxdb2-push": "http://192.168.1.50:8086",
"influxdb2-org": "Qwerty",
"influxdb2-bucket": "Qwerty",
"influxdb2-auth": "Qwerty",
"mqtt-push": "192.168.1.50",
"mqtt-port": 1883,
"mqtt-user": "Qwerty",
"mqtt-pass": "Qwerty",
"sleep-interval": 30,
"voltage-factor": 1.59,
"gravity-formula": "0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436",
"gravity-format": "G",
"temp-adjustment-value": 0,
"gravity-temp-adjustment": false,
"gyro-temp": true,
"gyro-calibration-data": {
"ax": -330,
"ay": -2249,
"az": 1170,
"gx": 99,
"gy": -6,
"gz": 4
},
"angle": 90.93,
"gravity": 1.105,
"battery": 0.04
}
GET: /api/device
================
Retrive the current device settings via an HTTP GET command. Payload is in JSON format.
.. code-block:: json
{
"app-name": "GravityMon ",
"app-ver": "0.0.0",
"id": "ee1bfc",
"mdns": "gravmon"
}
GET: /api/status
================
Retrive the current device status via an HTTP GET command. Payload is in JSON format.
* ``temp-format`` can be either ``C`` or ``F``
Other parameters are the same as in the configuration guide.
.. code-block:: json
{
"id": "ee1bfc",
"angle": 89.86,
"gravity": 1.1052,
"gravity-tempcorr": 1.1031,
"temp-c": 0,
"temp-f": 32,
"battery": 0,
"temp-format": "C",
"sleep-mode": false,
"rssi": -56
}
GET: /api/config/formula
========================
Retrive the data used for formula calculation data via an HTTP GET command. Payload is in JSON format.
* ``a1``-``a4`` are the angles/tilt readings (up to 5 are currently supported)
* ``g1``-``g4`` are the corresponding gravity reaadings in SG or Plato depending on the device-format.
.. code-block:: json
{
"id": "ee1bfc",
"a1": 22.4,
"a2": 54.4,
"a3": 58,
"a4": 0,
"a5": 0,
"g1": 1.000,
"g2": 1.053,
"g3": 1.062,
"g4": 1,
"g5": 1,
"gravity-format": "G",
"gravity-formula": "0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436"
}
POST: /api/config/device
========================
Used to update device settings via an HTTP POST command. Payload is in JSON format.
* ``temp-format`` can be either ``C`` (Celcius) or ``F`` (Farenheight)
.. code-block:: json
{
"id": "ee1bfc",
"mdns": "gravmon",
"temp-format": "C",
"sleep-interval": 30
}
POST: /api/config/push
======================
Used to update push settings via an HTTP POST command. Payload is in JSON format.
.. code-block:: json
{
"id": "ee1bfc",
"http-push": "http://192.168.1.50/ispindel",
"http-push2": "",
"brewfather-push": "",
"influxdb2-push": "http://192.168.1.50:8086",
"influxdb2-org": "Qwerty",
"influxdb2-bucket": "Qwerty",
"influxdb2-auth": "Qwerty"
"mqtt-push": "192.168.1.50",
"mqtt-port": 1883,
"mqtt-user": "Qwerty",
"mqtt-pass": "Qwerty",
}
POST: /api/config/gravity
=========================
Used to update gravity settings via an HTTP POST command. Payload is in JSON format.
* ``gravity-formula`` keywords ``temp`` and ``tilt`` are supported.
* ``gravity-format`` can be either ``G`` (SG) or ``P`` (PLATO)
.. note::
``gravity-temp-adjustment`` is defined as "on" or "off" when posting since this is the output values
from a checkbox, when reading data it's sent as boolean (true,false).
.. code-block:: json
{
"id": "ee1bfc",
"gravity-formula": "0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436",
"gravity-format": "P",
"gravity-temp-adjustment": "off"
}
POST: /api/config/hardware
==========================
Used to update hardware settings via an HTTP POST command. Payload is in JSON format.
.. note::
``gyro-temp`` is defined as "on" or "off" when posting since this is the output values from a checkbox, when
reading data it's sent as boolean (true,false).
.. code-block:: json
{
"id": "ee1bfc",
"voltage-factor": 1.59,
"temp-adjustment": 0,
"gyro-temp": "off",
"ota-url": "http://192.168.1.50/firmware/gravmon/"
}
POST: /api/config/formula
=========================
Used to update formula calculation data via an HTTP POST command. Payload is in JSON format.
* ``a1``-``a4`` are the angles/tilt readings (up to 5 are currently supported)
* ``g1``-``g4`` are the corresponding gravity reaadings (in SG)
.. code-block:: json
{
"id": "ee1bfc",
"a1": 22.4,
"a2": 54.4,
"a3": 58,
"a4": 0,
"a5": 0,
"g1": 1.000,
"g2": 1.053,
"g3": 1.062,
"g4": 1,
"g5": 1
}
Calling the API's from Python
=============================
Here is some example code for how to access the API's from a python script. Keys should always be
present or the API call will fail.
.. code-block:: python
import requests
import json
host = "192.168.1.1" # IP adress (or name) of the device to send these settings to
id = "ee1bfc" # Device ID (shown in serial console during startup or in UI)
def set_config( url, json ):
headers = { "ContentType": "application/json" }
print( url )
resp = requests.post( url, headers=headers, data=json )
if resp.status_code != 200 :
print ( "Failed " )
else :
print ( "Success " )
url = "http://" + host + "/api/config/device"
json = { "id": id,
"mdns": "gravmon", # Name of the device
"temp-format": "C", # Temperature format C or F
"sleep-interval": 30 # Sleep interval in seconds
}
set_config( url, json )
url = "http://" + host + "/api/config/push"
json = { "id": id,
"http-push": "http://192.168.1.1/ispindel",
"http-push2": "",
"brewfather-push": "",
"influxdb2-push": "",
"influxdb2-org": "",
"influxdb2-bucket": "",
"influxdb2-auth": "",
"mqtt-push": "192.168.1.50",
"mqtt-port": 1883,
"mqtt-user": "Qwerty",
"mqtt-pass": "Qwerty"
}
set_config( url, json )
url = "http://" + host + "/api/config/gravity"
json = { "id": id,
"gravity-formula": "",
"gravity-format": "P",
"gravity-temp-adjustment": "off" # Adjust gravity (on/off)
}
set_config( url, json )
url = "http://" + host + "/api/config/hardware"
json = { "id": id,
"voltage-factor": 1.59, # Default value for voltage calculation
"temp-adjustment": 0, # If temp sensor needs to be corrected
"gyro-temp": "on", # Use the temp sensor in the gyro instead (on/off)
"ota-url": "" # if the device should seach for a new update when active
}
set_config( url, json )
url = "http://" + host + "/api/formula"
json = { "id": id,
"a1": 22.4,
"a2": 54.4,
"a3": 58,
"a4": 0,
"a5": 0,
"g1": 1.000,
"g2": 1.053,
"g3": 1.062,
"g4": 1,
"g5": 1
}
set_config( url, json )
.. _data-formats:
Data Formats
############
.. _data-formats-ispindle:
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.
.. code-block:: json
{
"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.
.. code-block::
{
"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}
}
.. _data-formats-brewfather:
Brewfather format
=================
This is the format for Brewfather. See: `Brewfather API docs <https://docs.brewfather.app/integrations/custom-stream>`_
.. code-block:: json
{
"name" : "gravmon",
"temp": 20.5,
"temp_unit": "C",
"battery": 3.67,
"gravity": 1.0050,
"gravity_unit": "G",
}
.. _data-formats-influxdb2:
Influx DB v2
============
This is the format for InfluxDB v2
.. code-block::
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.
.. code-block::
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}
.. _data-formats-mqtt:
MQTT
====
This is the format used to send data to MQTT. Each of the lines are specific topics
.. code-block::
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>`
.. code-block::
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.
.. code-block::
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.
.. code-block:: json
{
"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"
]
}

156
docs/_sources/data.rst.txt Normal file
View File

@ -0,0 +1,156 @@
.. _data-formats:
Data Formats
############
.. _data-formats-ispindle:
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.
.. code-block:: json
{
"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.
.. code-block::
{
"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}
}
.. _data-formats-brewfather:
Brewfather format
=================
This is the format for Brewfather. See: `Brewfather API docs <https://docs.brewfather.app/integrations/custom-stream>`_
.. code-block:: json
{
"name" : "gravmon",
"temp": 20.5,
"temp_unit": "C",
"battery": 3.67,
"gravity": 1.0050,
"gravity_unit": "G",
}
.. _data-formats-influxdb2:
Influx DB v2
============
This is the format for InfluxDB v2
.. code-block::
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.
.. code-block::
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}
.. _data-formats-mqtt:
MQTT
====
This is the format used to send data to MQTT. Each of the lines are specific topics
.. code-block::
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>`
.. code-block::
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.
.. code-block::
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.
.. code-block:: json
{
"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"
]
}

View File

@ -0,0 +1,16 @@
.. _create-formula:
Create formula
##############
.. image:: images/formula1.png
:width: 800
:alt: Formula data
Here you can enter up to 5 values (angles + gravity) that is then used to create the formula. Angles equal to zero will be regarded as empty even if there is a gravity reading.
.. image:: images/formula2.png
:width: 800
:alt: Formula graph
Once the formula is created a graph over the entered values and a simulation of the formula will give you a nice overview on how the formula will work.

View File

@ -7,7 +7,7 @@ Welcome to GravityMon's documentation!
######################################
.. note::
This documentation reflects **v0.7**. Last updated 2022-01-23
This documentation reflects **v0.7.1**. Last updated 2022-01-30
GravityMon is a replacement firmare for the iSpindle firmware, it uses the same hardware configuration so
@ -125,10 +125,14 @@ the following libraries and without these this would have been much more difficu
functionallity
installation
configuration
formula
services
advanced
api
data
compiling
contributing
q_and_a
backlog
Indices and tables
==================

View File

@ -3,6 +3,17 @@
Releases
########
v0.7.1
------
* Added instructions for how to configure integration with Fermentrack
* Added instructions for how to configure integration with Ubidots
* Added instructions for how to configure integration with HomeAssistant
* Added instructions for how to configure integration with Brewers Friend (not verified)
* BUG: Defined mqtt port was ignored, used default values.
* BUG: Extended length of HTTP url fields from 100 to 120 chars.
* BUG: Fixed issue with default template so it now includes the device name correctly.
v0.7.0
------

View File

@ -0,0 +1,136 @@
.. _services:
Service Integration
###################
This chapter contains a list of targets and what configuration is needed to interact with them.
Brewfather
++++++++++
Brewfather is an all in one service that allows you to manage you recepies and brews.
Just enter the http adress found on brewfather, not other settings are needed. The endpoint has the following format:
.. code-block::
http://log.brewfather.net/http://log.brewfather.net/stream?id=<yourid>
The URL is found under settings.
Fermentrack
+++++++++++
`Fermentrack <https://www.fermentrack.com>`_ is a open source brewing software to monitor and control fermentation.
GravityMon can be installed and used as an iSpindle. Just register the device as an iSpindle and use the defined endpoint which normally is:
.. code-block::
http://myservername/ispindel
UBIdots
+++++++
`UBIdots <https://www.ubidots.com>`_ is a IoT service that display data collected various sources.
For this service there are two options to configure the integration. First you will need your default token which is found under `API Credentials` (<api-tokem> in the example below).
Swap the text <devicename> with the name you want to show in ubidots.
**Option 1** - token as an URL parameter
Enter the following as URL:
.. code-block::
http://industrial.api.ubidots.com/api/v1.6/devices/<devicename>/?token=<api-token>
Even though ubidots can handle the default ispindle format it probably better to just post the data you want. This is an example of a
format template that can be used. For information on customizing the format see :ref:`format-editor`.
.. code-block::
{
"temperature": ${temp},
"gravity": ${gravity},
"angle": ${angle},
"battery": ${battery},
"rssi": ${rssi}
}
Home Assistant
+++++++++++++++
`HomeAssistant <https://www.homeassistant.com>`_ is a platform for home automation and can collect sensor data
from multiple devices.
This setup uses the MQTT integration with home assistant to collect values from the device.
This part of the configuration goes into the home assistant configuration.yaml file. The example assumes that the
device is named `gravmon2`
::
sensor:
- platform: mqtt
name: "gravmon2_gravity"
state_topic: "gravmon/gravmon2/gravity"
- platform: mqtt
name: "gravmon2_battery"
state_topic: "gravmon/gravmon2/battery"
- platform: mqtt
name: "gravmon2_rssi"
state_topic: "gravmon/gravmon2/rssi"
Enter the name of the MQTT server in Home Assistant in the URL. You might need to install that option
first. This is the format needed to submit the data to the correct topics as needed above. You can add as
many sensors / topics as you want.
::
gravmon/${mdns}/tilt:${angle}|
gravmon/${mdns}/temperature:${temp}|
gravmon/${mdns}/temp_units:${temp-unit}|
Brewer's Friend
+++++++++++++++
Brewer's friend is an all in one service that allows you to manage you recepies and brews.
.. warning::
I dont have an account for brewers friend so I have not been able to verfy this completely. Its based on
the available documentation.
You can find you API key when logged in to the service. Follow these `instructions <https://docs.brewersfriend.com/devices/ispindel>`_
**Note there are different URLs if you are using plato or specific gravity!**
.. code-block::
http://log.brewersfriend.com/ispindel/[API KEY]
http://log.brewersfriend.com/ispindel_sg/[API KEY]
From what I can read in the documentation you need to add the API key as a token as well. This can be done using a custom
format for the endpoint. Just add you API key after token.
.. code-block::
{
"name" : "${mdns}",
"ID": "${id}",
"token" : "[API KEY]",
"interval": ${sleep-interval},
"temperature": ${temp},
"temp-units": "${temp-unit}",
"gravity": ${gravity},
"angle": ${angle},
"battery": ${battery},
"rssi": ${rssi}
}

View File

@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.7.0',
VERSION: '0.7.1',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',

375
docs/advanced.html Normal file
View File

@ -0,0 +1,375 @@
<!doctype html>
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="REST API" href="api.html" /><link rel="prev" title="Service Integration" href="services.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Advanced Configuration - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
<style>
body {
--color-code-background: #f8f8f8;
--color-code-foreground: black;
}
body[data-theme="dark"] {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
}
</style></head>
<body>
<script>
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
</script>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-toc" viewBox="0 0 24 24">
<title>Contents</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<line x1="4" y1="6" x2="20" y2="6" />
<line x1="10" y1="12" x2="20" y2="12" />
<line x1="6" y1="18" x2="20" y2="18" />
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24">
<title>Light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24">
<title>Dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
</svg>
</symbol>
<symbol id="svg-sun-half" viewBox="0 0 24 24">
<title>Auto light/dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r="9" />
<path d="M13 12h5" />
<path d="M13 15h4" />
<path d="M13 18h1" />
<path d="M13 9h4" />
<path d="M13 6h1" />
</svg>
</symbol>
</svg>
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
<label class="overlay sidebar-overlay" for="__navigation">
<div class="visually-hidden">Hide navigation sidebar</div>
</label>
<label class="overlay toc-overlay" for="__toc">
<div class="visually-hidden">Hide table of contents sidebar</div>
</label>
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<div class="visually-hidden">Toggle site navigation sidebar</div>
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="license.html">Licence</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
</ul>
</div>
</div>
</div>
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<div class="content-icon-container">
<div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
<article role="main">
<div class="section" id="advanced-configuration">
<h1>Advanced Configuration<a class="headerlink" href="#advanced-configuration" title="Permalink to this headline"></a></h1>
<div class="section" id="format-editor">
<span id="id1"></span><h2>Format editor<a class="headerlink" href="#format-editor" title="Permalink to this headline"></a></h2>
<p>To reduce the need for adding custom endpoints for various services there is an built in format editor that allows the user to customize the format being sent to the push target.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Since the format templates can be big this function can be quite slow on a small device such as the esp8266.</p>
</div>
<a class="reference internal image-reference" href="_images/format.png"><img alt="Format editor" src="_images/format.png" style="width: 800px;"/></a>
<p>You enter the format data in the text field and the test button will show an example on what the output would look like. If the data cannot be formatted in json it will just be displayed as a long string.
The save button will save the current formla and reload the data from the device.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>If you save a blank string the default template will be loaded.</p>
</div>
<p>These are the format keys available for use in the format.</p>
<div class="table-wrapper"><table class="colwidths-given docutils align-default" id="id2">
<caption><span class="caption-text">Directory structure</span><a class="headerlink" href="#id2" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 30%"/>
<col style="width: 50%"/>
<col style="width: 20%"/>
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>key</p></th>
<th class="head"><p>description</p></th>
<th class="head"><p>example</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>${mdns}</p></td>
<td><p>Name of the device</p></td>
<td><p>gravmon2</p></td>
</tr>
<tr class="row-odd"><td><p>${id}</p></td>
<td><p>Unique id of the device</p></td>
<td><p>e422a3</p></td>
</tr>
<tr class="row-even"><td><p>${sleep-interval}</p></td>
<td><p>Seconds between data is pushed</p></td>
<td><p>900</p></td>
</tr>
<tr class="row-odd"><td><p>${temp}</p></td>
<td><p>Temperature in format configured on device, one decimal</p></td>
<td><p>21.2</p></td>
</tr>
<tr class="row-even"><td><p>${temp-c}</p></td>
<td><p>Temperature in C, one decimal</p></td>
<td><p>21.2</p></td>
</tr>
<tr class="row-odd"><td><p>${temp-f}</p></td>
<td><p>Temperature in F, one decimal</p></td>
<td><p>58.0</p></td>
</tr>
<tr class="row-even"><td><p>${temp-unit}</p></td>
<td><p>Temperature format <cite>C</cite> or <cite>F</cite></p></td>
<td><p>C</p></td>
</tr>
<tr class="row-odd"><td><p>${battery}</p></td>
<td><p>Battery voltage, two decimals</p></td>
<td><p>3.89</p></td>
</tr>
<tr class="row-even"><td><p>${rssi}</p></td>
<td><p>Wifi signal strength</p></td>
<td><p>-75</p></td>
</tr>
<tr class="row-odd"><td><p>${run-time}</p></td>
<td><p>How long the last measurement took, two decimals</p></td>
<td><p>3.87</p></td>
</tr>
<tr class="row-even"><td><p>${angle}</p></td>
<td><p>Angle of the gyro, two decimals</p></td>
<td><p>28.67</p></td>
</tr>
<tr class="row-odd"><td><p>${tilt}</p></td>
<td><p>Same as angle.</p></td>
<td><p>28.67</p></td>
</tr>
<tr class="row-even"><td><p>${gravity}</p></td>
<td><p>Calculated gravity, 4 decimals for SG and 1 for Plato.</p></td>
<td><p>1.0456</p></td>
</tr>
<tr class="row-odd"><td><p>${gravity-sg}</p></td>
<td><p>Calculated gravity in SG, 4 decimals</p></td>
<td><p>1.0456</p></td>
</tr>
<tr class="row-even"><td><p>${gravity-plato}</p></td>
<td><p>Calculated gravity in Plato, 1 decimal</p></td>
<td><p>8.5</p></td>
</tr>
<tr class="row-odd"><td><p>${corr-gravity}</p></td>
<td><p>Temperature corrected gravity, 4 decimals for SG and 1 for Plato.</p></td>
<td><p>1.0456</p></td>
</tr>
<tr class="row-even"><td><p>${corr-gravity-sg}</p></td>
<td><p>Temperature corrected gravity in SG, 4 decimals</p></td>
<td><p>1.0456</p></td>
</tr>
<tr class="row-odd"><td><p>${corr-gravity-plato}</p></td>
<td><p>Temperature corrected gravity in Plato, 1 decimal</p></td>
<td><p>8.5</p></td>
</tr>
<tr class="row-even"><td><p>${gravity-unit}</p></td>
<td><p>Gravity format, <cite>G</cite> or <cite>P</cite></p></td>
<td><p>G</p></td>
</tr>
</tbody>
</table></div>
</div>
</div>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="api.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">REST API</div>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="services.html">
<svg><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>
<div class="title">Service Integration</div>
</div>
</a>
</div>
<div class="related-information">
Copyright &#169; 2021-2022, Magnus Persson |
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
<a href="https://github.com/pradyunsg/furo">Furo theme</a>.
</div>
</footer>
</div>
<aside class="toc-drawer">
<div class="toc-sticky toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
Contents
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">Advanced Configuration</a><ul>
<li><a class="reference internal" href="#format-editor">Format editor</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</aside>
</div>
</div><script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/scripts/furo.js"></script>
</body>
</html>

564
docs/api.html Normal file
View File

@ -0,0 +1,564 @@
<!doctype html>
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Data Formats" href="data.html" /><link rel="prev" title="Advanced Configuration" href="advanced.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>REST API - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
<style>
body {
--color-code-background: #f8f8f8;
--color-code-foreground: black;
}
body[data-theme="dark"] {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
}
</style></head>
<body>
<script>
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
</script>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-toc" viewBox="0 0 24 24">
<title>Contents</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<line x1="4" y1="6" x2="20" y2="6" />
<line x1="10" y1="12" x2="20" y2="12" />
<line x1="6" y1="18" x2="20" y2="18" />
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24">
<title>Light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24">
<title>Dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
</svg>
</symbol>
<symbol id="svg-sun-half" viewBox="0 0 24 24">
<title>Auto light/dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r="9" />
<path d="M13 12h5" />
<path d="M13 15h4" />
<path d="M13 18h1" />
<path d="M13 9h4" />
<path d="M13 6h1" />
</svg>
</symbol>
</svg>
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
<label class="overlay sidebar-overlay" for="__navigation">
<div class="visually-hidden">Hide navigation sidebar</div>
</label>
<label class="overlay toc-overlay" for="__toc">
<div class="visually-hidden">Hide table of contents sidebar</div>
</label>
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<div class="visually-hidden">Toggle site navigation sidebar</div>
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="license.html">Licence</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
</ul>
</div>
</div>
</div>
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<div class="content-icon-container">
<div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
<article role="main">
<div class="section" id="rest-api">
<span id="id1"></span><h1>REST API<a class="headerlink" href="#rest-api" title="Permalink to this headline"></a></h1>
<p>All the APIs use a key called <code class="docutils literal notranslate"><span class="pre">ID</span></code> which is the unique device id (chip id). This is used as an API key when sending requests to the device.</p>
<div class="section" id="get-api-config">
<h2>GET: /api/config<a class="headerlink" href="#get-api-config" title="Permalink to this headline"></a></h2>
<p>Retrive the current configuation of the device via an HTTP GET command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">temp-format</span></code> can be either <code class="docutils literal notranslate"><span class="pre">C</span></code> or <code class="docutils literal notranslate"><span class="pre">F</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">gravity-format</span></code> is always <code class="docutils literal notranslate"><span class="pre">G</span></code> (plato is not yet supported)</p></li>
</ul>
<p>Other parameters are the same as in the configuration guide.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mdns"</span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ota-url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50:80/firmware/gravmon/"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"brewfather-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://log.brewfather.net/stream?id=Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50:9090/api/v1/Qwerty/telemetry"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push-h1"</span><span class="p">:</span><span class="w"> </span><span class="s2">"header: value"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push-h2"</span><span class="p">:</span><span class="w"> </span><span class="s2">"header: value"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push2"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50/ispindel"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push2-h1"</span><span class="p">:</span><span class="w"> </span><span class="s2">"header: value"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push2-h2"</span><span class="p">:</span><span class="w"> </span><span class="s2">"header: value"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50:8086"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-org"</span><span class="p">:</span><span class="w"> </span><span class="s2">"org"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-bucket"</span><span class="p">:</span><span class="w"> </span><span class="s2">"bucket_id"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-auth"</span><span class="p">:</span><span class="w"> </span><span class="s2">"token"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"192.168.1.50"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-port"</span><span class="p">:</span><span class="w"> </span><span class="mi">1883</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-user"</span><span class="p">:</span><span class="w"> </span><span class="s2">"user"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-pass"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pass"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"sleep-interval"</span><span class="p">:</span><span class="w"> </span><span class="mi">30</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"voltage-factor"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.59</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-formula"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"G"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-adjustment-value"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-temp-adjustment"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gyro-temp"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gyro-calibration-data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ax"</span><span class="p">:</span><span class="w"> </span><span class="mi">-330</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ay"</span><span class="p">:</span><span class="w"> </span><span class="mi">-2249</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"az"</span><span class="p">:</span><span class="w"> </span><span class="mi">1170</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gx"</span><span class="p">:</span><span class="w"> </span><span class="mi">99</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gy"</span><span class="p">:</span><span class="w"> </span><span class="mi">-6</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gz"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="w"></span>
<span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w"> </span><span class="nt">"angle"</span><span class="p">:</span><span class="w"> </span><span class="mf">90.93</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.105</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"battery"</span><span class="p">:</span><span class="w"> </span><span class="mf">0.04</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="get-api-device">
<h2>GET: /api/device<a class="headerlink" href="#get-api-device" title="Permalink to this headline"></a></h2>
<p>Retrive the current device settings via an HTTP GET command. Payload is in JSON format.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"app-name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"GravityMon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"app-ver"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0.0"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mdns"</span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="get-api-status">
<h2>GET: /api/status<a class="headerlink" href="#get-api-status" title="Permalink to this headline"></a></h2>
<p>Retrive the current device status via an HTTP GET command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">temp-format</span></code> can be either <code class="docutils literal notranslate"><span class="pre">C</span></code> or <code class="docutils literal notranslate"><span class="pre">F</span></code></p></li>
</ul>
<p>Other parameters are the same as in the configuration guide.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"angle"</span><span class="p">:</span><span class="w"> </span><span class="mf">89.86</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.1052</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-tempcorr"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.1031</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-c"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-f"</span><span class="p">:</span><span class="w"> </span><span class="mi">32</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"battery"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"sleep-mode"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"rssi"</span><span class="p">:</span><span class="w"> </span><span class="mi">-56</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="get-api-config-formula">
<h2>GET: /api/config/formula<a class="headerlink" href="#get-api-config-formula" title="Permalink to this headline"></a></h2>
<p>Retrive the data used for formula calculation data via an HTTP GET command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">a1</span></code>-<code class="docutils literal notranslate"><span class="pre">a4</span></code> are the angles/tilt readings (up to 5 are currently supported)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">g1</span></code>-<code class="docutils literal notranslate"><span class="pre">g4</span></code> are the corresponding gravity reaadings in SG or Plato depending on the device-format.</p></li>
</ul>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a1"</span><span class="p">:</span><span class="w"> </span><span class="mf">22.4</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a2"</span><span class="p">:</span><span class="w"> </span><span class="mf">54.4</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a3"</span><span class="p">:</span><span class="w"> </span><span class="mi">58</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a4"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a5"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g1"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.000</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g2"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.053</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g3"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.062</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g4"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g5"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"G"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-formula"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436"</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-device">
<h2>POST: /api/config/device<a class="headerlink" href="#post-api-config-device" title="Permalink to this headline"></a></h2>
<p>Used to update device settings via an HTTP POST command.</p>
<p>Payload should be in standard format used for posting a form. Such as as: <cite>id=value&amp;mdns=value</cite> etc. Key value pairs are shown below.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">temp-format</span></code> can be either <code class="docutils literal notranslate"><span class="pre">C</span></code> (Celcius) or <code class="docutils literal notranslate"><span class="pre">F</span></code> (Farenheight)</p></li>
</ul>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">id</span><span class="o">=</span><span class="n">ee1bfc</span>
<span class="n">mdns</span><span class="o">=</span><span class="n">gravmon</span>
<span class="n">temp</span><span class="o">-</span><span class="nb">format</span><span class="o">=</span><span class="n">C</span>
<span class="n">sleep</span><span class="o">-</span><span class="n">interval</span><span class="o">=</span><span class="mi">30</span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-push">
<h2>POST: /api/config/push<a class="headerlink" href="#post-api-config-push" title="Permalink to this headline"></a></h2>
<p>Used to update push settings via an HTTP POST command. Payload is in JSON format.</p>
<p>Payload should be in standard format used for posting a form. Such as as: <cite>id=value&amp;mdns=value</cite> etc. Key value pairs are shown below.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">id</span><span class="o">=</span><span class="n">ee1bfc</span>
<span class="n">http</span><span class="o">-</span><span class="n">push</span><span class="o">=</span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="mf">192.168.1.50</span><span class="o">/</span><span class="n">ispindel</span>
<span class="n">http</span><span class="o">-</span><span class="n">push2</span><span class="o">=</span>
<span class="n">http</span><span class="o">-</span><span class="n">push</span><span class="o">-</span><span class="n">h1</span><span class="o">=</span>
<span class="n">http</span><span class="o">-</span><span class="n">push</span><span class="o">-</span><span class="n">h2</span><span class="o">=</span>
<span class="n">http</span><span class="o">-</span><span class="n">push2</span><span class="o">-</span><span class="n">h1</span><span class="o">=</span>
<span class="n">http</span><span class="o">-</span><span class="n">push2</span><span class="o">-</span><span class="n">h2</span><span class="o">=</span>
<span class="n">brewfather</span><span class="o">-</span><span class="n">push</span><span class="o">=</span>
<span class="n">influxdb2</span><span class="o">-</span><span class="n">push</span><span class="o">=</span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="mf">192.168.1.50</span><span class="p">:</span><span class="mi">8086</span>
<span class="n">influxdb2</span><span class="o">-</span><span class="n">org</span><span class="o">=</span>
<span class="n">influxdb2</span><span class="o">-</span><span class="n">bucket</span><span class="o">=</span>
<span class="n">influxdb2</span><span class="o">-</span><span class="n">auth</span><span class="o">=</span>
<span class="n">mqtt</span><span class="o">-</span><span class="n">push</span><span class="o">=</span><span class="mf">192.168.1.50</span>
<span class="n">mqtt</span><span class="o">-</span><span class="n">port</span><span class="o">=</span><span class="mi">1883</span>
<span class="n">mqtt</span><span class="o">-</span><span class="n">user</span><span class="o">=</span>
<span class="n">mqtt</span><span class="o">-</span><span class="k">pass</span><span class="o">=</span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-gravity">
<h2>POST: /api/config/gravity<a class="headerlink" href="#post-api-config-gravity" title="Permalink to this headline"></a></h2>
<p>Used to update gravity settings via an HTTP POST command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">gravity-formula</span></code> keywords <code class="docutils literal notranslate"><span class="pre">temp</span></code> and <code class="docutils literal notranslate"><span class="pre">tilt</span></code> are supported.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">gravity-format</span></code> can be either <code class="docutils literal notranslate"><span class="pre">G</span></code> (SG) or <code class="docutils literal notranslate"><span class="pre">P</span></code> (PLATO)</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><code class="docutils literal notranslate"><span class="pre">gravity-temp-adjustment</span></code> is defined as “on” or “off” when posting since this is the output values
from a checkbox, when reading data its sent as boolean (true,false).</p>
</div>
<p>Payload should be in standard format used for posting a form. Such as as: <cite>id=value&amp;mdns=value</cite> etc. Key value pairs are shown below.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">id</span><span class="o">=</span><span class="n">ee1bfc</span>
<span class="n">gravity</span><span class="o">-</span><span class="n">formula</span><span class="o">=</span><span class="mf">0.0</span><span class="o">*</span><span class="n">tilt</span><span class="o">^</span><span class="mi">3</span><span class="o">+</span><span class="mf">0.0</span><span class="o">*</span><span class="n">tilt</span><span class="o">^</span><span class="mi">2</span><span class="o">+</span><span class="mf">0.0017978</span><span class="o">*</span><span class="n">tilt</span><span class="o">+</span><span class="mf">0.9436</span><span class="p">,</span>
<span class="n">gravity</span><span class="o">-</span><span class="nb">format</span><span class="o">=</span><span class="n">P</span>
<span class="n">gravity</span><span class="o">-</span><span class="n">temp</span><span class="o">-</span><span class="n">adjustment</span><span class="o">=</span><span class="n">off</span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-hardware">
<h2>POST: /api/config/hardware<a class="headerlink" href="#post-api-config-hardware" title="Permalink to this headline"></a></h2>
<p>Used to update hardware settings via an HTTP POST command. Payload is in JSON format.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><code class="docutils literal notranslate"><span class="pre">gyro-temp</span></code> is defined as “on” or “off” when posting since this is the output values from a checkbox, when
reading data its sent as boolean (true,false).</p>
</div>
<p>Payload should be in standard format used for posting a form. Such as as: <cite>id=value&amp;mdns=value</cite> etc. Key value pairs are shown below.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">id</span><span class="o">=</span><span class="n">ee1bfc</span>
<span class="n">voltage</span><span class="o">-</span><span class="n">factor</span><span class="o">=</span><span class="mf">1.59</span>
<span class="n">temp</span><span class="o">-</span><span class="n">adjustment</span><span class="o">=</span><span class="mi">0</span>
<span class="n">gyro</span><span class="o">-</span><span class="n">temp</span><span class="o">=</span><span class="n">off</span>
<span class="n">ota</span><span class="o">-</span><span class="n">url</span><span class="o">=</span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="mf">192.168.1.50</span><span class="o">/</span><span class="n">firmware</span><span class="o">/</span><span class="n">gravmon</span><span class="o">/</span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-formula">
<h2>POST: /api/config/formula<a class="headerlink" href="#post-api-config-formula" title="Permalink to this headline"></a></h2>
<p>Used to update formula calculation data via an HTTP POST command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">a1</span></code>-<code class="docutils literal notranslate"><span class="pre">a4</span></code> are the angles/tilt readings (up to 5 are currently supported)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">g1</span></code>-<code class="docutils literal notranslate"><span class="pre">g4</span></code> are the corresponding gravity reaadings (in SG)</p></li>
</ul>
<p>Payload should be in standard format used for posting a form. Such as as: <cite>id=value&amp;mdns=value</cite> etc. Key value pairs are shown below.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">id</span><span class="o">=</span><span class="n">ee1bfc</span>
<span class="n">a1</span><span class="o">=</span><span class="mf">22.4</span>
<span class="n">a2</span><span class="o">=</span><span class="mf">54.4</span>
<span class="n">a3</span><span class="o">=</span><span class="mi">58</span>
<span class="n">a4</span><span class="o">=</span><span class="mi">0</span>
<span class="n">a5</span><span class="o">=</span><span class="mi">0</span>
<span class="n">g1</span><span class="o">=</span><span class="mf">1.000</span>
<span class="n">g2</span><span class="o">=</span><span class="mf">1.053</span>
<span class="n">g3</span><span class="o">=</span><span class="mf">1.062</span>
<span class="n">g4</span><span class="o">=</span><span class="mi">1</span>
<span class="n">g5</span><span class="o">=</span><span class="mi">1</span>
</pre></div>
</div>
</div>
<div class="section" id="calling-the-api-s-from-python">
<h2>Calling the APIs from Python<a class="headerlink" href="#calling-the-api-s-from-python" title="Permalink to this headline"></a></h2>
<p>Here is some example code for how to access the APIs from a python script. Keys should always be
present or the API call will fail.</p>
<p>The requests package converts the json to standard form post format.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">requests</span>
<span class="kn">import</span> <span class="nn">json</span>
<span class="n">host</span> <span class="o">=</span> <span class="s2">"192.168.1.1"</span> <span class="c1"># IP adress (or name) of the device to send these settings to</span>
<span class="nb">id</span> <span class="o">=</span> <span class="s2">"ee1bfc"</span> <span class="c1"># Device ID (shown in serial console during startup or in UI)</span>
<span class="k">def</span> <span class="nf">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">):</span>
<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"ContentType"</span><span class="p">:</span> <span class="s2">"application/json"</span> <span class="p">}</span>
<span class="nb">print</span><span class="p">(</span> <span class="n">url</span> <span class="p">)</span>
<span class="n">resp</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">post</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">json</span> <span class="p">)</span>
<span class="k">if</span> <span class="n">resp</span><span class="o">.</span><span class="n">status_code</span> <span class="o">!=</span> <span class="mi">200</span> <span class="p">:</span>
<span class="nb">print</span> <span class="p">(</span> <span class="s2">"Failed "</span> <span class="p">)</span>
<span class="k">else</span> <span class="p">:</span>
<span class="nb">print</span> <span class="p">(</span> <span class="s2">"Success "</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/config/device"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"mdns"</span><span class="p">:</span> <span class="s2">"gravmon"</span><span class="p">,</span> <span class="c1"># Name of the device</span>
<span class="s2">"temp-format"</span><span class="p">:</span> <span class="s2">"C"</span><span class="p">,</span> <span class="c1"># Temperature format C or F</span>
<span class="s2">"sleep-interval"</span><span class="p">:</span> <span class="mi">30</span> <span class="c1"># Sleep interval in seconds</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/config/push"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"http-push"</span><span class="p">:</span> <span class="s2">"http://192.168.1.1/ispindel"</span><span class="p">,</span>
<span class="s2">"http-push2"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"http-push-h1"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"http-push-h2"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"http-push2-h1"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"http-push2-h2"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"brewfather-push"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"influxdb2-push"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"influxdb2-org"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"influxdb2-bucket"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"influxdb2-auth"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"mqtt-push"</span><span class="p">:</span> <span class="s2">"192.168.1.50"</span><span class="p">,</span>
<span class="s2">"mqtt-port"</span><span class="p">:</span> <span class="mi">1883</span><span class="p">,</span>
<span class="s2">"mqtt-user"</span><span class="p">:</span> <span class="s2">"Qwerty"</span><span class="p">,</span>
<span class="s2">"mqtt-pass"</span><span class="p">:</span> <span class="s2">"Qwerty"</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/config/gravity"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"gravity-formula"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"gravity-format"</span><span class="p">:</span> <span class="s2">"P"</span><span class="p">,</span>
<span class="s2">"gravity-temp-adjustment"</span><span class="p">:</span> <span class="s2">"off"</span> <span class="c1"># Adjust gravity (on/off)</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/config/hardware"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"voltage-factor"</span><span class="p">:</span> <span class="mf">1.59</span><span class="p">,</span> <span class="c1"># Default value for voltage calculation</span>
<span class="s2">"temp-adjustment"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># If temp sensor needs to be corrected</span>
<span class="s2">"gyro-temp"</span><span class="p">:</span> <span class="s2">"on"</span><span class="p">,</span> <span class="c1"># Use the temp sensor in the gyro instead (on/off)</span>
<span class="s2">"ota-url"</span><span class="p">:</span> <span class="s2">""</span> <span class="c1"># if the device should seach for a new update when active</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/formula"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"a1"</span><span class="p">:</span> <span class="mf">22.4</span><span class="p">,</span>
<span class="s2">"a2"</span><span class="p">:</span> <span class="mf">54.4</span><span class="p">,</span>
<span class="s2">"a3"</span><span class="p">:</span> <span class="mi">58</span><span class="p">,</span>
<span class="s2">"a4"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">"a5"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">"g1"</span><span class="p">:</span> <span class="mf">1.000</span><span class="p">,</span>
<span class="s2">"g2"</span><span class="p">:</span> <span class="mf">1.053</span><span class="p">,</span>
<span class="s2">"g3"</span><span class="p">:</span> <span class="mf">1.062</span><span class="p">,</span>
<span class="s2">"g4"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="s2">"g5"</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="data.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Data Formats</div>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="advanced.html">
<svg><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>
<div class="title">Advanced Configuration</div>
</div>
</a>
</div>
<div class="related-information">
Copyright &#169; 2021-2022, Magnus Persson |
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
<a href="https://github.com/pradyunsg/furo">Furo theme</a>.
</div>
</footer>
</div>
<aside class="toc-drawer">
<div class="toc-sticky toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
Contents
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">REST API</a><ul>
<li><a class="reference internal" href="#get-api-config">GET: /api/config</a></li>
<li><a class="reference internal" href="#get-api-device">GET: /api/device</a></li>
<li><a class="reference internal" href="#get-api-status">GET: /api/status</a></li>
<li><a class="reference internal" href="#get-api-config-formula">GET: /api/config/formula</a></li>
<li><a class="reference internal" href="#post-api-config-device">POST: /api/config/device</a></li>
<li><a class="reference internal" href="#post-api-config-push">POST: /api/config/push</a></li>
<li><a class="reference internal" href="#post-api-config-gravity">POST: /api/config/gravity</a></li>
<li><a class="reference internal" href="#post-api-config-hardware">POST: /api/config/hardware</a></li>
<li><a class="reference internal" href="#post-api-config-formula">POST: /api/config/formula</a></li>
<li><a class="reference internal" href="#calling-the-api-s-from-python">Calling the APIs from Python</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</aside>
</div>
</div><script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/scripts/furo.js"></script>
</body>
</html>

View File

@ -2,10 +2,10 @@
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Contributing" href="contributing.html" /><link rel="prev" title="Setting up device" href="configuration.html" />
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Contributing" href="contributing.html" /><link rel="prev" title="Data Formats" href="data.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Compiling the software - GravityMon 0.7.0 documentation</title>
<title>Compiling the software - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>
@ -344,14 +344,14 @@ So only enable enough debugging to troubleshoot your changes.</p>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="configuration.html">
<a class="prev-page" href="data.html">
<svg><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>
<div class="title">Setting up device</div>
<div class="title">Data Formats</div>
</div>
</a>

View File

@ -2,10 +2,10 @@
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Compiling the software" href="compiling.html" /><link rel="prev" title="Installation" href="installation.html" />
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Create formula" href="formula.html" /><link rel="prev" title="Installation" href="installation.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Setting up device - GravityMon 0.7.0 documentation</title>
<title>Configuration - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="#data-formats">Data Formats</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>
@ -194,8 +194,8 @@
</label>
</div>
<article role="main">
<div class="section" id="setting-up-device">
<span id="id1"></span><h1>Setting up device<a class="headerlink" href="#setting-up-device" title="Permalink to this headline"></a></h1>
<div class="section" id="configuration">
<span id="setting-up-device"></span><h1>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h1>
<p>The device can operate in two modes and must be in <code class="docutils literal notranslate"><span class="pre">configuration</span> <span class="pre">mode</span></code> in order for the web server to be active.</p>
<p>One of the following conditions will place the device in <code class="docutils literal notranslate"><span class="pre">configuration</span> <span class="pre">mode</span></code>:</p>
<ul class="simple">
@ -228,18 +228,19 @@ you are collecting angle/tilt for calibration. If this is unchecked the device w
</li>
<li><p><strong>Device name:</strong></p>
<blockquote>
<div><p>This is unique name of the device.</p>
<div><p>This is unique name of the device which is set in the configuration, also known as MDNS name.</p>
</div></blockquote>
</li>
<li><p><strong>Device ID:</strong></p>
<blockquote>
<div><p>This is unique identifier for the device (ESP8266 id), this is required when using the API as an API Key to safeguard against faulty requests.</p>
<div><p>This is unique identifier for the device (ESP8266 id), this is required when using the API as an API Key to safeguard
against faulty requests. This is the ESP8266 chip ID, so it should be unique.</p>
</div></blockquote>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h2>
<div class="section" id="id1">
<h2>Configuration<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
<p>URL: (<a class="reference external" href="http://gravmon.local/config">http://gravmon.local/config</a>)</p>
<div class="section" id="device-setting">
<h3>Device Setting<a class="headerlink" href="#device-setting" title="Permalink to this headline"></a></h3>
@ -252,18 +253,21 @@ you are collecting angle/tilt for calibration. If this is unchecked the device w
</li>
<li><p><strong>Temperature format:</strong></p>
<blockquote>
<div><p>Choose between Celsius and Farenheight</p>
<div><p>Choose between Celsius and Farenheight when displaying temperature.</p>
</div></blockquote>
</li>
<li><p><strong>Interval:</strong></p>
<blockquote>
<div><p>This defines how long the device should be sleeping between the readings when in <cite>gravity monitoring</cite> mode. You will also see the values in minutes/seconds to easier set the interval. 900s is a recommended interval.</p>
<div><p>This defines how long the device should be sleeping between the readings when in <cite>gravity monitoring</cite> mode. You will also see
the values in minutes/seconds to easier set the interval. 900s is a recommended interval. The sleep interval can
be set between 10 - 3600 seconds (60 minutes).</p>
</div></blockquote>
</li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The sleep interval can be set between 10 - 3600 seconds (60 minutes).</p>
<p>A low value such as 30s will give a lifespan of 1-2 weeks and 300s (5 min) would last for 3+ weeks. This assumes that
there is good wifi connection that takes less than 1s to reconnect. Poor wifi connection is the main reason for battery drain.</p>
</div>
<ul>
<li><p><strong>Calibration values:</strong></p>
@ -288,25 +292,25 @@ battery life, so the decision is to prioritize battery life over security. The d
<ul>
<li><p><strong>HTTP URL 1:</strong></p>
<blockquote>
<div><p>Endpoint to send data via http. Default format used Format used <a class="reference internal" href="#data-formats-ispindle"><span class="std std-ref">iSpindle format</span></a>. You can customize the format using <a class="reference internal" href="#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
<div><p>Endpoint to send data via http. Default format used Format used <a class="reference internal" href="data.html#data-formats-ispindle"><span class="std std-ref">iSpindle format</span></a>. You can customize the format using <a class="reference internal" href="advanced.html#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
<p>If you add the prefix <cite>https://</cite> then the device will use SSL when sending data.</p>
</div></blockquote>
</li>
<li><p><strong>HTTP URL 2:</strong></p>
<blockquote>
<div><p>Endpoint to send data via http. Default format used <a class="reference internal" href="#data-formats-ispindle"><span class="std std-ref">iSpindle format</span></a>. You can customize the format using <a class="reference internal" href="#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
<div><p>Endpoint to send data via http. Default format used <a class="reference internal" href="data.html#data-formats-ispindle"><span class="std std-ref">iSpindle format</span></a>. You can customize the format using <a class="reference internal" href="advanced.html#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
<p>If you add the prefix <cite>https://</cite> then the device will use SSL when sending data.</p>
</div></blockquote>
</li>
<li><p><strong>Brewfather URL:</strong></p>
<blockquote>
<div><p>Endpoint to send data via http to brewfather. Format used <a class="reference internal" href="#data-formats-brewfather"><span class="std std-ref">Brewfather format</span></a></p>
<div><p>Endpoint to send data via http to brewfather. Format used <a class="reference internal" href="data.html#data-formats-brewfather"><span class="std std-ref">Brewfather format</span></a></p>
<p>SSL is not supported for this target.</p>
</div></blockquote>
</li>
<li><p><strong>Influx DB v2 URL:</strong></p>
<blockquote>
<div><p>Endpoint to send data via http to InfluxDB. Format used <a class="reference internal" href="#data-formats-influxdb2"><span class="std std-ref">Influx DB v2</span></a>. You can customize the format using <a class="reference internal" href="#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
<div><p>Endpoint to send data via http to InfluxDB. Format used <a class="reference internal" href="data.html#data-formats-influxdb2"><span class="std std-ref">Influx DB v2</span></a>. You can customize the format using <a class="reference internal" href="advanced.html#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
<p>SSL is not supported for this target. Raise a issue on github if this is wanted.</p>
</div></blockquote>
</li>
@ -327,7 +331,7 @@ battery life, so the decision is to prioritize battery life over security. The d
</li>
<li><p><strong>MQTT server:</strong></p>
<blockquote>
<div><p>IP or name of server to send data to. Default format used <a class="reference internal" href="#data-formats-mqtt"><span class="std std-ref">MQTT</span></a>. You can customize the format using <a class="reference internal" href="#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
<div><p>IP or name of server to send data to. Default format used <a class="reference internal" href="data.html#data-formats-mqtt"><span class="std std-ref">MQTT</span></a>. You can customize the format using <a class="reference internal" href="advanced.html#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
</div></blockquote>
</li>
<li><p><strong>MQTT Port:</strong></p>
@ -353,18 +357,21 @@ battery life, so the decision is to prioritize battery life over security. The d
<ul>
<li><p><strong>Gravity format:</strong></p>
<blockquote>
<div><p>Gravity format can be eihter <cite>SG</cite> or <cite>Plato</cite>. The device will use SG Internally and convert to Plato when displaying data.</p>
<div><p>Gravity format can be eihter <cite>SG</cite> or <cite>Plato</cite>. The device will use SG Internally and convert to Plato when displaying or sending data.</p>
</div></blockquote>
</li>
<li><p><strong>Gravity formula:</strong></p>
<blockquote>
<div><p>Gravity formula is compatible with standard iSpindle formulas so any existing calculation option can be used. You can also use
the feature to create the formula by supplying the raw data. See <a class="reference internal" href="#create-formula"><span class="std std-ref">Create formula</span></a></p>
the feature to create the formula by supplying the raw data. See <a class="reference internal" href="formula.html#create-formula"><span class="std std-ref">Create formula</span></a></p>
<p>The gravity formula accepts to paramaters, <strong>tilt</strong> for the angle or <strong>temp</strong> for temperature (temperature inserted into the formula
will be in celsius). I would recommend to use the formula calculation feature instead since this is much easier.</p>
</div></blockquote>
</li>
<li><p><strong>Temperature correct gravity:</strong></p>
<blockquote>
<div><p>Will apply a temperature calibration formula to the gravity as a second step.</p>
<div><p>Will apply a temperature calibration formula to the gravity as a second step after gravity has been calculated. Its also possible to
build this into the gravity formula.</p>
</div></blockquote>
</li>
</ul>
@ -403,7 +410,7 @@ been running the value would be totally off.</p>
</li>
<li><p><strong>OTA URL:</strong></p>
<blockquote>
<div><p>Should point to a URL where the .bin file + version.json file is located.</p>
<div><p>Should point to a URL where the firmware.bin file + version.json file are located.</p>
<p>For the OTA to work, place the following files (version.json + firmware.bin) at the location that you pointed out in OTA URL. If the version number in the json file is newer than in the
code the update will be done during startup.</p>
<p>If you have the previx <cite>https://</cite> then the device will use secure transfer without CA validation.</p>
@ -416,528 +423,6 @@ code the update will be done during startup.</p>
</div>
</div>
</div>
</div>
<div class="section" id="format-editor">
<span id="id2"></span><h1>Format editor<a class="headerlink" href="#format-editor" title="Permalink to this headline"></a></h1>
<p>To reduce the need for adding custom endpoints for various services there is an built in format editor that allows the user to customize the format being sent to the push target.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Since the format templates can be big this function can be quite slow on a small device such as the esp8266.</p>
</div>
<a class="reference internal image-reference" href="_images/format.png"><img alt="Format editor" src="_images/format.png" style="width: 800px;"/></a>
<p>You enter the format data in the text field and the test button will show an example on what the output would look like. If the data cannot be formatted in json it will just be displayed as a long string.
The save button will save the current formla and reload the data from the device.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>If you save a blank string the default template will be loaded.</p>
</div>
<p>These are the format keys available for use in the format.</p>
<div class="table-wrapper"><table class="colwidths-given docutils align-default" id="id6">
<caption><span class="caption-text">Directory structure</span><a class="headerlink" href="#id6" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 30%"/>
<col style="width: 50%"/>
<col style="width: 20%"/>
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>key</p></th>
<th class="head"><p>description</p></th>
<th class="head"><p>example</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>${mdns}</p></td>
<td><p>Name of the device</p></td>
<td><p>gravmon2</p></td>
</tr>
<tr class="row-odd"><td><p>${id}</p></td>
<td><p>Unique id of the device</p></td>
<td><p>e422a3</p></td>
</tr>
<tr class="row-even"><td><p>${sleep-interval}</p></td>
<td><p>Seconds between data is pushed</p></td>
<td><p>900</p></td>
</tr>
<tr class="row-odd"><td><p>${temp}</p></td>
<td><p>Temperature in format configured on device, one decimal</p></td>
<td><p>21.2</p></td>
</tr>
<tr class="row-even"><td><p>${temp-c}</p></td>
<td><p>Temperature in C, one decimal</p></td>
<td><p>21.2</p></td>
</tr>
<tr class="row-odd"><td><p>${temp-f}</p></td>
<td><p>Temperature in F, one decimal</p></td>
<td><p>58.0</p></td>
</tr>
<tr class="row-even"><td><p>${temp-unit}</p></td>
<td><p>Temperature format <cite>C</cite> or <cite>F</cite></p></td>
<td><p>C</p></td>
</tr>
<tr class="row-odd"><td><p>${battery}</p></td>
<td><p>Battery voltage, two decimals</p></td>
<td><p>3.89</p></td>
</tr>
<tr class="row-even"><td><p>${rssi}</p></td>
<td><p>Wifi signal strength</p></td>
<td><p>-75</p></td>
</tr>
<tr class="row-odd"><td><p>${run-time}</p></td>
<td><p>How long the last measurement took, two decimals</p></td>
<td><p>3.87</p></td>
</tr>
<tr class="row-even"><td><p>${angle}</p></td>
<td><p>Angle of the gyro, two decimals</p></td>
<td><p>28.67</p></td>
</tr>
<tr class="row-odd"><td><p>${tilt}</p></td>
<td><p>Same as angle.</p></td>
<td><p>28.67</p></td>
</tr>
<tr class="row-even"><td><p>${gravity}</p></td>
<td><p>Calculated gravity, 4 decimals for SG and 1 for Plato.</p></td>
<td><p>1.0456</p></td>
</tr>
<tr class="row-odd"><td><p>${gravity-sg}</p></td>
<td><p>Calculated gravity in SG, 4 decimals</p></td>
<td><p>1.0456</p></td>
</tr>
<tr class="row-even"><td><p>${gravity-plato}</p></td>
<td><p>Calculated gravity in Plato, 1 decimal</p></td>
<td><p>8.5</p></td>
</tr>
<tr class="row-odd"><td><p>${corr-gravity}</p></td>
<td><p>Temperature corrected gravity, 4 decimals for SG and 1 for Plato.</p></td>
<td><p>1.0456</p></td>
</tr>
<tr class="row-even"><td><p>${corr-gravity-sg}</p></td>
<td><p>Temperature corrected gravity in SG, 4 decimals</p></td>
<td><p>1.0456</p></td>
</tr>
<tr class="row-odd"><td><p>${corr-gravity-plato}</p></td>
<td><p>Temperature corrected gravity in Plato, 1 decimal</p></td>
<td><p>8.5</p></td>
</tr>
<tr class="row-even"><td><p>${gravity-unit}</p></td>
<td><p>Gravity format, <cite>G</cite> or <cite>P</cite></p></td>
<td><p>G</p></td>
</tr>
</tbody>
</table></div>
</div>
<div class="section" id="create-formula">
<span id="id3"></span><h1>Create formula<a class="headerlink" href="#create-formula" title="Permalink to this headline"></a></h1>
<a class="reference internal image-reference" href="_images/formula1.png"><img alt="Formula data" src="_images/formula1.png" style="width: 800px;"/></a>
<p>Here you can enter up to 5 values (angles + gravity) that is then used to create the formula. Angles equal to zero will be regarded as empty even if there is a gravity reading.</p>
<a class="reference internal image-reference" href="_images/formula2.png"><img alt="Formula graph" src="_images/formula2.png" style="width: 800px;"/></a>
<p>Once the formula is created a graph over the entered values and a simulation of the formula will give you a nice overview on how the formula will work.</p>
</div>
<div class="section" id="rest-api">
<span id="id4"></span><h1>REST API<a class="headerlink" href="#rest-api" title="Permalink to this headline"></a></h1>
<p>All the APIs use a key called <code class="docutils literal notranslate"><span class="pre">ID</span></code> which is the unique device id (chip id). This is used as an API key when sending requests to the device.</p>
<div class="section" id="get-api-config">
<h2>GET: /api/config<a class="headerlink" href="#get-api-config" title="Permalink to this headline"></a></h2>
<p>Retrive the current configuation of the device via an HTTP GET command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">temp-format</span></code> can be either <code class="docutils literal notranslate"><span class="pre">C</span></code> or <code class="docutils literal notranslate"><span class="pre">F</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">gravity-format</span></code> is always <code class="docutils literal notranslate"><span class="pre">G</span></code> (plato is not yet supported)</p></li>
</ul>
<p>Other parameters are the same as in the configuration guide.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mdns"</span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ota-url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50:80/firmware/gravmon/"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"brewfather-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://log.brewfather.net/stream?id=Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50:9090/api/v1/Qwerty/telemetry"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push2"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50/ispindel"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50:8086"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-org"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-bucket"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-auth"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"192.168.1.50"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-port"</span><span class="p">:</span><span class="w"> </span><span class="mi">1883</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-user"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-pass"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"sleep-interval"</span><span class="p">:</span><span class="w"> </span><span class="mi">30</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"voltage-factor"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.59</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-formula"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"G"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-adjustment-value"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-temp-adjustment"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gyro-temp"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gyro-calibration-data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ax"</span><span class="p">:</span><span class="w"> </span><span class="mi">-330</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ay"</span><span class="p">:</span><span class="w"> </span><span class="mi">-2249</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"az"</span><span class="p">:</span><span class="w"> </span><span class="mi">1170</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gx"</span><span class="p">:</span><span class="w"> </span><span class="mi">99</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gy"</span><span class="p">:</span><span class="w"> </span><span class="mi">-6</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gz"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="w"></span>
<span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w"> </span><span class="nt">"angle"</span><span class="p">:</span><span class="w"> </span><span class="mf">90.93</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.105</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"battery"</span><span class="p">:</span><span class="w"> </span><span class="mf">0.04</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="get-api-device">
<h2>GET: /api/device<a class="headerlink" href="#get-api-device" title="Permalink to this headline"></a></h2>
<p>Retrive the current device settings via an HTTP GET command. Payload is in JSON format.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"app-name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"GravityMon "</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"app-ver"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0.0"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mdns"</span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="get-api-status">
<h2>GET: /api/status<a class="headerlink" href="#get-api-status" title="Permalink to this headline"></a></h2>
<p>Retrive the current device status via an HTTP GET command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">temp-format</span></code> can be either <code class="docutils literal notranslate"><span class="pre">C</span></code> or <code class="docutils literal notranslate"><span class="pre">F</span></code></p></li>
</ul>
<p>Other parameters are the same as in the configuration guide.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"angle"</span><span class="p">:</span><span class="w"> </span><span class="mf">89.86</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.1052</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-tempcorr"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.1031</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-c"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-f"</span><span class="p">:</span><span class="w"> </span><span class="mi">32</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"battery"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"sleep-mode"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"rssi"</span><span class="p">:</span><span class="w"> </span><span class="mi">-56</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="get-api-config-formula">
<h2>GET: /api/config/formula<a class="headerlink" href="#get-api-config-formula" title="Permalink to this headline"></a></h2>
<p>Retrive the data used for formula calculation data via an HTTP GET command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">a1</span></code>-<code class="docutils literal notranslate"><span class="pre">a4</span></code> are the angles/tilt readings (up to 5 are currently supported)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">g1</span></code>-<code class="docutils literal notranslate"><span class="pre">g4</span></code> are the corresponding gravity reaadings in SG or Plato depending on the device-format.</p></li>
</ul>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a1"</span><span class="p">:</span><span class="w"> </span><span class="mf">22.4</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a2"</span><span class="p">:</span><span class="w"> </span><span class="mf">54.4</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a3"</span><span class="p">:</span><span class="w"> </span><span class="mi">58</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a4"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a5"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g1"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.000</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g2"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.053</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g3"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.062</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g4"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g5"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"G"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-formula"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436"</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-device">
<h2>POST: /api/config/device<a class="headerlink" href="#post-api-config-device" title="Permalink to this headline"></a></h2>
<p>Used to update device settings via an HTTP POST command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">temp-format</span></code> can be either <code class="docutils literal notranslate"><span class="pre">C</span></code> (Celcius) or <code class="docutils literal notranslate"><span class="pre">F</span></code> (Farenheight)</p></li>
</ul>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mdns"</span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"sleep-interval"</span><span class="p">:</span><span class="w"> </span><span class="mi">30</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-push">
<h2>POST: /api/config/push<a class="headerlink" href="#post-api-config-push" title="Permalink to this headline"></a></h2>
<p>Used to update push settings via an HTTP POST command. Payload is in JSON format.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50/ispindel"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"http-push2"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"brewfather-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50:8086"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-org"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-bucket"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"influxdb2-auth"</span><span class="p">:</span><span class="w"> </span><span class="nt">"Qwerty"</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-push"</span><span class="p">:</span><span class="w"> </span><span class="s2">"192.168.1.50"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-port"</span><span class="p">:</span><span class="w"> </span><span class="mi">1883</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-user"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"mqtt-pass"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Qwerty"</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-gravity">
<h2>POST: /api/config/gravity<a class="headerlink" href="#post-api-config-gravity" title="Permalink to this headline"></a></h2>
<p>Used to update gravity settings via an HTTP POST command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">gravity-formula</span></code> keywords <code class="docutils literal notranslate"><span class="pre">temp</span></code> and <code class="docutils literal notranslate"><span class="pre">tilt</span></code> are supported.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">gravity-format</span></code> can be either <code class="docutils literal notranslate"><span class="pre">G</span></code> (SG) or <code class="docutils literal notranslate"><span class="pre">P</span></code> (PLATO)</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><code class="docutils literal notranslate"><span class="pre">gravity-temp-adjustment</span></code> is defined as “on” or “off” when posting since this is the output values
from a checkbox, when reading data its sent as boolean (true,false).</p>
</div>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-formula"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"P"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-temp-adjustment"</span><span class="p">:</span><span class="w"> </span><span class="s2">"off"</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-hardware">
<h2>POST: /api/config/hardware<a class="headerlink" href="#post-api-config-hardware" title="Permalink to this headline"></a></h2>
<p>Used to update hardware settings via an HTTP POST command. Payload is in JSON format.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><code class="docutils literal notranslate"><span class="pre">gyro-temp</span></code> is defined as “on” or “off” when posting since this is the output values from a checkbox, when
reading data its sent as boolean (true,false).</p>
</div>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"voltage-factor"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.59</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-adjustment"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gyro-temp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"off"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ota-url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://192.168.1.50/firmware/gravmon/"</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="post-api-config-formula">
<h2>POST: /api/config/formula<a class="headerlink" href="#post-api-config-formula" title="Permalink to this headline"></a></h2>
<p>Used to update formula calculation data via an HTTP POST command. Payload is in JSON format.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">a1</span></code>-<code class="docutils literal notranslate"><span class="pre">a4</span></code> are the angles/tilt readings (up to 5 are currently supported)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">g1</span></code>-<code class="docutils literal notranslate"><span class="pre">g4</span></code> are the corresponding gravity reaadings (in SG)</p></li>
</ul>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ee1bfc"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a1"</span><span class="p">:</span><span class="w"> </span><span class="mf">22.4</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a2"</span><span class="p">:</span><span class="w"> </span><span class="mf">54.4</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a3"</span><span class="p">:</span><span class="w"> </span><span class="mi">58</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a4"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"a5"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g1"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.000</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g2"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.053</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g3"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.062</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g4"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"g5"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="calling-the-api-s-from-python">
<h2>Calling the APIs from Python<a class="headerlink" href="#calling-the-api-s-from-python" title="Permalink to this headline"></a></h2>
<p>Here is some example code for how to access the APIs from a python script. Keys should always be
present or the API call will fail.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">requests</span>
<span class="kn">import</span> <span class="nn">json</span>
<span class="n">host</span> <span class="o">=</span> <span class="s2">"192.168.1.1"</span> <span class="c1"># IP adress (or name) of the device to send these settings to</span>
<span class="nb">id</span> <span class="o">=</span> <span class="s2">"ee1bfc"</span> <span class="c1"># Device ID (shown in serial console during startup or in UI)</span>
<span class="k">def</span> <span class="nf">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">):</span>
<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"ContentType"</span><span class="p">:</span> <span class="s2">"application/json"</span> <span class="p">}</span>
<span class="nb">print</span><span class="p">(</span> <span class="n">url</span> <span class="p">)</span>
<span class="n">resp</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">post</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">json</span> <span class="p">)</span>
<span class="k">if</span> <span class="n">resp</span><span class="o">.</span><span class="n">status_code</span> <span class="o">!=</span> <span class="mi">200</span> <span class="p">:</span>
<span class="nb">print</span> <span class="p">(</span> <span class="s2">"Failed "</span> <span class="p">)</span>
<span class="k">else</span> <span class="p">:</span>
<span class="nb">print</span> <span class="p">(</span> <span class="s2">"Success "</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/config/device"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"mdns"</span><span class="p">:</span> <span class="s2">"gravmon"</span><span class="p">,</span> <span class="c1"># Name of the device</span>
<span class="s2">"temp-format"</span><span class="p">:</span> <span class="s2">"C"</span><span class="p">,</span> <span class="c1"># Temperature format C or F</span>
<span class="s2">"sleep-interval"</span><span class="p">:</span> <span class="mi">30</span> <span class="c1"># Sleep interval in seconds</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/config/push"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"http-push"</span><span class="p">:</span> <span class="s2">"http://192.168.1.1/ispindel"</span><span class="p">,</span>
<span class="s2">"http-push2"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"brewfather-push"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"influxdb2-push"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"influxdb2-org"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"influxdb2-bucket"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"influxdb2-auth"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"mqtt-push"</span><span class="p">:</span> <span class="s2">"192.168.1.50"</span><span class="p">,</span>
<span class="s2">"mqtt-port"</span><span class="p">:</span> <span class="mi">1883</span><span class="p">,</span>
<span class="s2">"mqtt-user"</span><span class="p">:</span> <span class="s2">"Qwerty"</span><span class="p">,</span>
<span class="s2">"mqtt-pass"</span><span class="p">:</span> <span class="s2">"Qwerty"</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/config/gravity"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"gravity-formula"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>
<span class="s2">"gravity-format"</span><span class="p">:</span> <span class="s2">"P"</span><span class="p">,</span>
<span class="s2">"gravity-temp-adjustment"</span><span class="p">:</span> <span class="s2">"off"</span> <span class="c1"># Adjust gravity (on/off)</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/config/hardware"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"voltage-factor"</span><span class="p">:</span> <span class="mf">1.59</span><span class="p">,</span> <span class="c1"># Default value for voltage calculation</span>
<span class="s2">"temp-adjustment"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1"># If temp sensor needs to be corrected</span>
<span class="s2">"gyro-temp"</span><span class="p">:</span> <span class="s2">"on"</span><span class="p">,</span> <span class="c1"># Use the temp sensor in the gyro instead (on/off)</span>
<span class="s2">"ota-url"</span><span class="p">:</span> <span class="s2">""</span> <span class="c1"># if the device should seach for a new update when active</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
<span class="n">url</span> <span class="o">=</span> <span class="s2">"http://"</span> <span class="o">+</span> <span class="n">host</span> <span class="o">+</span> <span class="s2">"/api/formula"</span>
<span class="n">json</span> <span class="o">=</span> <span class="p">{</span> <span class="s2">"id"</span><span class="p">:</span> <span class="nb">id</span><span class="p">,</span>
<span class="s2">"a1"</span><span class="p">:</span> <span class="mf">22.4</span><span class="p">,</span>
<span class="s2">"a2"</span><span class="p">:</span> <span class="mf">54.4</span><span class="p">,</span>
<span class="s2">"a3"</span><span class="p">:</span> <span class="mi">58</span><span class="p">,</span>
<span class="s2">"a4"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">"a5"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">"g1"</span><span class="p">:</span> <span class="mf">1.000</span><span class="p">,</span>
<span class="s2">"g2"</span><span class="p">:</span> <span class="mf">1.053</span><span class="p">,</span>
<span class="s2">"g3"</span><span class="p">:</span> <span class="mf">1.062</span><span class="p">,</span>
<span class="s2">"g4"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="s2">"g5"</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
<span class="n">set_config</span><span class="p">(</span> <span class="n">url</span><span class="p">,</span> <span class="n">json</span> <span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="data-formats">
<span id="id5"></span><h1>Data Formats<a class="headerlink" href="#data-formats" title="Permalink to this headline"></a></h1>
<div class="section" id="ispindle-format">
<span id="data-formats-ispindle"></span><h2>iSpindle format<a class="headerlink" href="#ispindle-format" title="Permalink to this headline"></a></h2>
<p>This is the format used for standard http posts.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">corr-gravity</span></code> is an extended parameter containing a temperature corrected gravity reading.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">gravity-format</span></code> is an extended parameter containing the gravity format (G or P).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">run-time</span></code> is an extended parameter containing the number of seconds the execution took.</p></li>
</ul>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"name"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ID"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2E6753"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"token"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"interval"</span><span class="p">:</span><span class="w"> </span><span class="mi">900</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temperature"</span><span class="p">:</span><span class="w"> </span><span class="mf">20.5</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-units"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.0050</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"angle"</span><span class="p">:</span><span class="w"> </span><span class="mf">45.34</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"battery"</span><span class="p">:</span><span class="w"> </span><span class="mf">3.67</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"rssi"</span><span class="p">:</span><span class="w"> </span><span class="mi">-12</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"corr-gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.0050</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-unit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"G"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"run-time"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
<p>This is the format template used to create the json above.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>{
"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}
}
</pre></div>
</div>
</div>
<div class="section" id="brewfather-format">
<span id="data-formats-brewfather"></span><h2>Brewfather format<a class="headerlink" href="#brewfather-format" title="Permalink to this headline"></a></h2>
<p>This is the format for Brewfather. See: <a class="reference external" href="https://docs.brewfather.app/integrations/custom-stream">Brewfather API docs</a></p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"name"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp"</span><span class="p">:</span><span class="w"> </span><span class="mf">20.5</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp_unit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"battery"</span><span class="p">:</span><span class="w"> </span><span class="mf">3.67</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.0050</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity_unit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"G"</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="influx-db-v2">
<span id="data-formats-influxdb2"></span><h2>Influx DB v2<a class="headerlink" href="#influx-db-v2" title="Permalink to this headline"></a></h2>
<p>This is the format for InfluxDB v2</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">measurement</span><span class="p">,</span><span class="n">host</span><span class="o">=&lt;</span><span class="n">mdns</span><span class="o">&gt;</span><span class="p">,</span><span class="n">device</span><span class="o">=&lt;</span><span class="nb">id</span><span class="o">&gt;</span><span class="p">,</span><span class="n">temp</span><span class="o">-</span><span class="nb">format</span><span class="o">=&lt;</span><span class="n">C</span><span class="o">|</span><span class="n">F</span><span class="o">&gt;</span><span class="p">,</span><span class="n">gravity</span><span class="o">-</span><span class="nb">format</span><span class="o">=</span><span class="n">SG</span><span class="p">,</span><span class="n">gravity</span><span class="o">=</span><span class="mf">1.0004</span><span class="p">,</span><span class="n">corr</span><span class="o">-</span><span class="n">gravity</span><span class="o">=</span><span class="mf">1.0004</span><span class="p">,</span><span class="n">angle</span><span class="o">=</span><span class="mf">45.45</span><span class="p">,</span><span class="n">temp</span><span class="o">=</span><span class="mf">20.1</span><span class="p">,</span><span class="n">battery</span><span class="o">=</span><span class="mf">3.96</span><span class="p">,</span><span class="n">rssi</span><span class="o">=-</span><span class="mi">18</span>
</pre></div>
</div>
<p>This is the format template used to create the json above.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>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}
</pre></div>
</div>
</div>
<div class="section" id="mqtt">
<span id="data-formats-mqtt"></span><h2>MQTT<a class="headerlink" href="#mqtt" title="Permalink to this headline"></a></h2>
<p>This is the format used to send data to MQTT. Each of the lines are specific topics</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">tilt</span> <span class="mf">89.96796</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">temperature</span> <span class="mf">21.375</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">temp_units</span> <span class="n">C</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">battery</span> <span class="mf">0.04171</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">gravity</span> <span class="mf">33.54894</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">interval</span> <span class="mi">1</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">RSSI</span> <span class="o">-</span><span class="mi">58</span>
</pre></div>
</div>
<p>This is the format template used to create the json above.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Each line in the format is treated as one topic. The <cite>|</cite> is used as separator between lines and the first <cite>:</cite> is used as separator between topic and value. Each line is formatted as <cite>&lt;topic&gt;:&lt;value&gt;</cite></p>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>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}|
</pre></div>
</div>
<p>This is a format template that is compatible with v0.6. Just replace the <cite>topic</cite> with the topic you want to post data to.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>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}}|
</pre></div>
</div>
</div>
<div class="section" id="version-json">
<h2>version.json<a class="headerlink" href="#version-json" title="Permalink to this headline"></a></h2>
<p>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 its 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.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"project"</span><span class="p">:</span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"version"</span><span class="p">:</span><span class="s2">"0.7.0"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"html"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
<span class="w"> </span><span class="s2">"index.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"device.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"config.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"format.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"calibration.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"about.min.htm"</span><span class="w"></span>
<span class="w"> </span><span class="p">]</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
</div>
</article>
@ -945,12 +430,12 @@ they can be uploaded manually afterwards.</p>
<footer>
<div class="related-pages">
<a class="next-page" href="compiling.html">
<a class="next-page" href="formula.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Compiling the software</div>
<div class="title">Create formula</div>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>
@ -987,10 +472,10 @@ they can be uploaded manually afterwards.</p>
<div class="toc-tree-container">
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">Setting up device</a><ul>
<li><a class="reference internal" href="#">Configuration</a><ul>
<li><a class="reference internal" href="#status">Status</a></li>
<li><a class="reference internal" href="#device">Device</a></li>
<li><a class="reference internal" href="#configuration">Configuration</a><ul>
<li><a class="reference internal" href="#id1">Configuration</a><ul>
<li><a class="reference internal" href="#device-setting">Device Setting</a></li>
<li><a class="reference internal" href="#push-settings">Push Settings</a></li>
<li><a class="reference internal" href="#gravity-settings">Gravity Settings</a></li>
@ -999,29 +484,6 @@ they can be uploaded manually afterwards.</p>
</li>
</ul>
</li>
<li><a class="reference internal" href="#format-editor">Format editor</a></li>
<li><a class="reference internal" href="#create-formula">Create formula</a></li>
<li><a class="reference internal" href="#rest-api">REST API</a><ul>
<li><a class="reference internal" href="#get-api-config">GET: /api/config</a></li>
<li><a class="reference internal" href="#get-api-device">GET: /api/device</a></li>
<li><a class="reference internal" href="#get-api-status">GET: /api/status</a></li>
<li><a class="reference internal" href="#get-api-config-formula">GET: /api/config/formula</a></li>
<li><a class="reference internal" href="#post-api-config-device">POST: /api/config/device</a></li>
<li><a class="reference internal" href="#post-api-config-push">POST: /api/config/push</a></li>
<li><a class="reference internal" href="#post-api-config-gravity">POST: /api/config/gravity</a></li>
<li><a class="reference internal" href="#post-api-config-hardware">POST: /api/config/hardware</a></li>
<li><a class="reference internal" href="#post-api-config-formula">POST: /api/config/formula</a></li>
<li><a class="reference internal" href="#calling-the-api-s-from-python">Calling the APIs from Python</a></li>
</ul>
</li>
<li><a class="reference internal" href="#data-formats">Data Formats</a><ul>
<li><a class="reference internal" href="#ispindle-format">iSpindle format</a></li>
<li><a class="reference internal" href="#brewfather-format">Brewfather format</a></li>
<li><a class="reference internal" href="#influx-db-v2">Influx DB v2</a></li>
<li><a class="reference internal" href="#mqtt">MQTT</a></li>
<li><a class="reference internal" href="#version-json">version.json</a></li>
</ul>
</li>
</ul>
</div>

View File

@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Q &amp; A" href="q_and_a.html" /><link rel="prev" title="Compiling the software" href="compiling.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Contributing - GravityMon 0.7.0 documentation</title>
<title>Contributing - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>

392
docs/data.html Normal file
View File

@ -0,0 +1,392 @@
<!doctype html>
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Compiling the software" href="compiling.html" /><link rel="prev" title="REST API" href="api.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Data Formats - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
<style>
body {
--color-code-background: #f8f8f8;
--color-code-foreground: black;
}
body[data-theme="dark"] {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
}
</style></head>
<body>
<script>
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
</script>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-toc" viewBox="0 0 24 24">
<title>Contents</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<line x1="4" y1="6" x2="20" y2="6" />
<line x1="10" y1="12" x2="20" y2="12" />
<line x1="6" y1="18" x2="20" y2="18" />
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24">
<title>Light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24">
<title>Dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
</svg>
</symbol>
<symbol id="svg-sun-half" viewBox="0 0 24 24">
<title>Auto light/dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r="9" />
<path d="M13 12h5" />
<path d="M13 15h4" />
<path d="M13 18h1" />
<path d="M13 9h4" />
<path d="M13 6h1" />
</svg>
</symbol>
</svg>
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
<label class="overlay sidebar-overlay" for="__navigation">
<div class="visually-hidden">Hide navigation sidebar</div>
</label>
<label class="overlay toc-overlay" for="__toc">
<div class="visually-hidden">Hide table of contents sidebar</div>
</label>
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<div class="visually-hidden">Toggle site navigation sidebar</div>
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="license.html">Licence</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
</ul>
</div>
</div>
</div>
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<div class="content-icon-container">
<div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
<article role="main">
<div class="section" id="data-formats">
<span id="id1"></span><h1>Data Formats<a class="headerlink" href="#data-formats" title="Permalink to this headline"></a></h1>
<div class="section" id="ispindle-format">
<span id="data-formats-ispindle"></span><h2>iSpindle format<a class="headerlink" href="#ispindle-format" title="Permalink to this headline"></a></h2>
<p>This is the format used for standard http posts.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">corr-gravity</span></code> is an extended parameter containing a temperature corrected gravity reading.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">gravity-format</span></code> is an extended parameter containing the gravity format (G or P).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">run-time</span></code> is an extended parameter containing the number of seconds the execution took.</p></li>
</ul>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"name"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"ID"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2E6753"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"token"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"interval"</span><span class="p">:</span><span class="w"> </span><span class="mi">900</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temperature"</span><span class="p">:</span><span class="w"> </span><span class="mf">20.5</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp-units"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.0050</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"angle"</span><span class="p">:</span><span class="w"> </span><span class="mf">45.34</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"battery"</span><span class="p">:</span><span class="w"> </span><span class="mf">3.67</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"rssi"</span><span class="p">:</span><span class="w"> </span><span class="mi">-12</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"corr-gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.0050</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity-unit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"G"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"run-time"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
<p>This is the format template used to create the json above.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>{
"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}
}
</pre></div>
</div>
</div>
<div class="section" id="brewfather-format">
<span id="data-formats-brewfather"></span><h2>Brewfather format<a class="headerlink" href="#brewfather-format" title="Permalink to this headline"></a></h2>
<p>This is the format for Brewfather. See: <a class="reference external" href="https://docs.brewfather.app/integrations/custom-stream">Brewfather API docs</a></p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"name"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp"</span><span class="p">:</span><span class="w"> </span><span class="mf">20.5</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"temp_unit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"C"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"battery"</span><span class="p">:</span><span class="w"> </span><span class="mf">3.67</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity"</span><span class="p">:</span><span class="w"> </span><span class="mf">1.0050</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"gravity_unit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"G"</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
<div class="section" id="influx-db-v2">
<span id="data-formats-influxdb2"></span><h2>Influx DB v2<a class="headerlink" href="#influx-db-v2" title="Permalink to this headline"></a></h2>
<p>This is the format for InfluxDB v2</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">measurement</span><span class="p">,</span><span class="n">host</span><span class="o">=&lt;</span><span class="n">mdns</span><span class="o">&gt;</span><span class="p">,</span><span class="n">device</span><span class="o">=&lt;</span><span class="nb">id</span><span class="o">&gt;</span><span class="p">,</span><span class="n">temp</span><span class="o">-</span><span class="nb">format</span><span class="o">=&lt;</span><span class="n">C</span><span class="o">|</span><span class="n">F</span><span class="o">&gt;</span><span class="p">,</span><span class="n">gravity</span><span class="o">-</span><span class="nb">format</span><span class="o">=</span><span class="n">SG</span><span class="p">,</span><span class="n">gravity</span><span class="o">=</span><span class="mf">1.0004</span><span class="p">,</span><span class="n">corr</span><span class="o">-</span><span class="n">gravity</span><span class="o">=</span><span class="mf">1.0004</span><span class="p">,</span><span class="n">angle</span><span class="o">=</span><span class="mf">45.45</span><span class="p">,</span><span class="n">temp</span><span class="o">=</span><span class="mf">20.1</span><span class="p">,</span><span class="n">battery</span><span class="o">=</span><span class="mf">3.96</span><span class="p">,</span><span class="n">rssi</span><span class="o">=-</span><span class="mi">18</span>
</pre></div>
</div>
<p>This is the format template used to create the json above.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>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}
</pre></div>
</div>
</div>
<div class="section" id="mqtt">
<span id="data-formats-mqtt"></span><h2>MQTT<a class="headerlink" href="#mqtt" title="Permalink to this headline"></a></h2>
<p>This is the format used to send data to MQTT. Each of the lines are specific topics</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">tilt</span> <span class="mf">89.96796</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">temperature</span> <span class="mf">21.375</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">temp_units</span> <span class="n">C</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">battery</span> <span class="mf">0.04171</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">gravity</span> <span class="mf">33.54894</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">interval</span> <span class="mi">1</span>
<span class="n">ispindel</span><span class="o">/</span><span class="n">device_name</span><span class="o">/</span><span class="n">RSSI</span> <span class="o">-</span><span class="mi">58</span>
</pre></div>
</div>
<p>This is the format template used to create the json above.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Each line in the format is treated as one topic. The <cite>|</cite> is used as separator between lines and the first <cite>:</cite> is used as separator between topic and value. Each line is formatted as <cite>&lt;topic&gt;:&lt;value&gt;</cite></p>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>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}|
</pre></div>
</div>
<p>This is a format template that is compatible with v0.6. Just replace the <cite>topic</cite> with the topic you want to post data to.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>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}}|
</pre></div>
</div>
</div>
<div class="section" id="version-json">
<h2>version.json<a class="headerlink" href="#version-json" title="Permalink to this headline"></a></h2>
<p>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 its 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.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="nt">"project"</span><span class="p">:</span><span class="s2">"gravmon"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"version"</span><span class="p">:</span><span class="s2">"0.7.0"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="nt">"html"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
<span class="w"> </span><span class="s2">"index.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"device.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"config.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"format.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"calibration.min.htm"</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s2">"about.min.htm"</span><span class="w"></span>
<span class="w"> </span><span class="p">]</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
</div>
</div>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="compiling.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Compiling the software</div>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="api.html">
<svg><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>
<div class="title">REST API</div>
</div>
</a>
</div>
<div class="related-information">
Copyright &#169; 2021-2022, Magnus Persson |
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
<a href="https://github.com/pradyunsg/furo">Furo theme</a>.
</div>
</footer>
</div>
<aside class="toc-drawer">
<div class="toc-sticky toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
Contents
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">Data Formats</a><ul>
<li><a class="reference internal" href="#ispindle-format">iSpindle format</a></li>
<li><a class="reference internal" href="#brewfather-format">Brewfather format</a></li>
<li><a class="reference internal" href="#influx-db-v2">Influx DB v2</a></li>
<li><a class="reference internal" href="#mqtt">MQTT</a></li>
<li><a class="reference internal" href="#version-json">version.json</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</aside>
</div>
</div><script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/scripts/furo.js"></script>
</body>
</html>

252
docs/formula.html Normal file
View File

@ -0,0 +1,252 @@
<!doctype html>
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Service Integration" href="services.html" /><link rel="prev" title="Configuration" href="configuration.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Create formula - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
<style>
body {
--color-code-background: #f8f8f8;
--color-code-foreground: black;
}
body[data-theme="dark"] {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
}
</style></head>
<body>
<script>
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
</script>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-toc" viewBox="0 0 24 24">
<title>Contents</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<line x1="4" y1="6" x2="20" y2="6" />
<line x1="10" y1="12" x2="20" y2="12" />
<line x1="6" y1="18" x2="20" y2="18" />
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24">
<title>Light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24">
<title>Dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
</svg>
</symbol>
<symbol id="svg-sun-half" viewBox="0 0 24 24">
<title>Auto light/dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r="9" />
<path d="M13 12h5" />
<path d="M13 15h4" />
<path d="M13 18h1" />
<path d="M13 9h4" />
<path d="M13 6h1" />
</svg>
</symbol>
</svg>
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
<label class="overlay sidebar-overlay" for="__navigation">
<div class="visually-hidden">Hide navigation sidebar</div>
</label>
<label class="overlay toc-overlay" for="__toc">
<div class="visually-hidden">Hide table of contents sidebar</div>
</label>
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<div class="visually-hidden">Toggle site navigation sidebar</div>
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon no-toc" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="license.html">Licence</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
</ul>
</div>
</div>
</div>
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<div class="content-icon-container">
<div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon no-toc" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
<article role="main">
<div class="section" id="create-formula">
<span id="id1"></span><h1>Create formula<a class="headerlink" href="#create-formula" title="Permalink to this headline"></a></h1>
<a class="reference internal image-reference" href="_images/formula1.png"><img alt="Formula data" src="_images/formula1.png" style="width: 800px;"/></a>
<p>Here you can enter up to 5 values (angles + gravity) that is then used to create the formula. Angles equal to zero will be regarded as empty even if there is a gravity reading.</p>
<a class="reference internal image-reference" href="_images/formula2.png"><img alt="Formula graph" src="_images/formula2.png" style="width: 800px;"/></a>
<p>Once the formula is created a graph over the entered values and a simulation of the formula will give you a nice overview on how the formula will work.</p>
</div>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="services.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Service Integration</div>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="configuration.html">
<svg><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>
<div class="title">Configuration</div>
</div>
</a>
</div>
<div class="related-information">
Copyright &#169; 2021-2022, Magnus Persson |
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
<a href="https://github.com/pradyunsg/furo">Furo theme</a>.
</div>
</footer>
</div>
<aside class="toc-drawer no-toc">
</aside>
</div>
</div><script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/scripts/furo.js"></script>
</body>
</html>

View File

@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Installation" href="installation.html" /><link rel="prev" title="Releases" href="releases.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Functionallity - GravityMon 0.7.0 documentation</title>
<title>Functionallity - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>
@ -208,7 +208,7 @@ via an REST API so data can be pushed to the device via scripts (see API section
<p>You can force the device into <code class="docutils literal notranslate"><span class="pre">configuration</span> <span class="pre">mode</span></code> while measuring gravity. This is useful when calibrating
the device so you dont needs to wait for the device to wake up and push the data. The entire calibration
sequence can be handled via the web interface without need for additional software tools.</p>
<p>See the <a class="reference internal" href="configuration.html#setting-up-device"><span class="std std-ref">Setting up device</span></a> section for more information on how to trigger the configuration mode.</p>
<p>See the <a class="reference internal" href="configuration.html#setting-up-device"><span class="std std-ref">Configuration</span></a> section for more information on how to trigger the configuration mode.</p>
</li>
<li><p><strong>Can send data to multiple endpoints at once</strong></p>
<p>The original iSpindle can only have one destination, this software will push data to all defined endpoints so
@ -230,7 +230,7 @@ angle/gravity data that you have collected. You will also see a graph simulating
<p>In order to make it easier to support more targets there is a built in format editor that can be used to
customize the data that is to be sent. This way you can easily adapt the software to new targets without coding.
If you have a good template please share it on the girhub repository and I will add it to the documentation
for other users to enjoy. See the <a class="reference internal" href="configuration.html#format-editor"><span class="std std-ref">Format editor</span></a> for more information.</p>
for other users to enjoy. See the <a class="reference internal" href="advanced.html#format-editor"><span class="std std-ref">Format editor</span></a> for more information.</p>
</li>
</ul>
<div class="admonition note">

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="#" /><link rel="search" title="Search" href="search.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/><title>Index - GravityMon 0.7.0 documentation</title>
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/><title>Index - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -121,7 +121,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -144,7 +144,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -158,15 +158,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>

View File

@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Licence" href="license.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>GravityMon 0.7.0 documentation</title>
<title>GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="#"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="#"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="#">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>
@ -198,7 +198,7 @@
<h1>Welcome to GravityMons documentation!<a class="headerlink" href="#welcome-to-gravitymon-s-documentation" title="Permalink to this headline"></a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This documentation reflects <strong>v0.7</strong>. Last updated 2022-01-23</p>
<p>This documentation reflects <strong>v0.7.1</strong>. Last updated 2022-01-30</p>
</div>
<p>GravityMon is a replacement firmare for the iSpindle firmware, it uses the same hardware configuration so
you can easily switch between them.</p>
@ -287,6 +287,7 @@ the following libraries and without these this would have been much more difficu
<ul>
<li class="toctree-l1"><a class="reference internal" href="license.html">Licence</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a><ul>
<li class="toctree-l2"><a class="reference internal" href="releases.html#v0-7-1">v0.7.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#v0-7-0">v0.7.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#v0-6-0">v0.6.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#v0-5-0">v0.5.0</a></li>
@ -308,33 +309,44 @@ the following libraries and without these this would have been much more difficu
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuring-wifi">Configuring WIFI</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a><ul>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#status">Status</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#device">Device</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#configuration">Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#id1">Configuration</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#get-api-config">GET: /api/config</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#get-api-device">GET: /api/device</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#get-api-status">GET: /api/status</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#get-api-config-formula">GET: /api/config/formula</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#post-api-config-device">POST: /api/config/device</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#post-api-config-push">POST: /api/config/push</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#post-api-config-gravity">POST: /api/config/gravity</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#post-api-config-hardware">POST: /api/config/hardware</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#post-api-config-formula">POST: /api/config/formula</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#calling-the-api-s-from-python">Calling the APIs from Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="services.html#brewfather">Brewfather</a></li>
<li class="toctree-l2"><a class="reference internal" href="services.html#fermentrack">Fermentrack</a></li>
<li class="toctree-l2"><a class="reference internal" href="services.html#ubidots">UBIdots</a></li>
<li class="toctree-l2"><a class="reference internal" href="services.html#home-assistant">Home Assistant</a></li>
<li class="toctree-l2"><a class="reference internal" href="services.html#brewer-s-friend">Brewers Friend</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a><ul>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#ispindle-format">iSpindle format</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#brewfather-format">Brewfather format</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#influx-db-v2">Influx DB v2</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#mqtt">MQTT</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html#version-json">version.json</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#format-editor">Format editor</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api.html#get-api-config">GET: /api/config</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#get-api-device">GET: /api/device</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#get-api-status">GET: /api/status</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#get-api-config-formula">GET: /api/config/formula</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#post-api-config-device">POST: /api/config/device</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#post-api-config-push">POST: /api/config/push</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#post-api-config-gravity">POST: /api/config/gravity</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#post-api-config-hardware">POST: /api/config/hardware</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#post-api-config-formula">POST: /api/config/formula</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#calling-the-api-s-from-python">Calling the APIs from Python</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a><ul>
<li class="toctree-l2"><a class="reference internal" href="data.html#ispindle-format">iSpindle format</a></li>
<li class="toctree-l2"><a class="reference internal" href="data.html#brewfather-format">Brewfather format</a></li>
<li class="toctree-l2"><a class="reference internal" href="data.html#influx-db-v2">Influx DB v2</a></li>
<li class="toctree-l2"><a class="reference internal" href="data.html#mqtt">MQTT</a></li>
<li class="toctree-l2"><a class="reference internal" href="data.html#version-json">version.json</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a><ul>
@ -350,11 +362,6 @@ the following libraries and without these this would have been much more difficu
<li class="toctree-l2"><a class="reference internal" href="q_and_a.html#my-device-is-no-going-in-to-sleep-after-fully-charged">My device is no going in to sleep after fully charged</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="backlog.html#documentation">Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="backlog.html#code">Code</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="indices-and-tables">

View File

@ -2,10 +2,10 @@
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Setting up device" href="configuration.html" /><link rel="prev" title="Functionallity" href="functionallity.html" />
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Configuration" href="configuration.html" /><link rel="prev" title="Functionallity" href="functionallity.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Installation - GravityMon 0.7.0 documentation</title>
<title>Installation - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>
@ -256,7 +256,7 @@ in the browser: <strong>http://192.168.4.1</strong></p>
<div class="context">
<span>Next</span>
</div>
<div class="title">Setting up device</div>
<div class="title">Configuration</div>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>

View File

@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Releases" href="releases.html" /><link rel="prev" title="Welcome to GravityMons documentation!" href="index.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Licence - GravityMon 0.7.0 documentation</title>
<title>Licence - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>

Binary file not shown.

View File

@ -2,10 +2,10 @@
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Backlog of changes" href="backlog.html" /><link rel="prev" title="Contributing" href="contributing.html" />
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="prev" title="Contributing" href="contributing.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Q &amp; A - GravityMon 0.7.0 documentation</title>
<title>Q &amp; A - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>
@ -212,15 +212,7 @@
<footer>
<div class="related-pages">
<a class="next-page" href="backlog.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Backlog of changes</div>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="contributing.html">
<svg><use href="#svg-arrow-right"></use></svg>
<div class="page-info">

View File

@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Functionallity" href="functionallity.html" /><link rel="prev" title="Licence" href="license.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Releases - GravityMon 0.7.0 documentation</title>
<title>Releases - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -159,15 +159,15 @@
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>
@ -196,6 +196,18 @@
<article role="main">
<div class="section" id="releases">
<span id="id1"></span><h1>Releases<a class="headerlink" href="#releases" title="Permalink to this headline"></a></h1>
<div class="section" id="v0-7-1">
<h2>v0.7.1<a class="headerlink" href="#v0-7-1" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><p>Added instructions for how to configure integration with Fermentrack</p></li>
<li><p>Added instructions for how to configure integration with Ubidots</p></li>
<li><p>Added instructions for how to configure integration with HomeAssistant</p></li>
<li><p>Added instructions for how to configure integration with Brewers Friend (not verified)</p></li>
<li><p>BUG: Defined mqtt port was ignored, used default values.</p></li>
<li><p>BUG: Extended length of HTTP url fields from 100 to 120 chars.</p></li>
<li><p>BUG: Fixed issue with default template so it now includes the device name correctly.</p></li>
</ul>
</div>
<div class="section" id="v0-7-0">
<h2>v0.7.0<a class="headerlink" href="#v0-7-0" title="Permalink to this headline"></a></h2>
<p>Latest stable version. <a class="reference external" href="https://github.com/mp-se/gravitymon/releases/tag/v0.7.0">Release v0.7 on Github</a></p>
@ -306,6 +318,7 @@ the behaviour in v0.6 is wanted this can be done via the format editor.</p></li>
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">Releases</a><ul>
<li><a class="reference internal" href="#v0-7-1">v0.7.1</a></li>
<li><a class="reference internal" href="#v0-7-0">v0.7.0</a></li>
<li><a class="reference internal" href="#v0-6-0">v0.6.0</a></li>
<li><a class="reference internal" href="#v0-5-0">v0.5.0</a></li>

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="#" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/><title>Search - GravityMon 0.7.0 documentation</title><link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/><title>Search - GravityMon 0.7.1 documentation</title><link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
@ -120,7 +120,7 @@
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.0 documentation</div></a>
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
@ -143,7 +143,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.0 documentation</span>
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="#" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
@ -157,15 +157,15 @@
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Setting up device</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#format-editor">Format editor</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#create-formula">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#rest-api">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#data-formats">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1"><a class="reference internal" href="services.html">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
<li class="toctree-l1"><a class="reference internal" href="backlog.html">Backlog of changes</a></li>
</ul>
</div>

File diff suppressed because one or more lines are too long

370
docs/services.html Normal file
View File

@ -0,0 +1,370 @@
<!doctype html>
<html class="no-js">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Advanced Configuration" href="advanced.html" /><link rel="prev" title="Create formula" href="formula.html" />
<meta name="generator" content="sphinx-4.4.0, furo 2022.01.02"/>
<title>Service Integration - GravityMon 0.7.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=df49af52631e7917044a9c21a57f7b83170a6dd0" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=fade93df149f7c5fedb3ff897f799dc7d283b420" />
<style>
body {
--color-code-background: #f8f8f8;
--color-code-foreground: black;
}
body[data-theme="dark"] {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
}
</style></head>
<body>
<script>
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
</script>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-toc" viewBox="0 0 24 24">
<title>Contents</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<line x1="4" y1="6" x2="20" y2="6" />
<line x1="10" y1="12" x2="20" y2="12" />
<line x1="6" y1="18" x2="20" y2="18" />
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24">
<title>Light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24">
<title>Dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
</svg>
</symbol>
<symbol id="svg-sun-half" viewBox="0 0 24 24">
<title>Auto light/dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r="9" />
<path d="M13 12h5" />
<path d="M13 15h4" />
<path d="M13 18h1" />
<path d="M13 9h4" />
<path d="M13 6h1" />
</svg>
</symbol>
</svg>
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
<label class="overlay sidebar-overlay" for="__navigation">
<div class="visually-hidden">Hide navigation sidebar</div>
</label>
<label class="overlay toc-overlay" for="__toc">
<div class="visually-hidden">Hide table of contents sidebar</div>
</label>
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<div class="visually-hidden">Toggle site navigation sidebar</div>
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
</label>
</div>
<div class="header-center">
<a href="index.html"><div class="brand">GravityMon 0.7.1 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
<span class="sidebar-brand-text">GravityMon 0.7.1 documentation</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="license.html">Licence</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
<li class="toctree-l1"><a class="reference internal" href="functionallity.html">Functionallity</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="formula.html">Create formula</a></li>
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Service Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Advanced Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="compiling.html">Compiling the software</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="q_and_a.html">Q &amp; A</a></li>
</ul>
</div>
</div>
</div>
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<div class="content-icon-container">
<div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
<article role="main">
<div class="section" id="service-integration">
<span id="services"></span><h1>Service Integration<a class="headerlink" href="#service-integration" title="Permalink to this headline"></a></h1>
<p>This chapter contains a list of targets and what configuration is needed to interact with them.</p>
<div class="section" id="brewfather">
<h2>Brewfather<a class="headerlink" href="#brewfather" title="Permalink to this headline"></a></h2>
<p>Brewfather is an all in one service that allows you to manage you recepies and brews.</p>
<p>Just enter the http adress found on brewfather, not other settings are needed. The endpoint has the following format:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>http://log.brewfather.net/http://log.brewfather.net/stream?id=&lt;yourid&gt;
</pre></div>
</div>
<p>The URL is found under settings.</p>
</div>
<div class="section" id="fermentrack">
<h2>Fermentrack<a class="headerlink" href="#fermentrack" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="https://www.fermentrack.com">Fermentrack</a> is a open source brewing software to monitor and control fermentation.</p>
<p>GravityMon can be installed and used as an iSpindle. Just register the device as an iSpindle and use the defined endpoint which normally is:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">myservername</span><span class="o">/</span><span class="n">ispindel</span>
</pre></div>
</div>
</div>
<div class="section" id="ubidots">
<h2>UBIdots<a class="headerlink" href="#ubidots" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="https://www.ubidots.com">UBIdots</a> is a IoT service that display data collected various sources.</p>
<p>For this service there are two options to configure the integration. First you will need your default token which is found under <cite>API Credentials</cite> (&lt;api-tokem&gt; in the example below).
Swap the text &lt;devicename&gt; with the name you want to show in ubidots.</p>
<p><strong>Option 1</strong> - token as an URL parameter</p>
<p>Enter the following as URL:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>http://industrial.api.ubidots.com/api/v1.6/devices/&lt;devicename&gt;/?token=&lt;api-token&gt;
</pre></div>
</div>
<p>Even though ubidots can handle the default ispindle format it probably better to just post the data you want. This is an example of a
format template that can be used. For information on customizing the format see <a class="reference internal" href="advanced.html#format-editor"><span class="std std-ref">Format editor</span></a>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>{
"temperature": ${temp},
"gravity": ${gravity},
"angle": ${angle},
"battery": ${battery},
"rssi": ${rssi}
}
</pre></div>
</div>
</div>
<div class="section" id="home-assistant">
<h2>Home Assistant<a class="headerlink" href="#home-assistant" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="https://www.homeassistant.com">HomeAssistant</a> is a platform for home automation and can collect sensor data
from multiple devices.</p>
<p>This setup uses the MQTT integration with home assistant to collect values from the device.</p>
<p>This part of the configuration goes into the home assistant configuration.yaml file. The example assumes that the
device is named <cite>gravmon2</cite></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sensor</span><span class="p">:</span>
<span class="o">-</span> <span class="n">platform</span><span class="p">:</span> <span class="n">mqtt</span>
<span class="n">name</span><span class="p">:</span> <span class="s2">"gravmon2_gravity"</span>
<span class="n">state_topic</span><span class="p">:</span> <span class="s2">"gravmon/gravmon2/gravity"</span>
<span class="o">-</span> <span class="n">platform</span><span class="p">:</span> <span class="n">mqtt</span>
<span class="n">name</span><span class="p">:</span> <span class="s2">"gravmon2_battery"</span>
<span class="n">state_topic</span><span class="p">:</span> <span class="s2">"gravmon/gravmon2/battery"</span>
<span class="o">-</span> <span class="n">platform</span><span class="p">:</span> <span class="n">mqtt</span>
<span class="n">name</span><span class="p">:</span> <span class="s2">"gravmon2_rssi"</span>
<span class="n">state_topic</span><span class="p">:</span> <span class="s2">"gravmon/gravmon2/rssi"</span>
</pre></div>
</div>
<p>Enter the name of the MQTT server in Home Assistant in the URL. You might need to install that option
first. This is the format needed to submit the data to the correct topics as needed above. You can add as
many sensors / topics as you want.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>gravmon/${mdns}/tilt:${angle}|
gravmon/${mdns}/temperature:${temp}|
gravmon/${mdns}/temp_units:${temp-unit}|
</pre></div>
</div>
</div>
<div class="section" id="brewer-s-friend">
<h2>Brewers Friend<a class="headerlink" href="#brewer-s-friend" title="Permalink to this headline"></a></h2>
<p>Brewers friend is an all in one service that allows you to manage you recepies and brews.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>I dont have an account for brewers friend so I have not been able to verfy this completely. Its based on
the available documentation.</p>
</div>
<p>You can find you API key when logged in to the service. Follow these <a class="reference external" href="https://docs.brewersfriend.com/devices/ispindel">instructions</a></p>
<p><strong>Note there are different URLs if you are using plato or specific gravity!</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">log</span><span class="o">.</span><span class="n">brewersfriend</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">ispindel</span><span class="o">/</span><span class="p">[</span><span class="n">API</span> <span class="n">KEY</span><span class="p">]</span>
<span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">log</span><span class="o">.</span><span class="n">brewersfriend</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">ispindel_sg</span><span class="o">/</span><span class="p">[</span><span class="n">API</span> <span class="n">KEY</span><span class="p">]</span>
</pre></div>
</div>
<p>From what I can read in the documentation you need to add the API key as a token as well. This can be done using a custom
format for the endpoint. Just add you API key after token.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>{
"name" : "${mdns}",
"ID": "${id}",
"token" : "[API KEY]",
"interval": ${sleep-interval},
"temperature": ${temp},
"temp-units": "${temp-unit}",
"gravity": ${gravity},
"angle": ${angle},
"battery": ${battery},
"rssi": ${rssi}
}
</pre></div>
</div>
</div>
</div>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="advanced.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Advanced Configuration</div>
</div>
<svg><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="formula.html">
<svg><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>
<div class="title">Create formula</div>
</div>
</a>
</div>
<div class="related-information">
Copyright &#169; 2021-2022, Magnus Persson |
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
<a href="https://github.com/pradyunsg/furo">Furo theme</a>.
</div>
</footer>
</div>
<aside class="toc-drawer">
<div class="toc-sticky toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
Contents
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">Service Integration</a><ul>
<li><a class="reference internal" href="#brewfather">Brewfather</a></li>
<li><a class="reference internal" href="#fermentrack">Fermentrack</a></li>
<li><a class="reference internal" href="#ubidots">UBIdots</a></li>
<li><a class="reference internal" href="#home-assistant">Home Assistant</a></li>
<li><a class="reference internal" href="#brewer-s-friend">Brewers Friend</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</aside>
</div>
</div><script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/scripts/furo.js"></script>
</body>
</html>