Hi
ich habe ein Script von dieser Anleitung verwendet
Raspi Tips
Läuft für einen Sensor. Da ich aber kein PHP Guru bin (hab mir zwar ein Tutorial reingezogen, aber das is aber an der Oberfläche gekratz, komm auf keinen grünen Zweig)
Wie muß ich das Script anpassen, das ich meine restlichen Sensoren einbinden kann?
Hab insg. 5 Stück.
[code=php]
<?php
//================ Config ===========================
//Replace your DS18B20 serial here!
$SENSORID = "28-000005c68110";
//Set the emoncms API Key, the Hostname or IP and the internal Sensor ID (Numeric only)
$EmonCMSApiKey = "d5fc60b7e270c380ef0a2b418f632a84";
$EmonCMSHost = "localhost";<a href="http://cdn.raspberry.tips/2014/12/temperatur.php_.txt">temperatur.php</a>
$ecmsSENSORID = "1";
//==================================================
//BuildSensor Path
$SensorPath = '/sys/bus/w1/devices/'. $SENSORID .'/w1_slave';
// Open resource file for thermometer
$thermometer = fopen($SensorPath, "r");
// Get the contents of the resource
$thermometerReadings = fread($thermometer, filesize($SensorPath));
// Close resource file for thermometer
fclose($thermometer);
// We're only interested in the 2nd line, and the value after the t= on the 2nd line
preg_match("/t=(.+)/", preg_split("/\n/", $thermometerReadings)[1], $matches);
$temperature = $matches[1];
//Write to emoncms - Example http://192.168.178.24/emoncms/…on?node=1&csv=100,200,300
// You may want to add other parsed values
$url = 'http://' . $EmonCMSHost . '/emoncms/api/post.json?node=' . $ecmsSENSORID . '&csv=' . $temperature .'&apikey=' . $EmonCMSApiKey . '';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
?>[/php]
Das ganze soll dann meine Heizungsanlagetemperaturen monitoren.
Danke schon mal, hoffe ich bekomme bei Euch Hilfe.