function RefreshZwave($node, $name = 'auto', $device = '') { cset('timerefresh-' . $device, time); $devices = json_decode(file_get_contents(api . 'json.htm?type=openzwavenodes&idx=4'), true); for ($k = 1; $k <= 5; $k++) { ControllerBusy(20); $result = file_get_contents(api . 'ozwcp/refreshpost.html', false, stream_context_create(array('http' => array('header' => 'Content-Type: application/x-www-form-urlencoded\\r\\n', 'method' => 'POST', 'content' => http_build_query(array('fun' => 'racp', 'node' => $node)))))); if ($result === 'OK') { cset('timerefresh-' . $device, time); break; } sleep(1); } if (cget('timedeadnodes') < vijfmin) { cset('timedeadnodes', time); foreach ($devices as $node => $data) { if ($node == "result") { foreach ($data as $index => $eltsNode) { if ($eltsNode["State"] == "Dead" && !in_array($eltsNode['NodeID'], array(31, 50, 53, 55, 60))) { telegram('Node ' . $eltsNode['NodeID'] . ' ' . $eltsNode['Description'] . ' (' . $eltsNode['Name'] . ') marked as dead, reviving ' . ZwaveCommand($eltsNode['NodeID'], 'HasNodeFailed')); ControllerBusy(5); ZwaveCommand(1, 'Cancel'); } } } } } }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Floorplan2</title><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><meta name="HandheldFriendly" content="true"/><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="viewport" content="width=device-width,height=device-height,user-scalable=yes,minimal-ui"/><link rel="icon" type="image/png" href="images/domoticzphp48.png"/><link rel="shortcut icon" href="images/domoticzphp48.png"/><link rel="apple-touch-startup-image" href="images/domoticzphp450.png"/><link rel="apple-touch-icon" href="images/domoticzphp48.png"/><meta name="msapplication-TileColor" content="#ffffff"><meta name="msapplication-TileImage" content="images/domoticzphp48.png"><meta name="msapplication-config" content="browserconfig.xml"><meta name="mobile-web-app-capable" content="yes"><link rel="manifest" href="manifest.json"><meta name="theme-color" content="#ffffff"><link href="floorplan.css" rel="stylesheet" type="text/css"/><style>body{background-image:none;}</style></head><body> <?php require "secure/settings.php"; require "secure/functions2.php"; if ($authenticated) { if (isset($_POST['Schakel'])) { if (Schakel($_POST['Schakel'], $_POST['Actie'], $_POST['Naam']) == 'ERROR') { echo '<div id="message" class="balloon">' . $_POST['Naam'] . ' ' . $_POST['Actie'] . '<br/>ERROR</div>'; } if (isset($_POST['halfuurwater'])) { cset('water', 1800); } } else { if (isset($_POST['Udevice'])) { if (Udevice($_POST['Udevice'], $_POST['Naam']) == 'ERROR') { echo '<div id="message" class="balloon">' . $_POST['Naam'] . ' ' . $_POST['Actie'] . '<br/>ERROR</div>'; } } else { if (isset($_POST['imacpicam1'])) { shell_exec('/volume1/web/secure/picam1.sh'); } else { if (isset($_POST['imacsleep'])) { shell_exec('/volume1/web/secure/imacsleep.sh'); } } } } $domoticz = json_decode(file_get_contents($domoticzurl . 'json.htm?type=devices&used=true&plan=5', true, $ctx), true); $domotime = microtime(true) - $start; //&plan=2 if ($domoticz) {
(at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // This code here will take care of sidebar form events require_once 'classes/events.php'; $events = new Events(); // C{} $cset = cset(); // The title and other head information $html['head'] = '<title>' . Calendar . ': ' . date('F', $cset['timestamp']) . ' ' . date('Y', $cset['timestamp']) . '</title>'; // Start output buffer ob_start(); global $pref; // Display any activated alarms if ($alarms = active_alarms()) { foreach ($alarms as $alarm) { echo '<div class="alarm"><span>Alarm!</span> ' . $alarm['msg'] . '</div>'; } } // Info and option bar echo '<div class="topbar">'; // Toggle view buttons echo '<div class="vtoggle">';
break; case 'tvkijken': $idx = 73; break; case 'kodikijken': $idx = 74; break; case 'eten': $idx = 75; break; } if (Schakel($idx, 'On', $_POST['Naam']) == 'ERROR') { echo '<div id="message" class="balloon">Scene ' . $_POST['Naam'] . ' activeren' . '<br/>ERROR</div>'; } if ($_POST['Naam'] == 'eten') { cset('timedimmerEettafel', $time); } } } } } $domoticz = json_decode(file_get_contents($domoticzurl . 'json.htm?type=devices&used=true&plan=2', true, $ctx), true); //$domotime=microtime(true)-$start; //&plan=2 if ($domoticz) { foreach ($domoticz['result'] as $dom) { isset($dom['Type']) ? $Type = $dom['Type'] : ($Type = 'None'); isset($dom['SwitchType']) ? $SwitchType = $dom['SwitchType'] : ($SwitchType = 'None'); isset($dom['SubType']) ? $SubType = $dom['SubType'] : ($SubType = 'None'); $name = $dom['Name']; if ($Type == 'Temp') { ${'T' . $name} = $dom['Temp'];
<?php error_reporting(E_ALL); ini_set("display_errors", "on"); echo '<b><big><a href="">Cache view</a> <a href="memcache.php">MemCache</a> <a href="opcache.php">OpCache</a> <a href="opcache1.php">OpCache</a></big></b><br/><br/>'; if (isset($_POST)) { if (isset($_POST['reset']) && isset($_POST['value'])) { cset($_POST['reset'], $_POST['value']); } } $keys = getMemcachedKeys(); sort($keys); echo '<table cellpadding="0px" cellspacing="0px">'; foreach ($keys as $key) { $content = cget($key); echo '<tr><td valign="middle" align="right"><form method="POST"><input type="submit" name="reset" value="' . $key . '" style="height:23px;padding:0;margin:0 5px -15px 0"/></td><td valign="top"><input type="text" size="15" style="text-align:right;" name="value" value="' . htmlspecialchars($content) . '"/></form></td>'; if (startsWith($key, 'time') !== false) { if ($content != 0) { echo '<td valign="top"> ' . strftime("%a %e %b %k:%M:%S", $content) . '</td>'; } } elseif (startsWith($key, 'dimmer') !== false) { echo '<td valign="top"> '; switch ($content) { case 0: echo 'Normal'; break; case 1: echo 'Sleep'; break; case 2: echo 'Wake';
} $hours = floor($time / 60); $minutes = $time % 60; return sprintf($format, $hours, $minutes); } if ($authenticated === true || basename($_SERVER['PHP_SELF']) == 'pass2php.time.php') { if (isset($_POST['Schakel'])) { if (Schakel($_POST['Schakel'], $_POST['Actie'], $_POST['Naam']) == 'ERROR') { echo '<div id="message" class="balloon">' . $_POST['Naam'] . ' ' . $_POST['Actie'] . '<br/>ERROR</div>'; } } if (isset($_POST['Setpoint'])) { if (Udevice($_POST['Setpoint'], 0, number_format($_POST['Actie'], 1), $_POST['Naam']) == 'ERROR') { echo '<div id="message" class="balloon">' . $_POST['Naam'] . ' ' . $value . '<br/>ERROR</div>'; } else { cset('setpoint' . $_POST['Naam'], 2); } } $domoticz = json_decode(file_get_contents($domoticzurl . 'json.htm?type=devices&used=true&plan=4'), true); foreach ($domoticz['result'] as $dom) { isset($dom['Type']) ? $Type = $dom['Type'] : ($Type = 'None'); isset($dom['SwitchType']) ? $SwitchType = $dom['SwitchType'] : ($SwitchType = 'None'); isset($dom['SubType']) ? $SubType = $dom['SubType'] : ($SubType = 'None'); $name = $dom['Name']; if ($Type == 'Temp') { ${'T' . $name} = $dom['Temp']; ${'TI' . $name} = $dom['idx']; ${'TT' . $name} = strtotime($dom['LastUpdate']); } else { if ($Type == 'Temp + Humidity + Baro') { $Wtemp = $dom['Temp'];
function RefreshZwave($node, $name = 'auto', $device = '') { global $domoticzurl, $time, $zwaveidx, $vijfmin, $actions; $devices = json_decode(curl($domoticzurl . 'json.htm?type=openzwavenodes&idx=' . $zwaveidx), true); //logwrite('Refreshing node '.$node.' '.$device.' '.$name); $zwaveurl = $domoticzurl . 'ozwcp/refreshpost.html'; $zwavedata = array('fun' => 'racp', 'node' => $node); $zwaveoptions = array('http' => array('header' => 'Content-Type: application/x-www-form-urlencoded\\r\\n', 'method' => 'POST', 'content' => http_build_query($zwavedata))); $zwavecontext = stream_context_create($zwaveoptions); for ($k = 1; $k <= 5; $k++) { $result = file_get_contents($zwaveurl, false, $zwavecontext); $actions = $actions + 1; if ($result === 'OK') { cset('timerefresh-' . $device, $time); break; } sleep(1); } if (cget('timedeadnodes') < $vijfmin) { cset('timedeadnodes', $time); foreach ($devices as $node => $data) { if ($node == "result") { foreach ($data as $index => $eltsNode) { if ($eltsNode["State"] == "Dead" && !in_array($eltsNode['NodeID'], array(50))) { $actions = $actions + 1; telegram('Node ' . $eltsNode['NodeID'] . ' ' . $eltsNode['Description'] . ' (' . $eltsNode['Name'] . ') marked as dead, reviving ' . ZwaveHasnodefailed($eltsNode['NodeID'])); sleep(2); Zwavecancelaction(); } } } } } return $result; }