update get.php to reflect reality
This commit is contained in:
parent
6096259996
commit
6c2f762898
@ -6,6 +6,17 @@ if (preg_match("/^[0-9]{10}\;[0-9]{1,5}\.?[0-9]{0,20}/", $_POST['val'])) {
|
||||
$fileh = fopen("power.log", "w+");
|
||||
fwrite($fileh, $_POST['val']);
|
||||
fclose($fileh);
|
||||
// Was zur Hölle, wafür ist das?
|
||||
$filem = fopen("strom.avg", "a+");
|
||||
fwrite($filem, $_POST['val']."\n");
|
||||
fclose($filem);
|
||||
|
||||
// update mqtt legacy
|
||||
system("mosquitto_pub -t '/hq/power/value' -m '" . round($val[1]) . "' --cafile /etc/mosquitto/certs/cacert.pem --insecure -i power -u hq -P hq");
|
||||
|
||||
// update mqtt new
|
||||
system("mosquitto_pub -t 'hq/power/value' -m '" . round($val[1]) . "' --cafile /etc/mosquitto/certs/cacert.pem --insecure -i power -u hq -P hq");
|
||||
|
||||
echo "0";
|
||||
} else {
|
||||
echo "1";
|
||||
|
Loading…
x
Reference in New Issue
Block a user