HTTP - WLANThermo-nano/WLANThermo_ESP82XX_Software GitHub Wiki

HTTP

Get data requests:

Set data requests:

Command requests:

  • /configreset
  • /restart
  • /stopwifi
  • /clearwifi
  • /networkscan
  • /newtoken
  • /checkupdate
  • /updatestatus
  • /update
  • /url.json

GET /data

Description: Returns dynamic data.

Return value: JSON object with nested objects/array system, channel and pitmaster.

system: (JSON object)

  • time: (long) current unix timestamp
  • unit: (char) temperature unit "C" = Celsius or "F" = Fahrenheit
  • soc: (int) state of charge in %
  • charge: (boolean) battery charging off/on
  • rssi: (int) wifi strength in dBm
  • online: (int) cloud status (0 = not connected, 1 = standby, 2 = connected)

channel: (JSON array with nested JSON channel objects for each channel)

  • number: (int) channel id
  • name: (String) name of channel
  • typ: (int) probe typ id, matching order in /settings JSON sensor array
  • temp: (float) current temperature
  • min: (float) minimum temperature alarm
  • max: (float) maximum temperature alarm
  • alarm: (int) channel alarm configuration (0 = off, 1 = push, 2 = buzzer, 3 = push + buzzer)
  • color: (String) channel color in hexadecimal

pitmaster: (JSON object)

  • type: (JSON array with Strings) available pitmaster states ("off" / "manual" / "auto")
  • pm: (JSON array with nested JSON pitmaster objects)
  • id: (int) pitmaster id
  • channel: (int) channel number, matching possible channels in /data JSON channel array
  • pid: (int) pid profile id, matching profile in /settings JSON pid array
  • value: (int) pitmaster value in % (only writeable in pitmaster state "manual")
  • set: (float) set temperature (only writeable in pitmaster state = "auto")
  • typ: (String) pitmaster state, matching possible states
  • set_color: (String) set value color in hexadecimal
  • value_color: (String) pitmaster value color in hexadecimal

Example:

{"system":{"time":"1598290195","unit":"C","soc":18,"charge":false,"rssi":31,"online":0},"channel":[{"number":1,"name":"Kanal 1","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#0C4C88"},{"number":2,"name":"Kanal 2","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#22B14C"}],"pitmaster":{"type":["off","manual","auto"],"pm":[{"id":0,"channel":1,"pid":0,"value":0,"set":50.00,"typ":"off","set_color":"#ff0000","value_color":"#000000"}]}}

up


GET /settings

Description: Returns static data.

Return value: JSON object with nested objects/arrays system, sensors, pid, aktor, iot, hardware and notification.

device: (JSON object)

  • device: (String) device description ("nano", "mini", "link")
  • serial: (String) serial number (unique for a one device)
  • hw_version: (String) hardware version of device, matching Strings in /settings JSON hardware array
  • sw_version: (String) software version of device
  • api_version: (String) api version
  • language: (String) system language

system:

  • time: (long) current unix timestamp
  • unit: (char) temperature unit "C" = Celsius or "F" = Fahrenheit
  • ap: (String) AP name
  • host: (String) host name
  • language: (String) system language
  • version: (String) current firmware version
  • getupdate: (String) firmware update version, "false" if no update available
  • autoupd: (boolean) autosearch for updates disabled/enabled
  • hwversion: (String) hardware version, matching Strings in /settings JSON hardware array

sensors: (JSON array with Strings) possible temperature probes

pid: (JSON array with nested JSON pid objects for each profil)

  • name: (String) profil name
  • id: (int) profil id
  • aktor: (int) pitmaster actor, matching Strings in /settings JSON aktor array
  • Kp: (float) proportional factor
  • Ki: (float) integral factor
  • Kd: (float) differential factor
  • DCmmin: (int)
  • DCmmax: (int)
  • opl: (boolean) open lid detection enable/disable
  • tune: (boolean) autotune process enable/disable (currently not in use)
  • jp: (int) jump power value [10-100]

aktor: (JSON array with Strings)

iot: (JSON object)

  • PMQhost: (String) MQTT host name
  • PMQport: (int) MQTT port
  • PMQuser: (String) MQTT user name
  • PMQpass: (String) MQTT password
  • PMQqos: (int) MQTT QoS
  • PMQon: (boolean) MQTT enable/disable
  • PMQint: (int) MQTT send interval
  • CLon: (boolean) Cloud enable/disable
  • CLtoken: (String) Cloud token
  • CLint: (int) Cloud send interval
  • CLurl: (String) Cloud url

hardware: (JSON array with Strings) possible hardware versions

notes: (JSON object) possible notification services

  • ext: (JSON object) external notification service
  • on: (int) notification status (0 = off, 1 = on, 2 = test message [temporary state])
  • token: (String) notification service token
  • token: (String) notification service id
  • repeat: (int) notification send replay [1-10]
  • service: (int) notification service matching order in services
  • services: (JSON array) possible external notification services

Example:

{"device":{"device":"nano","serial":"c111xx","hw_version":"v2","sw_version":"v1.0.6","api_version":"1","language":"de"},"system":{"time":"1598290329","unit":"C","ap":"NANO-AP","host":"NANO-c111xx","language":"de","version":"v1.0.6","getupdate":"false","autoupd":true,"hwversion":"V1+"},"hardware":["V1","V1+"],"api":{"version":"1"},"sensors":["1000K/Maverick","Fantast-Neu","Fantast","100K/iGrill2","ET-73","Perfektion","50K","Inkbird","100K6A1B","Weber_6743","Santos","5K3A1B"],"pid":[{"name":"SSR SousVide","id":0,"aktor":0,"Kp":104.00,"Ki":0.20,"Kd":0.00,"DCmmin":0.00,"DCmmax":100.00,"opl":0,"tune":0,"jp":100},{"name":"TITAN 50x50","id":1,"aktor":1,"Kp":3.80,"Ki":0.01,"Kd":128.00,"DCmmin":25.00,"DCmmax":100.00,"opl":0,"tune":0,"jp":70},{"name":"Kamado 50x50","id":2,"aktor":1,"Kp":7.00,"Ki":0.02,"Kd":630.00,"DCmmin":25.00,"DCmmax":100.00,"opl":0,"tune":0,"jp":70}],"aktor":["SSR","FAN","SERVO"],"iot":{"PMQhost":"192.168.2.1","PMQport":1883,"PMQuser":"","PMQpass":"","PMQqos":0,"PMQon":false,"PMQint":30,"CLon":true,"CLtoken":"c111xx052e6c438d","CLint":30,"CLurl":"cloud.wlanthermo.de/index.html"},"notes":{"fcm":[],"ext":{"on":0,"token":"","id":"","repeat":1,"service":0,"services":["telegram","pushover"]}}}

up


GET /info

up


GET /networklist

up


POST /setsystem

Description: Sets system parameters.

Request Authentication: yes

Arguments (in the POST request body): JSON system object (see /settings)

Used keys in JSON system object:

  • ap: (String: max. 13 character, UTF8) AP name
  • host: (String: max. 13 character, UTF8) host name
  • language: (String: ["de"]) system language
  • unit: (char: ["C", "F"]) temperature unit
  • autoupd: (boolean) autosearch for updates disabled/enabled
  • hwversion: (String: JSON hardware array) hardware version

Return value: (text/plain) true/false

Remarks: Send the whole JSON system object with all keys or selected keys.

Example:

{"ap":"NANO-AP","host":"NANO-82e0b3","language":"de","unit":"C","autoupd":true}

up


POST /setchannels

Description: Sets channel parameters.

Request Authentication: yes

Arguments (in the POST request body): JSON nested channel object (see /data)

Used keys in JSON channel object:

  • number: (int: [1, 8]) channel id
  • name: (String: max. 10 character, UTF8) name of channel
  • typ: (int:[JSON sensors array]) probe typ id
  • min: (float: [-30.0, 999.9]) minimum temperature alarm
  • max: (float: [-30.0, 999.9]) maximum temperature alarm
  • alarm: (int) channel alarm configuration (0 = off, 1 = push, 2 = buzzer, 3 = push + buzzer)
  • color: (String: woher?) channel color in hexadecimal

Return value: (text/plain) true/false

Remarks: Send only one nested JSON object from the JSON channel array. Send the whole nested JSON object with all keys or selected keys.

Example:

{"number":1,"name":"Kanal 1","typ":0,"temp":24.50,"min":10.00,"max":35.00,"alarm":0,"color":"#0C4C88"}

up


POST /setpitmaster

Description: Sets pitmaster parameters.

Request Authentication: yes

Arguments (in the POST request body): JSON pitmaster array with nested pitmaster objects (see /data)

Used keys in JSON pitmaster object:

  • id: (int: [0, 1]) pitmaster id
  • channel: (int: [1, 8]) channel number, only used for "auto" and "autotune"
  • pid: (int: [JSON pid array]) pid profile id
  • value: (int: [0, 100]) pitmaster value in %, only used for "manual"
  • set: (float: [0.0, 999.9]) set temperature, only used for "auto" and "autotune"
  • typ: (String: ["off", "manual", "auto", "autotune"]) pitmaster state

Return value: (text/plain) true/false

Remarks: Send only a complete nested JSON pitmaster object (or more objects) in the JSON array, otherwise it fails.

Example:

[{"id":0,"channel":1,"pid":0,"value":0,"set":50.00,"typ":"off"}]

up


POST /setpid

Description: Sets pid parameters.

Request Authentication: yes

Arguments (in the POST request body): JSON pid array with nested objects (see /settings)

Return value: (text/plain) true/false

Remarks: Send one or more nested JSON objects in the JSON pid array.

Example:

[{"name":"SSR SousVide","id":0,"aktor":0,"Kp":165.00,"Ki":0.59,"Kd":1000.00,"DCmmin":0,"DCmmax":100,"opl":0,"tune":0,"jp":70.00}]

up


POST /setIoT

Description: Sets IoT parameters.

Request Authentication: yes

Arguments (in the POST request body): JSON IoT object (see /settings)

Return value: (text/plain) true/false

Remarks: Send the complete IoT object with all keys or selected keys.

Example:

{"PMQhost":"192.168.2.1","PMQport":1883,"PMQuser":"","PMQpass":"","PMQqos":0,"PMQon":false,"PMQint":30,"TGon":1,"TGtoken":"","TGid":"","CLon":false,"CLtoken":"84ce370d7a2118d8","CLint":30}

up


POST /setnetwork

Description: Starts WiFi connection test with sent network parameters (ssid, password).

Request Authentication: yes

Arguments (in the POST request body): JSON object with keys ssid and password (see Example)

Return value: (text/plain) true/false

Remarks: Sent ssid and password are only saved if Wifi connection could be established. Limit ssid to 32 characters and password to 63 characters. Possible password characters: &%_~!@#$^*()-+|={}[]:;<>?,./`Aa1234567890. Don’t use '".

Example:

{"ssid":"xxx","password":"xxx"}

up


GET /setDC

Description: Starts DC limits test with sent min or max value.

Request Authentication: yes

Arguments (added to url):

  • (int) aktor, describes the used aktor as id from the JSON aktor object (see /settings)
  • (boolean) dc, describes whether min (false) or max (true) limit is to be tested
  • (int) val, describes the value to be tested from 0 to 100

Return value: (text/plain) true/false

Example:

/setDC?aktor=1&dc=0&val=100

up


POST /setadmin

Description: Change password for admin profil.

Request Authentication: yes

Arguments (form-data): (char) wwwpassword, describes the new password

Return value: (text/plain) true/false

Remarks: For Request Authentication use old password.

Example:

up


POST /setapi

Description: Change API settings (Server-URLs, Update informations, Connection states).

Request Authentication: yes

Arguments (in the POST request body): JSON API object

Return value: (text/plain) true/false

Remarks:

Example:

{"url":{{"api":{"host":"xxx","page":"/"},{"cloud":{"host":"xxx","page":"/"},...},"update":{"available":true,...},... }

up


POST /configreset

Description: Resets configuration to default.

Request Authentication: no

Arguments: no

Return value: true/false

up


POST /url.json

Description: Shows API Server URLs.

Request Authentication: no

Arguments: no

Return value: API Server URLs JSON Object.

up