Hi,
Unfortunately, I can not round it because the tension is important.
Here is a part of the script where it sends via api as a variable to pimatic
Here is a variable Sent to Pimatic.
The file is included before
https://github.com/toggio/PhpEpsolarTracer/blob/master/PhpEpsolarTracer.php
// solar1-Battery-status
$solar1Batterystatus = $bStatus;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://192.168.0.25:81/api/variables/solar1-Battery-status");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"type\": \"value\", \"valueOrExpression\": $solar1Batterystatus}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_USERPWD, "USER" . ":" . "PW");
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
How can I tell the variable say that it sends 500.50.
and not as current 500.5
Thank you
Deutsch:
Hi,
Leider kann ich es nicht runden, weil die Spannung wichtig ist.
Hier ist ein Teil Vom Script wo es per api als Variable zu pimatic sendet
Hier wird eine Variable Gesendet zu Pimatic.
Die Datei Wird Vorher Includet
https://github.com/toggio/PhpEpsolarTracer/blob/master/PhpEpsolarTracer.php
// solar1-Battery-status
$solar1Batterystatus = $bStatus;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://192.168.0.25:81/api/variables/solar1-Battery-status");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"type\": \"value\", \"valueOrExpression\": $solar1Batterystatus}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_USERPWD, "USER" . ":" . "PW");
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
Wie Kann ich der Variable Sagen das es 500.50 Sendet.
und nicht wie aktuell 500.5
Danke