You need to replace the IP and port of the HH server, HH userid, HH password. Then where it says hh api calls, you need to insert the calls that do what you want on the HAI. You will have to refer to the HH Javascript API documentation but here is a full example that can turn a unit (number 3) on/off and set level:
<?php
define('HHAPI_URL', '
http://IP address
ort/api');
define('HHAPI_USER', ‘XXX’);
define('HHAPI_PASS', ‘YYY’);
// Grab the name and date properties from the controller object
if (isset($_GET["dim"])) {
hhapi('controller.unitWithNumber(3).setLevel('.$_GET["dim"].')');
}
else{
hhapi('controller.unitWithNumber(3).toggle()');
}
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);
}
Once this file is in the Webserver directory and the Webserver is started. You can add this device using the bridge's configurator and the URL should point to this file. In the configurator, try clicking the test button to see if the URL is correct and the file works (I.e. controls the device). You will then have to use the Alexa app on your phone and go to Settings, Smart Home, Discover Devices. If the bridge is working, it should say it found devices. At that point you can ask Alexa to turn on/off the device.
Don't give up