I didn't modify anything in the file. I copied and pasted exactly what you posted.
<?php
define('HHAPI_URL', 'IP_OF_HAIKUHELPER
![Stick Out Tongue :p :p](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
ORT_OF_HAIKUHELPER port/api');
define('HHAPI_USER', ‘XXXX’);
define('HHAPI_PASS', ‘YYYY!’);
// hhapi calls
// Grab the name and date properties from the controller object
if (isset($_GET["dim"])) { // Check to see if DIM is defined so run the DIM command
hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').setLevel('.$_GET["dim"].')');
}
elseif(isset($_GET["newTargetValue"])) { //See If we are passing a unit number to turn on or off
if ($_GET["newTargetValue"] == 1){ //Value is 1 so turn switch ON
hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').on()');
}
elseif($_GET["newTargetValue"] == 0){ //Value is 0 so turn switch OFF
hhapi('controller.unitWithNumber('.$_GET["DeviceNum"].').off()');
}
}
elseif (isset($_GET["Button"])) { //Passing a button name to exectute that button
hhapi('controller.buttonWithName("'.$_GET["Button"].'").activate()');
}
elseif (isset($_GET["Temp"])) { //Passing a button name to exectute that button
hhapi('controller.thermostatWithNumber('.$_GET["Thermostat"].').setCoolSetpoint('.$_GET["Temp"].')');
echo("Yay for Me!");
}
function hhapi($cmd) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, HHAPI_URL);
curl_setopt($ch, CURLOPT_USERPWD, HHAPI_USER . ':' . HHAPI_PASS);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $cmd);
$result = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
if($error) echo $error;
return json_decode($result);
}
?>