| $name | ");
if (knxread($fp, $gad) != 0)
print("On | Turn Off");
else
print("Off | Turn On");
print(" | \n");
}
function switching_status($fp, $name, $gad) {
if (knxread($fp, $gad) != 0)
print("| $name | On |
\n");
else
print("| $name | Off |
\n");
}
function heating($fp, $name, $id) {
print("| $name | ");
$val = knxread($fp, 'heating_'.$id);
print(knxread($fp, 'temp_'.$id).' | '.$val.' ('.knxread($fp, 'setpoint_'.$id).") | \n");
print ("C S N F |
\n");
}
$address = "127.0.0.1";
$port = 1028;
$fp = fsockopen($address, $port, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)
\n";
}
else {
if (isset($_REQUEST['action'])) {
$action = $_REQUEST['action'];
$gad = $_REQUEST['gad'];
if ($action == 'On') {
knxwrite($fp, $gad, 1);
}
elseif ($action == 'Off') {
knxwrite($fp, $gad, 0);
}
elseif ($action == 'comfort') {
knxwrite($fp, $gad, $action);
}
elseif ($action == 'standby') {
knxwrite($fp, $gad, $action);
}
elseif ($action == 'night') {
knxwrite($fp, $gad, $action);
}
elseif ($action == 'frost') {
knxwrite($fp, $gad, $action);
}
}
print("Lighting
\n\n");
switching($fp, "Living room", "light_living");
switching($fp, "Dining room", "light_dining");
switching($fp, "Bedroom 2", "light_room2");
switching($fp, "Floor", "light_floor");
switching($fp, "Stair", "light_stair");
switching($fp, "Office", "light_office");
switching($fp, "Bedroom 1", "light_room1");
switching($fp, "Toilet 1", "light_toilet1");
switching($fp, "Kitchen", "light_kitchen");
switching($fp, "Toilet 0", "light_toilet0");
print("
\nHeating
\n\n");
heating($fp, "Office", "office");
heating($fp, "Living room", "living");
heating($fp, "Bedroom 1", "room1");
heating($fp, "Bedroom 2", "room2");
heating($fp, "Kitchen", "kitchen");
switching($fp, "Bathroom", "heating_bath");
switching_status($fp, "Burner status", "burner");
print("
\nOther
\n\n");
switching($fp, "Warm water circulator ", "circulator");
switching($fp, "Auto heating mode", "heating_auto");
switching($fp, "Alarm clock", "wakeup_active");
switching($fp, "Alarm active", "alarm_active");
switching($fp, "Intrusion", "intrusion");
print("
\n");
fclose($fp);
}
?>