www/ispindel/index.php

changeset 849
16079aef4c4c
parent 847
dc9281501ca6
--- a/www/ispindel/index.php	Wed Aug 23 10:30:09 2023 +0200
+++ b/www/ispindel/index.php	Thu Oct 12 14:19:46 2023 +0200
@@ -17,11 +17,6 @@
                 $tempC = floatval($data['temperature']);
 	}
 
-	/* The rounding in the tilt using less digits results in a 0.25 plato difference. Calculate here again using the calibration data. */
-	$tilt = $data['angle'];
-	$plato = (0.00028548 * $tilt * $tilt * $tilt) + (-0.03492272 * $tilt * $tilt) + (1.617106176 * $tilt) + -21.412976092;
-	syslog(LOG_NOTICE, "ispindel " . $input . " plato ".$plato);
-
 	$node = 'ispindel-' . sprintf("%06x", floatval($data['ID']));
 
 	$alarm = 0;
@@ -49,7 +44,7 @@
 	$uuid = 'c0ffeeee-cafe-dead-bee0-' . sprintf("%06x", 0xffffff - floatval($data['ID'])) . sprintf("%06x", floatval($data['ID']));
 	$topic = 'mbv1.0/ispindels/DBIRTH/' . $node;
 	$payload  = '{"unit":{"uuid":"' . $uuid .'","alias":"' . $data['name'] . '","alarm":' . $alarm . ',"interval":' . $interval;
-	$payload .= ',"angle":' . $data['angle'] . ',"temperature":' . $tempC . ',"battery":' . $data['battery'] . ',"gravity":' . $plato . '}}';
+	$payload .= ',"angle":' . $data['angle'] . ',"temperature":' . $tempC . ',"battery":' . $data['battery'] . ',"gravity":' . $data['gravity'] . '}}';
 	$pub = $publisher . $topic . ' -m \'' .$payload . '\'';
 	exec($pub);
 }

mercurial