Class properties:
Class methods:
Class objects:
/* begin injection of {Alarmclock} */ require(ROOT.'scripts/startup_maintenance.php'); /* end injection of {Alarmclock} */
/* begin injection of {Alarmclock} */ if (gg('EconomMode.active')<>1) { // Включаем режим автоматики CallMethod('AutoMode.activate'); Say('Выключаем подсветку',2); runScript("TurnLightsOff"); // Выключаем режим автоматики CallMethod('AutoMode.deactivate'); } setGlobal('minMsgLevel',3); /* end injection of {Alarmclock} */
/* begin injection of {Alarmclock} */ /* end injection of {Alarmclock} */
Class methods:
Class objects:
// device lost //if ($params['user']=='admin') { //sg('admin.atHome',0); include(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); //$telegram_module->sendMessageToUser(174019010, $params['user']." вышел"); //}
// new device include(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); //$telegram_module->sendMessageToUser(174019010, $params['name']." вошел"); $tm=registeredEventTime('btcall'); if ((time()-$tm)>60 || $tm<0) { registerEvent('btcall'); } if ($params['new']) { //say('Обнаружено новое блютуз устройство'); } if ($params['user']=='admin') { //sg('admin.atHome',1); //runScript('sendUserTelegram',"Тест BT дома"); //if(gg('EconomMode.active')==1) sg('EconomMode.active',0); }
Class properties:
Class methods:
$volume=round(65535*$params['VALUE']/100); $this->setProperty('volumeLevel',$params['VALUE']); safe_exec('..\\apps\\nircmd\\nircmdc setsysvolume '.$volume); say("Изменилась громкость до ".$params['VALUE']." процентов");
Class objects:
say('Система загружена', 2);
say("Отключено питание");
/**$command=$params['command']; $short_command=''; $dt=recognizeTime($command,$short_command); if (preg_match('/скажи сколько врем/is',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say('Сейчас '.timeNow(),2); } elseif (preg_match('/сколько время/is',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята'); echo $short_command; return; } say('Сейчас '.timeNow()); } elseif (preg_match('/повтори (.+)/is',$command,$m) || preg_match('/скажи (.+)/is',$command,$m)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say($m[1],2); } else { // say('Неизвестная команда...',2); }**/
Class properties:
Class methods:
$name='Cron_'.$this->object_title; SQLExec("DELETE FROM jobs WHERE title='".$name."'");
$this->setProperty('LastRun',date('Y-m-d H:i:s'));
Class objects:
$temp = exec('cat /sys/class/thermal/thermal_zone0/temp'); setGlobal('Sensor_temp06.value',$temp);
include(DIR_MODULES . 'backup/backup.class.php'); $backup_module = new backup(); $backup_module->create_backup();
Class properties:
Class methods:
require_once('/autoload.php'); use jalder\Upnp\Renderer; $url =$this->getProperty('playURL'); $r = $this->callMethod("findRenderer"); if($r) { $remote = new Renderer\Remote($r); $result = $remote->play($url); echo($result); }
require_once('/autoload.php'); use jalder\Upnp\Renderer; $r = $this->callMethod("findRenderer"); if($r) { $remote = new Renderer\Remote($r); $result = $remote->stop(); echo($result); }
require_once('/autoload.php'); use jalder\Upnp\Renderer; $id = $this->getProperty("RendererID"); $r = $this->getProperty("RendererData"); if($r) { $r = json_decode($r, true); } else { $renderer = new Renderer(); echo('searching...'.PHP_EOL); for($i=0; $i<3; $i++) { $renderers = $renderer->discover(); if(count($renderers)) break; } if(!count($renderers)){ echo('no upnp renderers found'.PHP_EOL); return; } foreach($renderers as $r){ $name = $r['description']['device']['friendlyName']; if($name == $id) { $this->setProperty("RendererData", json_encode($r)); break; } } } if(!$r) { echo $id." not found"; } return $r;
require_once('/autoload.php'); use jalder\Upnp\Renderer; $r = $this->callMethod("findRenderer"); if($r) { $remote = new Renderer\Remote($r); $result = $remote->unpause(); echo($result); }
require_once('/autoload.php'); use jalder\Upnp\Renderer; $r = $this->callMethod("findRenderer"); if($r) { $remote = new Renderer\Remote($r); $result = $remote->pause(); echo($result); }
Class objects:
Class properties:
Class methods:
//$params["USER_OBJECT"]
//$params["USER_OBJECT"]
Class objects:
Class properties:
Class methods:
//$params['t'] $this->setProperty("updated",time()); $this->setProperty("updatedTime",date("H:i",time())); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=30*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if (!isset($params['h'])) { return; } $old_temp=$this->getProperty('humidity'); $t=round($params['h'],1); if ($t>100) return; $this->setProperty('humidity',$t); if ($params['uptime']) { $this->setProperty('uptime',$params['uptime']); } if ($t>$old_temp) { $d=1; } elseif ($t<$old_temp) { $d=-1; } else { $d=0; } $this->setProperty('direction',$d); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Humidity',$t); }
Class objects:
Class properties:
Class methods:
if ($params['status']) { $this->setProperty('status',$params['status']); } $this->setProperty('updatedTimestamp',time()); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=12*60*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);
Class properties:
Class methods:
$this->setProperty('status',$params['status']); // выставляем статус сенсора $this->setProperty('updatedTimestamp',time()); // выставляем время срабатывания сенсора $this->setProperty('alive',1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=24*60*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if ($params['status']) { $this->setProperty('motionDetected',1); clearTimeOut($this->object_title.'_detected'); setTimeOut($this->object_title.'_detected',"setGlobal('".$this->object_title.".motionDetected',0);",30); $linked_room=$this->getProperty('LinkedRoom'); if ($linked_room!='') { callMethod($linked_room.'.onActivity'); } if ($this->object_title=='sensorMovement3' || $this->object_title=='sensorMovementRemote1' || $this->object_title=='sensorMovementRemote2') { //|| $this->object_title=='sensorMovement5' return; // не реагируем на движение в спальне, по ip-сенсорам и по сенсору на втром этаже } ClearTimeOut("nobodyHome"); SetTimeOut("nobodyHome","callMethod('NobodyHomeMode.activate');", 1*60*60); // выполняем если целый час никого не было if (getGlobal('NobodyHomeMode.active')) { callMethod('NobodyHomeMode.deactivate'); } $last_register=registeredEventTime('inhouseMovement'); // проверяем когда в последний раз срабатывало событие "движение внутри дома" registerEvent('inhouseMovement',$this->name,2); // регистрируем событие "движение внутри дома" if (timeBetween('05:00', '12:00') && ((time()-$last_register)>2*60*60)) { runScript('Greeting'); // запускаем скрипт "доброе утро" } }
Class objects:
Class properties:
Class methods:
$objn=$this->object_title; $currentcount=$this->getProperty("Total2"); $lasttotal=gg($objn.".lasttotal2"); SQLUpdate("objects", array("ID"=>$this->id, "DESCRIPTION"=>gg($objn.".FIO")." P:".gg($objn.".PvT")." U:".gg($objn.".U")." ".gg("sysdate")." ".gg("timenow"))); if (IsSet($lasttotal) and ($lasttotal<>0) ) { $rashod=$currentcount-$lasttotal; sg($objn.".rashodt2",$rashod);} sg($objn.".lasttimestamp", time()); sg($objn.".lasttotal2", $currentcount);
$objn=$this->object_title; $currentcount=$this->getProperty("Total1"); $lasttotal=gg($objn.".lasttotal1"); SQLUpdate("objects", array("ID"=>$this->id, "DESCRIPTION"=>gg($objn.".FIO")." P:".gg($objn.".PvT")." U:".gg($objn.".U")." ".gg("sysdate")." ".gg("timenow"))); if (IsSet($lasttotal) and ($lasttotal<>0) ) { $rashod=$currentcount-$lasttotal; sg($objn.".rashodt1",$rashod);} sg($objn.".lasttimestamp", time()); sg($objn.".lasttotal1", $currentcount);
Class objects:
Class properties:
Class methods:
if($this->getProperty('active')) { $this->callMethod('deactivate'); } else { $this->callMethod('activate'); }
if ($params['NEW_VALUE']==$params['OLD_VALUE']) return; $this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); $i=1; if ('WeekendMode.active' && ($this->getProperty('title')=='Темное время суток' || $this->getProperty('title')=='Ночной' || $this->getProperty('title')=='Никого нет дома' || $this->getProperty('title')=='Ночной')) $i=0; if ($this->getProperty('active')) { if ($this->getProperty('title')<>'auto') { say("Режим ".$this->getProperty('title')." активирован.",1); } } else { if ($this->getProperty('title')<>'auto') { say("Режим ".$this->getProperty('title')." выключен.",$i); } }
$this->setProperty('active',1);
$this->setProperty('active',0);
Class objects:
if (gg('Relay11.status')==0) CallMethod('Relay11.turnOn');
if (gg('Relay11.status')<>0) CallMethod('Relay11.turnOff');
setGlobal('minMsgLevel','2'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_activate.php'); /* end injection of {SDevices} */
setGlobal('minMsgLevel','1'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_activate.php'); /* end injection of {SDevices} */
if ($this->getProperty('active')==1) { if(gg('EconomMode.active')<>1) { // Включаем режим автоматики CallMethod('AutoMode.activate'); setGlobal('groupsublight.status',1); RunScript('Zhaluzioff'); // Если в зале никог нет есть, выключаем подсветку в зале if(gg('Zalvkvartire.SomebodyHere')<>1) callMethod('Zalvkvartire.turnOnOff',array('loadType'=>'sublight','OnOff'=>'turnOff')); // Выключаем режим автоматики CallMethod('AutoMode.deactivate'); } } else { if(gg('EconomMode.active')<>1) { // Если подсветка включена if(gg('Rgb01.status')==1 || gg('Relay17.status')==1 || gg('Rgb05.status')==1) { Say('Уже светло, можно выключить подсветку',2); // Включаем режим автоматики CallMethod('AutoMode.activate'); RunScript('TurnLightsOff'); // Выключаем режим автоматики CallMethod('AutoMode.deactivate'); } } } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_injects.php'); /* end injection of {SDevices} */
$objects = getObjectsByProperty('groupparty',1); foreach($objects as $object_title) { callMethod($object_title.'.turnOn'); }
$objects = getObjectsByProperty('groupparty',1); foreach($objects as $object_title) { callMethod($object_title.'.turnOff'); }
if ($this->getProperty('active')==1) RunScript('RunEconom'); else RunScript('RunAllAfterEconom');
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_activate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_injects.php'); /* end injection of {SDevices} */
if (gg('EconomMode.active')<>1) sg('EconomMode.active',1); Sg('somebodyHomeText','Никого нет дома или все спят'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_activate.php'); /* end injection of {SDevices} */
if (gg('EconomMode.active')==1) sg('EconomMode.active',0); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_deactivate.php'); /* end injection of {SDevices} */
Class methods:
Class objects:
include_once(DIR_MODULES.'app_radio/app_radio.class.php'); $app_radio=new app_radio(); if(is_array($params)) { if(isset($params['sta'])) $app_radio->change_station($params['sta'],$app_radio); if(isset($params['cmd'])) $app_radio->control($params['cmd']); if(isset($params['vol'])) $app_radio->set_volume($params['vol'],$app_radio); } else { if($params=='play' || $params=='stop') $app_radio->control($params); else if(strpos($params, "vol")===0) $app_radio->set_volume((int)substr($params,3),$app_radio); else if(strpos($params, "sta:")===0) $app_radio->change_station(substr($params,4),$app_radio); } /* begin injection of {app_radio} */ include_once(DIR_MODULES.'app_radio/app_radio.class.php'); $app_radio = new app_radio(); if(is_array($params)) { foreach($params as $key=>$value) { switch((string)$key) { case 'sta': $app_radio->change_station($params['sta'], $app_radio); break; case 'cmd': $app_radio->control($params['cmd']); break; case 'vol': $app_radio->set_volume($params['vol'], $app_radio); break; default: if($value == 'play' || $value == 'stop') $app_radio->control($value); elseif(strpos($value, 'vol') === 0) $app_radio->set_volume((int)substr($value, 3), $app_radio); elseif(strpos($value, 'sta:') === 0) $app_radio->change_station(substr($value, 4), $app_radio); } } } /* end injection of {app_radio} */
Class properties:
Class methods:
$this->setProperty("status",0);
$this->setProperty("status",1);
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOff'); } else { $this->callMethod('turnOn'); }
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOn'); } else { $this->callMethod('turnOff'); }
Class objects:
Class properties:
Class methods:
$this->setProperty("status",0); //safe_exec('"c:\Program Files\nooLite\noolite.exe" -api -off_ch'.$this->getProperty("channel")); $this->callMethod("sendCommand",array('command'=>'-off_ch'.$this->getProperty("channel")));
$this->setProperty("status",1); $this->callMethod("sendCommand",array('command'=>'-on_ch'.$this->getProperty("channel")));
$cmdline='"c:\Program Files\nooLite\nooLite.exe" -api '.$params['command']; $last_called=gg('NoolightCommandSend'); $min_delay=3; $now=time(); if (($now-$last_called)>$min_delay) { //safe_exec($cmdline); $last_callled=$now; sg('NoolightCommandSend',$last_called); DebMes("Noolite instant exec: ".$cmdline); system($cmdline); //exec($cmdline); } else { if ($last_callled<$now) { $last_callled=$now; } $last_called+=$min_delay; sg('NoolightCommandSend',$last_called); DebMes("Noolite scheduled job for ".date('H:i:s',$last_called)); AddScheduledJob("noolight".md5($cmdline),"safe_exec('".$cmdline."');",$last_called); }
Class properties:
Class methods:
$code1=$this->getProperty('Code1'); $code2=$this->getProperty('Code2'); safe_exec("c:\_majordomo\apps\arduino_gw\arduino_gw.exe rcon$code1:$code2;"); $this->setProperty("status",1);
$code1=$this->getProperty('Code1'); $code2=$this->getProperty('Code2'); safe_exec("c:\_majordomo\apps\arduino_gw\arduino_gw.exe rcoff$code1:$code2;"); $this->setProperty("status",0);
Class properties:
Class methods:
$loadType = $params['loadType']; $OnOff = $params['OnOff']; $linkedRoom = $this->object_title; $objects = getObjectsByProperty('group'.$loadType,1); foreach($objects as $obj) { if ($OnOff == 'turnOn') { //if ((gg($obj.'.linkedRoom') == $linkedRoom) && (gg($obj.'.status'))<>1) CallMethod($obj.'.turnOn'); if (gg($obj.'.linkedRoom') == $linkedRoom) CallMethod($obj.'.turnOn'); } if ($OnOff == 'turnOff') { //if ((gg($obj.'.linkedRoom') == $linkedRoom) && (gg($obj.'.status'))==1) CallMethod($obj.'.turnOff'); if (gg($obj.'.linkedRoom') == $linkedRoom) CallMethod($obj.'.turnOff'); } }
$objects=getObjectsByClass("SControllers"); foreach($objects as $obj) { $loadType = getGlobal($obj['TITLE'].".loadType"); // $loadType = $params['loadType']; $linkedRoom = getGlobal($obj['TITLE'].".linkedRoom"); if ($params['OnOff'] == 'turnOn') { if (($loadType == $params['loadType']) && ($linkedRoom == $this->object_title) && (gg($obj['TITLE'].'.status'))<>1) CallMethod($obj['TITLE'].'.turnOn'); } if ($params['OnOff'] == 'turnOff') { if (($loadType == $params['loadType']) && ($linkedRoom == $this->object_title) && (gg($obj['TITLE'].'.status'))==1) CallMethod($obj['TITLE'].'.turnOff'); } }
//echo "Updated"; /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onActivity.php'); /* end injection of {SDevices} */ ClearTimeOut("nobodyHome"); SetTimeOut("nobodyHome","callMethod('NobodyHomeMode.activate');", 1*60*60); // выполняем если целый час никого не было $last_register=registeredEventTime('inhouseMovement'); // проверяем когда в последний раз срабатывало событие "движение внутри дома" registerEvent('inhouseMovement',$this->name,2); // регистрируем событие "движение внутри дома" if (!$last_register || ((time()-$last_register)>2*60*60)) { // срабатывало более 2х часов назад // if (timeBetween('06:00', '12:00')) { // движение замечено утром // runScript('morningGreeting'); // запускаем скрипт "доброе утро" } // Кроме коридора не фиксируем движение с момента отключения // подсветки AlarmClock05 до будильника AlarmClock01 // или до 10:00 в выходной if ($this->object_title!='Koridorvkvartire') { if (getGlobal('WeekendMode.active')) { if (timeBetween(getGlobal('AlarmClock05.AlarmTime'), '10:00')) return; } elseif (timeBetween(getGlobal('AlarmClock05.AlarmTime'), getGlobal('AlarmClock01.AlarmTime'))) return; } // Если в комнате экономит автоматика if ($this->getProperty('Economy')==1) { // И если режим темного времени суток, включаем подсветку CallMethod('AutoMode.activate'); if (gg('DarknessMode.active') || ($this->object_title=='Koridorvkvartire') || ($this->object_title=='Koridorpervyyetazh')) callMethod($this->object_title.'.turnOnOff',array('loadType'=>'sublight','OnOff'=>'turnOn')); CallMethod('AutoMode.deactivate'); } $this->setProperty('Economy',0);
$this->setProperty('SomebodyHere',0); //$this->callMethod("updateActivityStatus"); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onIdle.php'); /* end injection of {SDevices} */ // И подсветку callMethod($this->object_title.'.turnOnOff',array('loadType'=>'sublight','OnOff'=>'turnOff')); $this->setProperty('Economy',1);
Class objects:
if (gg('SecurityArmedModeDacha')) { Say ('Аларм, движение на даче!!',5); RunScript('img2telegram'); }
if (gg('Zalvkvartire.illumination') > 700 && gg('Zalvkvartire.illumination') < 1100){ if(gg('Relay10.status') == 0) { sg('Relay10.status',1); } } else { if(gg('Relay10.status') == 1) { sg('Relay10.status',0); } }
// Выключаем телек if (gg('TVLGдом.status')==1) RunScript('AllMultimediaOff'); // И розетки CallMethod('Relay06.TurnOff');
if (gg('SecurityArmedModeHome')) { Say ('Аларм, движение в квартире!!',5); RunScript('img2telegram'); }
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_setUpdatedText.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_logicAction.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SButtons_pressed.php'); /* end injection of {SDevices} */
Class objects:
sg('Relay20.2',1); Sleep(1); sg('Relay20.2',1);
sg('Relay20.1',1); Sleep(1); sg('Relay20.1',1);
if ((float)gg('XiButton03.Rotate')>0) { Sg('Relay19.vol+',1); Sg('Relay19.vol+',1); Sg('Relay19.vol+',1); } else { Sg('Relay19.vol-',1); Sg('Relay19.vol-',1); Sg('Relay19.vol-',1); }
sg('AutoMode.active',0); RunScript('504');
sg('AutoMode.active',0); RunScript('1');
sg('AutoMode.active',0); Say('Выключаем телевизор',2); runScript('AllMultimediaOff');
sg('AutoMode.active',0); RunScript('Next');
sg('AutoMode.active',0); Say('Включаем телевизор',2); RunScript('WatchTV');
sg('Relay20.3',1);
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_takeSeries.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_takeSnapshot.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_updatePreview.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_motionDetected.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SControllers_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SControllers_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SControllers_switch.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_levelWorkUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_levelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_turnOff.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_statusUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class objects:
if($this->getProperty('status')==1){ cm('Relay38.turnOn'); cm('Relay39.turnOn'); } else { cm('Relay38.turnOff'); cm('Relay39.turnOff'); }
brLinkCommand('Tv_on');
brLinkCommand('Tv_on');
brLinkCommand('Свет_2+_440');
brLinkCommand('Свет_2-_441');
brLinkCommand('Свет_3-_444');
brLinkCommand('Свет_3+_442');
brLinkCommand('Свет_1+_438');
brLinkCommand('Свет_1-_439');
brLinkCommand('Аудиосистема_Audio On_104'); if(gg('Relay47.status'<>1)) cm('Relay47.turnOn');
brLinkCommand('Аудиосистема_Audio Off_105');
brLinkCommand('Свет_Ванная_161');
brLinkCommand('Свет_Ванная_161');
sg('Relay22.status',0); sg('Relay10.status',0); sg('Relay16.status',0); sg('Relay21.status',0); sg('Relay15.status',0);
sg('Relay22.status',0); sg('Relay10.status',0); sg('Relay16.status',0); sg('Relay21.status',0); sg('Relay15.status',0);
brLinkCommand('Nochnikspalon');
brLinkCommand('Nochnikspaloff');
brLinkCommand('Nochnikzaloff');
brLinkCommand('Nochnikzalon');
brLinkCommand('Svetspalon');
brLinkCommand('Svetspalon');
brLinkCommand('Svetkoron');
brLinkCommand('Svetkoron');
brLinkCommand('Condeyon'); sg('AC_Diamond.ACTemp',24); Say('Кондиционер включен',2); sleep(20); brLinkCommand('Condeymove'); sleep(3); brLinkCommand('Condeymove');
brLinkCommand('Condeyoff'); Say('Кондиционер выключен',1); sg('AC_Diamond.ACTemp',0);
brLinkCommand('Svetzalon');
brLinkCommand('Svetzalon');
cm('Relay19.turnOff');
RunScript('wol_mitv'); cm('Relay19.turnOn');
runScript("wol_vitalnew");
brLinkCommand('Pcoff');
brLinkCommand('Свет_Кухня_63');
brLinkCommand('Свет_Кухня_63');
if ($this->getProperty('status')==1) brLinkCommand('TV LG off');
if ($this->getProperty('status')<>1) brLinkCommand('TV LG on');
brLinkCommand('TV LG tvav'); sg('TVLG.av', '1');
brLinkCommand('TV LG tvav'); sg('TVLG.av', '0');
brLinkCommand('TV LG off'); sg('TVLG.status', '1'); sleep(7); brLinkCommand('TV LG tvav'); sg('TVLG.av', '1');
brLinkCommand('TV LG on'); sg('TVLG.status', '0');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_colorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_setColor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_turnOff.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_disable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_enable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_switchEnable.php'); /* end injection of {SDevices} */ if ($this->getProperty('disabled')) { $this->setProperty('disabled', 0); $this->setProperty('power', 1); } else { $this->setProperty('disabled', 1); $this->setProperty('power', 0); $this->setProperty('relay_status', 0); // turn off }
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_tempDown.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_tempUp.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_action.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_setColor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_colorUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueWorkUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_refreshStats.php'); /* end injection of {SDevices} */
// Вычисляем дельту за месяц $this->setProperty('delta_month', round($this->getProperty('value')-$this->getProperty('prev_value'), 2)); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueUpdated.php'); /* end injection of {SDevices} */
Class objects:
$Stat = $params['NEW_VALUE']; $StatOld = $params['OLD_VALUE']; if (($Stat!=$StatOld) && ($Stat==1)) { $val = $this->getProperty('valueWork'); $this->setProperty('valueWork', ($val+1)); }
$Stat = $params['NEW_VALUE']; $StatOld = $params['OLD_VALUE']; if (($Stat!=$StatOld) && ($Stat==1)) { $val = $this->getProperty('valueWork'); $this->setProperty('valueWork', ($val+1)); }
Class properties:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_alert.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_statusUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions_motionDetected.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* $ot=$this->object_title; $tm=time(); $this->setProperty('updated', $tm); $this->setProperty('updatedText', date('H:i', $tm)); $this->setProperty('alive', 1); $alive_timeout=(int)$this->getProperty('aliveTimeout')*60*60; if (!$alive_timeout) { $alive_timeout=2*24*60*60; // 2 days alive timeout by default } ////$alive_timeout=5; setTimeout($ot.'_alive_timer', 'setGlobal("'.$ot.'.alive", 0);', $alive_timeout); if ($this->getProperty('isActivity')) { $linked_room=$this->getProperty('linkedRoom'); if (getGlobal('NobodyHomeMode.active')) { callMethod('NobodyHomeMode.deactivate'); } ClearTimeOut("nobodyHome"); SetTimeOut("nobodyHome","callMethod('NobodyHomeMode.activate');", 1*60*60); if ($linked_room) { callMethod($linked_room.'.onActivity', array('sensor'=>$ot)); } } $this->callMethod('logicAction'); include_once(DIR_MODULES.'devices/devices.class.php'); $dv=new devices(); $dv->checkLinkedDevicesAction($this->object_title, $this->getProperty('status')); begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php'); /* end injection of {SDevices} */ /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_alert.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_valueUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class properties:
Class objects:
sg('Zalvkvartire.illumination',gg('Sensor_light01.value'));
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_loadStatusChanged.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_loadStatusChanged.php'); /* end injection of {SDevices} */
Class objects:
if(GetGlobal('Sensor_state01.status')==2) { if(GetGlobal('SecurityArmedModeHome.active')<>1) SetGlobal('SecurityArmedModeHome.active','1'); } else if(GetGlobal('SecurityArmedModeHome.active')==1) SetGlobal('SecurityArmedModeHome.active','0');
if(GetGlobal('Sensor_state01.status')==2) { if(GetGlobal('SecurityArmedModeDacha.active')<>1) SetGlobal('SecurityArmedModeDacha.active','1'); } else if(GetGlobal('SecurityArmedModeDacha.active')==1) SetGlobal('SecurityArmedModeDacha.active','0');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STempHumSensors_valueUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class objects:
sg('Thermostat01.value',gg('ZontSensor_temp05.value'));
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_alert.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_statusUpdated.php'); /* end injection of {SDevices} */
Class methods:
Class objects:
echo "status received: ".$params['status'];
global $voicemode; $voicemode='off'; processCommand($params['message']);
Class properties:
Class methods:
Class objects:
$details=array(); $red_state=0; //$yellow_state=0; if (!isOnline('Роутер дача')) { $red_state=1; //$details[]="Связь с дачей потеряна"; } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say("Статус дачи изменился на ".$state_title."."); say(implode(". ",$details)); } else { say("Статус дачи восстановился на ".$state_title); } $this->callMethod('stateChanged'); }
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_injects.php'); /* end injection of {SDevices} */
$details=array(); $red_state=0; $yellow_state=0; if (!isOnline('Internet')) { $yellow_state=1; // $details[]=LANG_GENERAL_NO_INTERNET_ACCESS; } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_injects.php'); /* end injection of {SDevices} */
$details=array(); $red_state=0; $yellow_state=0; $cycles=array('states'=>'states','main'=>'main','execs'=>'exec','scheduler'=>'scheduler'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>5*60) { $red_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } $cycles=array('ping'=>'ping','webvars'=>'webvars'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>10*60) { $yellow_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } if ((int)gg('ThisComputer.SpaceProblems')>0) { $red_state=1; $details[]="Недостаточно места на диске (".gg('ThisComputer.SpaceProblems_Details').').'; } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/system_checkstate.php'); /* end injection of {SDevices} */
$details=array(); $red_state=0; $yellow_state=0; if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
Class properties:
Class methods:
//$params['t'] $this->setProperty("updated",time()); $this->setProperty("updatedTime",date("H:i",time())); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=30*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if (!isset($params['t'])) { return; } $old_temp=$this->getProperty('temp'); $t=round($params['t'],1); if ($t>110) return; $this->setProperty('temp',$t); if ($params['uptime']) { $this->setProperty('uptime',$params['uptime']); } if ($t>$old_temp) { $d=1; } elseif ($t<$old_temp) { $d=-1; } else { $d=0; } $this->setProperty('direction',$d); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Temperature',$t); }
Class objects:
Class properties:
Class methods:
////if(GetGlobal('Motion01.status') == 1) CallMethod('Motion01.motionDetected');
setGlobal('day',date('l')); setGlobal('date',date('d.m.Y')); setGlobal('dateymd',date('Ymd'));
Class objects:
$h=(int)date('G',time()); $m=date('i',time()); // Кукушка if (($h>=8) && getGlobal('clockChimeEnabled')) { if ($m=="00") { say(timeNow(),1); } } setGlobal('timeNow',date('H:i')); setGlobal('TimeNowH',date('H')); setGlobal('TimeNowM',date('i')); $homeStatus=date('H:i'); if (getGlobal('NobodyHomeMode.active')) { $homeStatus.=' Дома никого'; } else { $homeStatus.=' Дома кто-то есть'; } $homeStatus.=' '.getGlobal('Security.stateDetails'); $homeStatus.=' '.getGlobal('System.stateDetails'); $homeStatus.=' '.getGlobal('Communication.stateDetails'); $homeStatus.=' '.getGlobal('Dacha.stateDetails'); setGlobal('HomeStatus',$homeStatus); if (timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')=="1") { setGlobal("isDark",0); sg('DarknessMode.active',0); } elseif (!timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')!="1") { setGlobal("isDark",1); sg('DarknessMode.active',1); } /*if (timeIs(getGlobal('SunRiseTime'))) { if ('WeekendMode.active') say('Всходит солнце',0); else say('Всходит солнце',2); } if (timeIs(getGlobal('SunSetTime'))) { say('Солнце заходит',2); }*/ // Теперь мы каждый час будем проверять на выходной if ($m=="15") { runScript('isWorking'); } // 25 числа каждого месяца скидываем текущие показания счетчиков воды в prev_value if (date('d')==26 && date("H:i")=='03:00'){ sg('Counter01.prev_value', gg('Counter01.value')); sg('Counter02.prev_value', gg('Counter02.value')); sg('Counter01.delta_month',0); sg('Counter02.delta_month',0); }
Class properties:
Class methods:
Class properties:
Class methods:
Class objects:
//schedule $this->setProperty('ACTemp',22); $this->setProperty('mode','econom');
$Stat = $params['NEW_VALUE']; $StatOld = $params['OLD_VALUE']; if ($Stat!=$StatOld) { if ($this->getProperty('Work')==0) { $this->setProperty('Text_Logo ',''); } else $this->setProperty('Text_Logo ','logo_sun'); }
//жара $this->setProperty('ACTemp',25); $this->setProperty('mode','unknown');
//off $this->setProperty('ACTemp',5); $this->setProperty('mode','schedule');
$Stat = $params['NEW_VALUE']; $StatOld = $params['OLD_VALUE']; if ($Stat!=$StatOld) { if ($this->getProperty('mode')=="unknown") { $this->setProperty('ACTemp',25); Say('Котел в режиме жара',2); } if ($this->getProperty('mode')=="econom") { $this->setProperty('ACTemp',22); Say('Котел работает по расписанию',2); } if ($this->getProperty('mode')=="idle") { $this->setProperty('ACTemp',15); Say('Котел в эконом режиме',2); } if ($this->getProperty('mode')=="comfort") { $this->setProperty('ACTemp',21); Say('Котел в рабочем режиме',2); } if ($this->getProperty('mode')=="schedule") { $this->setProperty('ACTemp',5); Say('Котел выключен',2); } }
if (gg('Relay34.status')==0) { CallMethod('Relay34.turnOn'); sg('AC_Diamond.ACTemp',5); } else { CallMethod('Relay34.turnOff'); sg('AC_Diamond.ACTemp',0); }
//econom $this->setProperty('ACTemp',15); $this->setProperty('mode','idle');
//comfort $this->setProperty('ACTemp',21); $this->setProperty('mode','comfort');
if (gg('ClimateControl.active')<>1) { CallMethod('ClimateControl.activate'); sg('AC_Diamond.Text_1', 'Климат выкл.'); } else { CallMethod('ClimateControl.deactivate'); sg('AC_Diamond.Text_1', 'Климат вкл.'); }
if (gg('Relay11.status')<>1) { CallMethod('Relay11.turnOn'); sg('AC_Diamond.ACTemp',24); } else { CallMethod('Relay11.turnOff'); sg('AC_Diamond.ACTemp',0); }
if (gg('Relay11.move')==0) { brLinkCommand('Condeymove'); sg('Relay11.move',1); } else { brLinkCommand('Condeymove'); sg('Relay11.move',0); }
if (gg('AC_Diamond.ACTemp')>18) { brLinkCommand('Condey-'); sg('AC_Diamond.ACTemp',gg('AC_Diamond.ACTemp')-1); }
if (gg('AC_Diamond.ACTemp')<30) { brLinkCommand('Condey+'); sg('AC_Diamond.ACTemp',gg('AC_Diamond.ACTemp')+1); }
Class objects:
brLinkCommand('TV_0');
brLinkCommand('TВ_9_31');
brLinkCommand('TВ_Right_20');
brLinkCommand('TВ_Down_21');
brLinkCommand('TV_source');
brLinkCommand('TВ_8_30');
brLinkCommand('TВ_OK_18');
brLinkCommand('TВ_7_29');
brLinkCommand('TВ_6_28');
brLinkCommand('TВ_3_25');
brLinkCommand('TВ_5_27');
brLinkCommand('TВ_1_23');
brLinkCommand('TВ_2_24');
brLinkCommand('TВ_Right_20');
brLinkCommand('TВ_Left_22');
brLinkCommand('TВ_Down_21');
brLinkCommand('TВ_4_26');
brLinkCommand('TВ_Up_19');
brLinkCommand('TВ_OK_18');
brLinkCommand('TВ_Menu_17');
brLinkCommand('TВ_Exit_16');
brLinkCommand('TВ_Channel-_15');
brLinkCommand('TВ_Vol-_12');
brLinkCommand('TВ_Vol+_11');
if (gg('TVLGдом.status')==0) brLinkCommand('TVon'); else brLinkCommand('TVoff');
brLinkCommand('TВ_Channel+_14');
brLinkCommand('TВ_Mute_13');
Class objects:
brLinkCommand('Приставка_Channel+_129');
brLinkCommand('Приставка_9_142');
brLinkCommand('Приставка_0_143');
brLinkCommand('Приставка_Left_146');
brLinkCommand('Приставка_Info_152');
brLinkCommand('Приставка_Info_152');
brLinkCommand('Приставка_Down_145');
brLinkCommand('Приставка_Rec_158');
brLinkCommand('Приставка_Pause_157');
brLinkCommand('Приставка_OK_133');
brLinkCommand('Приставка_Guide_150');
brLinkCommand('Приставка_UP_144');
brLinkCommand('Приставка_8_141');
brLinkCommand('Приставка_Right_147');
brLinkCommand('Приставка_7_140');
brLinkCommand('Приставка_6_139');
brLinkCommand('Приставка_4_137');
brLinkCommand('Приставка_5_138');
brLinkCommand('Приставка_2_135');
brLinkCommand('Приставка_3_136');
brLinkCommand('Приставка_OnOff_124');
brLinkCommand('Приставка_Mute_126');
brLinkCommand('Приставка_Channel-_130');
brLinkCommand('Приставка_1_134');
brLinkCommand('Приставка_Vol+_127');
brLinkCommand('Приставка_Vol-_128');
brLinkCommand('Приставка_Back_125');
Class methods:
Class objects:
if ($params['serial']=='' && $params['devname']!='') { $params['serial']=$params['devname']; } $device=SQLSelectOne("SELECT * FROM usbdevices WHERE SERIAL LIKE '".$params['serial']."'"); if (!$device['ID']) { // new device connected //say("Подключено новое устройство",1); $device=array(); $device['SERIAL']=$params['serial']; $device['TITLE']='устройство '.$params['devname']; $device['FIRST_FOUND']=date('Y-m-d H:i:s'); $device['LAST_FOUND']=date('Y-m-d H:i:s'); $device['LOG'].=$device['FIRST_FOUND'].' подключено (впервые)'."\n"; $device['ID']=SQLInsert('usbdevices',$device); } else { // device already in our database //say("Подключено ".$device['TITLE'],1); if ($device['USER_ID']) { $user=SQLSelectOne("SELECT * FROM users WHERE ID='".$device['USER_ID']."'"); if ($user['ID']) { //$user['NAME']; // теперь мы знаем имя пользователя, связанного с этим устройством } } $device['LAST_FOUND']=date('Y-m-d H:i:s'); $device['LOG']=$device['LAST_FOUND'].' подключено'."\n".$device['LOG']; SQLUpdate('usbdevices',$device); if ($device['SCRIPT_ID']!='') { runScript($device['SCRIPT_ID'],$params); } elseif ($device['SCRIPT']!='') { eval($device['SCRIPT']); } }
Class properties:
Class methods:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
$this->setProperty('atHome',1);
$this->setProperty('atHome',0);
Class objects:
Class properties:
Class objects:
, Россия
© 2024 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Public agreement
SmartLiving