v1

latestOpenAPI 3.0.32026-07-171140286.6 KB
Api\MeasurementController

api/sensors/calibrateweight Legacy method, used by legacy webapp to store weight calibration value e.g.[w_v_kg_per_val] in Influx database, to lookup and calculate [weight_kg] at incoming measurement value storage

At the next measurement coming in, calibrate each weight sensor with it's part of a given weight. Because the measurements can come in only each hour/ 3hrs, set a value to trigger the calculation on next measurement

  1. If $next_measurement == true: save 'calibrating' = true in Influx with the sensor key
  2. If $next_measurement == false: save 'calibrating' = false in Influx with the sensor key and...
  3. Get the last measured weight values for this sensor key, Divide the given weight (in kg) with the amount of sensor values > 1.0 (assuming the weight is evenly distributed) Calculate the multiplier per sensor by dividing the multiplier = weight_part / (value - offset) Save the multiplier as $device_name.'_kg_per_val' in Influx
post/api/sensors/calibrateweight

Headers

Content-Typestring
Acceptstring
Accept-languagestring

Request body

next_measurementboolean
weight_kgnumber

Het value veld is verplicht wanneer <code>next_measurement</code> is <code>true</code>.

Example request

{
  "next_measurement": true,
  "weight_kg": 142125817.9803
}