Un petit don cela ne fait pas de mal.
Merci !
// name : get_data.php
//connect to mysql db
$con = mysqli_connect('localhost','login','pass','domo') or die("Error " . mysqli_error($connection));
//connect to the employee database
// mysqli_select_db("data", $con);
//read the json file contents
$jsondata = file_get_contents('https://developer-api.nest.com/devices/thermostats?auth=.......');
//convert json object to php associative array
$data = json_decode($jsondata, true);
//get the employee details
$updated = $data['0MdexvLs0SXBsG8m8YZ0mHv5jTlSuPFQ']['last_connection'];
$humidity = $data['0MdexvLs0SXBsG8m8YZ0mHv5jTlSuPFQ']['humidity'];
$current = $data['0MdexvLs0SXBsG8m8YZ0mHv5jTlSuPFQ']['ambient_temperature_c'];
$target = $data['0MdexvLs0SXBsG8m8YZ0mHv5jTlSuPFQ']['target_temperature_c'];
$heating = $data['0MdexvLs0SXBsG8m8YZ0mHv5jTlSuPFQ']['hvac_state'];
$updated = str_replace('T', ' ', $updated);
$updated = substr($updated, 0, -5 );
//insert into mysql table
$sql = "INSERT INTO data VALUES('$heating', '$target', '$current', '$humidity', '$updated', now())";
$exec = mysqli_query($con,$sql) or die("Error in Selecting " . mysqli_error($connection));
mysqli_close($con);
//echo $updated.' '.$humidity.' '.$current.' '.$target.' '.$heating;
// name : up_data.php
// Prepare variables for database connection
$con = mysqli_connect('localhost','login','pass','domo') or die("Error " . mysqli_error($connection));
// Prepare the SQL statement
$sql = "INSERT INTO sensor_cuve (value, local) VALUES ('".$_GET["value"]."', '".$_GET["local"]."')";
mysqli_query($con, $sql);
$sql = "INSERT INTO temper (t_cuve, t_gara, local) VALUES ('".$_GET["t_cuve"]."', '".$_GET["t_gara"]."', '".$_GET["local"]."')";
// Execute SQL statement
mysqli_query($con, $sql);
// fermer la connection
mysqli_close($con);