Class properties:
Class methods:
$this->setProperty('latestCheck',date('Y-m-d H:i:s')); $ot=$this->object_title; $online=0; $url='http://'.$this->getProperty('ip').':3344/printer/info'; $raw=getURL($url); if ($raw) { $data=json_decode($raw,true); if ($data['apikey']) { $online=1; $this->setProperty('api_key',$data['apikey']); $this->setProperty('online',1); setTimeout($ot.'_initialize',"cm('$ot.initialize');",60*60); $this->callMethod('getStatus'); } } if (!$online) { $this->setProperty('status','offline'); $this->setProperty('online',0); setTimeout($ot.'_initialize',"cm('$ot.initialize');",5*60); }
$chat_id=$this->getProperty('chat_id'); $active_job=$this->getProperty('active_job'); say("Печать модели завершена на ".$this->getProperty('progress')." процентов.",2); if ($chat_id!='') { include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $telegram_module->sendMessageToUser($chat_id,"Печать задачи $active_job выполнена на ".$this->getProperty('progress').'%'); $image_url=$this->getProperty('webcam_url'); if ($image_url) { $data=getURL($image_url.'&'.time()); $image_file=ROOT.'cms/cached/3d_'.$this->getProperty('printerName').'.jpg'; SaveFile($image_file,$data); //dprint($image_file); $telegram_module->sendImageToUser($chat_id, $image_file, $active_job); } }
$active_job=$this->getProperty('active_job'); $this->setProperty('start_time',time()); say("Начата печать модели.",2);
$ot=$this->object_title; $online=0; $url='http://'.$this->getProperty('ip').':3344/printer/list/'.$this->getProperty('printerName').'?apikey='.$this->getProperty('api_key'); $raw=getURL($url); $old_status = $this->getProperty('status'); if ($raw) { $this->setProperty('latestCheck',date('Y-m-d H:i:s')); $data=json_decode($raw,true); //if (is_array($data['data'][0])) { $data=$data['data'][0]; $active_job=$data['job']; if ($active_job && $active_job!='none') { //dprint($data,false); $this->setProperty('active_job',$active_job); $progress=round($data['done'],2); $this->setProperty('progress',$progress); $this->setProperty('status','printing'); if ($old_status!='printing') { $this->callMethod('started'); } $passed=time()-$this->getProperty('start_time'); if ($progress>0) { $need_more=$passed*100/$progress; $this->setProperty('end_time',time()+$need_more); $this->setProperty('end_time_text',date('H:i',time()+$need_more)); } } else { $this->setProperty('status','idle'); if ($old_status=='printing') { $this->callMethod('done'); } } //} setTimeout($ot.'_status',"cm('$ot.getStatus');",15); }
Class properties:
Class methods:
Class properties:
Class methods:
$radio=$this->getProperty('playRadio'); $terminal=$this->getProperty('linkedTerminal'); echo "playMedia('$radio','$terminal')"; if ($radio && $terminal) { playMedia($radio,$terminal); }
$terminal=$this->getProperty('linkedTerminal'); if ($terminal) { $terminal_id = getTerminalsByName($terminal, 1)[0]; if ($terminal_id['ID']) { $url = BASE_URL . ROOTHTML . 'ajax/app_player.html?'; $url .= "&command=stop"; $url .= "&terminal_id=".$terminal_id['ID']; getURL($url); } }
Class properties:
Class methods:
$ot=$this->object_title; $interval=2; $total=3; $method_name=$ot.'.snapshot'; callMethod($method_name); for($i=0;$i<$total;$i++) { setTimeout($ot.'_snap'.$i,"callMethod('$method_name');",$interval*$i); }
$this->setProperty('active',1); $this->setProperty('activated',time()); $ot=$this->object_title; $this->callMethod('updateCameras'); setTimeout('activate_'.$ot,'callMethod("'.$ot.'.deactivate");',60); $this->callMethod('multipleSnapshots');
$this->setProperty('active',0); $this->callMethod('updateCameras');
$ot=getObjectsByClass('Camera'); $total=count($ot); $total_active=0; $html=''; for($i=0;$i<$total;$i++) { $active=getGlobal($ot[$i]['TITLE'].'.active'); $cam_html=processTitle(getGlobal($ot[$i]['TITLE'].'.html')); setGlobal($ot[$i]['TITLE'].'.htmlProcessed',$cam_html); if ($active) { $total_active++; if ($total_active>1) { $html.='<br/>'; } $html.=$cam_html; } } setGlobal('ActiveCameras',$total_active); setGlobal('ActiveCamerasHTML',$html);
//say("Делаю снимок",2); $path=$this->getProperty('snapshotPath'); if ($path!='') { if (!is_dir($path)) mkdir($path,0777); $html=$this->getProperty('htmlProcessed'); if (preg_match('/src="(.+?)"/is',$html,$m)) { $image_url=$m[1]; if (substr($image_url,0,1)=='/') { $image_url=BASE_URL.$image_url; $image_url=str_replace('live=1','live=0',$image_url); $image_url=preg_replace('/w=\d+/','',$image_url); $image_url=preg_replace('/h=\d+/','',$image_url); } $filename=$path.'/'.$this->object_title.'_'.date('Ymd_His').'.jpg'; $data=file_get_contents($image_url); if ($data) { SaveFile($filename,$data); return $filename; } else { echo "Cannot save snapshot of ".$image_url; } } }
Class properties:
Class methods:
Class properties:
Class methods:
$counter=$params['counter']; $passed=$params['passed']; $old_counter=$this->getProperty("counter"); if ($counter>0) { $old_counter+=$counter; $this->setProperty("counter",$old_counter); $this->setProperty("power",round($old_counter/150)); } if ($passed>0) { $speed=round((($counter*60*60/$passed)/150),2); $this->setProperty("speed",$speed); } $this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i'));
Class properties:
Class methods:
if (!$params['command']) { DebMes("EasyRF incorrect command request for Device ".$this->getProperty('DeviceID')); return 0; } $last_called=gg('EasyRFCommandSend'); $min_delay=1; $now=time(); //$url='http://192.168.0.75/?RF,'.$this->getProperty('DeviceID').'-'.$params['command'].'-'.$params['value']; $url='http://192.168.0.66//cgi-bin/master?op=send&line=sendrf'.$this->getProperty('DeviceID').'-'.$params['command'].'-'.$params['value'].';'; if (($now-$last_called)>$min_delay) { $last_callled=$now; sg('EasyRFCommandSend',$last_called); DebMes("EasyRF command instant sent: ".$url); getURL($url,0); } else { if ($last_callled<$now) { $last_callled=$now; } $last_called+=$min_delay; sg('EasyRFCommandSend',$last_called); DebMes("EasyRFCommandSend scheduled job for ".date('H:i:s',$last_called)); AddScheduledJob("EasyRF".md5($url),"getURL('".$url."',0);",$last_called); }
Class methods:
$this->callMethod('sendCommand',array('command'=>25,'value'=>$params['num']));
Class methods:
$this->callMethod('sendCommand',array('command'=>19,'value'=>1)); $this->setProperty('status',1);
$this->callMethod('sendCommand',array('command'=>19,'value'=>2)); $this->setProperty('status',2);
$this->callMethod('sendCommand',array('command'=>19,'value'=>3));
$this->callMethod('sendCommand',array('command'=>19,'value'=>0)); $this->setProperty('status',0);
Class properties:
Class methods:
if ($this->getProperty('status')) { $this->callMethod('turnOn'); } else { $this->callMethod('turnOff'); }
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i'));
$this->callMethod('sendCommand',array('command'=>22,'value'=>$this->getProperty('output'))); $this->setProperty('status',0);
$this->callMethod('sendCommand',array('command'=>20,'value'=>$this->getProperty('output'))); $this->setProperty('status',1);
$this->callMethod('sendCommand',array('command'=>21,'value'=>$this->getProperty('output'))); $this->setProperty('status',0);
Class properties:
Class methods:
//$params["user"]
//$params["user"]
Class properties:
Class methods:
require(DIR_MODULES.'devices/processHomebridgeMQTT.inc.php');
Class properties:
Class methods:
if ($this->getProperty('lastDone')) { $tm=$this->getProperty('lastDone'); $passed_seconds=time()-$tm; $passed_days=floor($passed_seconds/60/60/24); $this->setProperty('passedDone',$passed_days); if ($passed_days>$this->getProperty('period')) { $this->setProperty('late',1); } else { $this->setProperty('late',0); } } else { $this->setProperty('late',1); }
$this->setProperty('lastDone',time()); $this->callMethod('refresh');
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=12*60*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);
Class properties:
Class methods:
if (IsSet($params['status'])) { $this->setProperty('status',$params['status']); // выставляем статус сенсора } else{ $params['status']=$this->getProperty('status'); } $this->setProperty('updatedTimestamp',time()); // выставляем время срабатывания сенсора $this->setProperty('alive',1); $ot=$this->object_title; if ($params['status']) { DebMes("Motion sensor $ot status: ".$params['status']); } $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', array('sensor'=>$this->object_title)); } }
Class properties:
Class methods:
$ot=$this->object_title; clearTimeOut($ot.'_update'); $url=$this->getProperty('URL'); $data=getURL($url.'/requests/status.xml',0,$this->getProperty('Username'),$this->getProperty('Password')); if (preg_match('/<state>/is',$data)) { $this->setProperty('active',1); setTimeout($ot.'_update',"callMethod('$ot.update');",10); } else { $this->setProperty('active',0); setTimeout($ot.'_update',"callMethod('$ot.update');",60); } if (preg_match('/<state>playing<\/state>/is',$data)) { if (preg_match('/<volume>(\d+)<\/volume>/is',$data,$m)) { $this->setProperty('Volume',$m[1]); } $this->setProperty('isPlaying',1); if (preg_match('/\'artist\'>(.+?)<\/info>/is',$data,$m)) { $this->setProperty('Artist',$m[1]); } elseif ($this->getProperty('Artist')!='') { $this->setProperty('Artist',''); } if (preg_match('/\'album\'>(.+?)<\/info>/is',$data,$m)) { $this->setProperty('Album',$m[1]); } elseif ($this->getProperty('Album')!='') { $this->setProperty('Album',''); } if (preg_match('/\'title\'>(.+?)<\/info>/is',$data,$m)) { $this->setProperty('Title',$m[1]); } elseif ($this->getProperty('Title')!='') { $this->setProperty('Title',''); } if (preg_match('/\'filename\'>(.+?)<\/info>/is',$data,$m)) { $this->setProperty('Filename',$m[1]); } elseif ($this->getProperty('Filename')!='') { $this->setProperty('Filename',''); } if (preg_match('/\'artwork_url\'>(.+?)<\/info>/is',$data,$m)) { //$this->setProperty('ArtURL',$url.'/art?'.urlencode($m[1])); $filename='art_'.md5($m[1]); if (!file_exists(ROOT.'cached/'.$filename.'.png')) { $art_img=getURL($url.'/art?'.$filename,0,$this->getProperty('Username'),$this->getProperty('Password')); if ($art_img!='Error') { SaveFile(ROOT.'cached/'.$filename.'.png',$art_img); $this->setProperty('ArtURL','/cached/'.$filename.'.png'); } else { $this->setProperty('ArtURL',''); } } elseif ($this->getProperty('ArtURL')!='/cached/'.$filename.'.png') { $this->setProperty('ArtURL','/cached/'.$filename.'.png'); } } elseif ($this->getProperty('ArtURL')!='') { $this->setProperty('ArtURL',''); } if (preg_match('/\'track_number\'>(.+?)<\/info>/is',$data,$m)) { $this->setProperty('Track',$m[1]); } elseif ($this->getProperty('Track')!='') { $this->setProperty('Track',''); } } else { $this->setProperty('isPlaying',0); if ($this->getProperty('ArtURL')!='') { $this->setProperty('ArtURL',''); } }
Class properties:
Class methods:
$ot = $this->object_title; $tries=(int)$this->getProperty('currentTries'); $tries++; $this->setProperty('currentTries',$tries); $maxTries=(int)$this->getProperty('maxTries'); if (!$maxTries) { $maxTries=3; } if ($tries>$maxTries) { $this->setProperty('status',0); } else { setTimeout($ot.'_nextTry','cm("'.$ot.'.checkStatus");',30); }
$this->setProperty('latestCheck',date('Y-m-d H:i:s')); $url=$this->getProperty('url'); $username=$this->getProperty('username'); $password=$this->getProperty('password'); $match=$this->getProperty('match'); if ($url!='') { $data=getURL($url,0,$username,$password); if ($data!='' && $match=='') { echo "Data OK"; $this->callMethod('correctResponse'); } elseif ($match!='' && preg_match('/'.$match.'/is',$data)) { echo "Matched $match"; $this->callMethod('correctResponse'); } else { echo "Data Incorrect"; $this->callMethod('incorrectResponse'); } }
$this->setProperty('status',1); $this->setProperty('currentTries',0); $this->setProperty('updated',time()); $this->setProperty('updatedText',date('Y-m-d H:i:s')); $ot=$this->object_title; setTimeout($ot.'_timeout','setGlobal("'.$ot.'.status",0);',1*60*60);
Class properties:
Class methods:
$url=$this->getProperty('switchURL'); //$url='http://'.$this->getProperty('host').'/?CLICK,'.$this->getProperty('pin'); getURL($url,0);
if (!$this->getProperty('status')) { $this->callMethod('switch'); }
if ($this->getProperty('status')) { $this->callMethod('switch'); }
Class properties:
Class methods:
$this->setProperty('updated',time()); $this->setProperty('updatedTime',date('H:i',time())); $this->setProperty('status',0);
$this->setProperty('updated',time()); $this->setProperty('updatedTime',date('H:i',time())); $this->setProperty('status',1);
$this->setProperty('updated',time()); $this->setProperty('updatedTime',date('H:i',time()));
Class properties:
Class methods:
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); if ($this->getProperty('active')) { say("Режим ".$this->getProperty('title')." активирован."); } else { say("Режим ".$this->getProperty('title')." деактивирован."); }
$this->setProperty('active',0);
$this->setProperty('active',1);
Class properties:
Class methods:
//$params['v'] $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['v'])) { return; } $old_value=$this->getProperty('value'); $v=round($params['v'],1); $this->setProperty('value',$v); if ($params['uptime']) { $this->setProperty('uptime',$params['uptime']); } if ($v>$old_value) { $d=1; } elseif ($v<$old_value) { $d=-1; } else { $d=0; } $this->setProperty('direction',$d); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { //setGlobal($linked_room.'.Temperature',$t); }
Class properties:
Class methods:
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i'));
$this->setProperty("status",1);
$this->setProperty("status",0);
$status=$this->getProperty("status"); if (!$this->getProperty('movedModule')) { if ($status) { $this->callMethod('turnOn'); } else { $this->callMethod('turnOff'); } $this->callMethod("onChange"); }
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOff'); } else { $this->callMethod('turnOn'); }
Class properties:
Class methods:
$url='http://'.$this->getProperty('Host').'/?ON,'.$this->getProperty('Pin'); getURL($url,0); $this->setProperty("status",0);
$url='http://'.$this->getProperty('Host').'/?OFF,'.$this->getProperty('Pin'); getURL($url,0); $this->setProperty("status",1);
Class properties:
Class methods:
callMethod($this->getProperty('linkedObject').'.turnOff'); $this->setProperty("status",0);
callMethod($this->getProperty('linkedObject').'.turnOn'); $this->setProperty("status",1);
$ot=$this->object_title; clearTimeOut($ot.'_work');
$ot=$this->object_title; callMethod($ot.'.turnOn'); setTimeOut($ot.'_work','callMethod("'.$ot.'.turnOff");say("Розетка отключена",1);',$this->getProperty('workingDelay')*60); say("Таймер розетки запущен",1);
Class properties:
Class methods:
$command=$params['command']; getURL('http://'.$this->getProperty('host').'/cgi-bin/master?op=send&line='.$command,0);
if ($this->getProperty('movedModule')) return; $cmdline='"c:\Program Files\nooLite\nooLite.exe" -api '.$params['command']; $last_called=gg('NoolightCommandSend'); $min_delay=1; $now=time(); if (($now-$last_called)>$min_delay) { $last_callled=$now; sg('NoolightCommandSend',$last_called); DebMes("Noolite instant exec: ".$cmdline); safe_exec($cmdline); //system($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."');safe_exec('".$cmdline."');",$last_called); }
$this->setProperty("status",0); //safe_exec('"c:\Program Files\nooLite\noolite.exe" -api -off_ch'.$this->getProperty("channel")); if (!$this->getProperty('movedModule')) { if (!$this->getProperty('host')) { $this->callMethod("sendCommand",array('command'=>'-off_ch'.$this->getProperty("channel"))); } else { $this->callMethod("sendHostCommand",array('command'=>'nloff'.$this->getProperty("channel"))); } }
$this->setProperty("status",1); //safe_exec('"c:\Program Files\nooLite\noolite.exe" -api -on_ch'.$this->getProperty("channel")); if (!$this->getProperty('movedModule')) { if (!$this->getProperty('host')) { $this->callMethod("sendCommand",array('command'=>'-on_ch'.$this->getProperty("channel"))); } else { $this->callMethod("sendHostCommand",array('command'=>'nlon'.$this->getProperty("channel"))); } }
Class properties:
Class methods:
if ($params['value']) { $this->setProperty("brightness",$params['value']); } elseif (!$this->getProperty('status') && $this->getProperty('brightness')) { $this->setProperty('status',1); } elseif (!$this->getProperty('brightness')) { $this->setProperty('status',0); } $this->callMethod("refresh");
$this->setProperty("status",1); $this->setProperty("brightness",100); $this->callMethod("refresh");
$value=$this->getProperty("brightness"); if (!$this->getProperty('status')) { $value=0; } elseif (!$value) { $value=100; $this->setProperty('brightness',$value); } //safe_exec('"c:\Program Files\nooLite\noolite.exe" -api -set_ch'.$this->getProperty("channel").' -'.$value); $this->callMethod("sendCommand",array('command'=>'-set_ch'.$this->getProperty("channel").' -'.$value));
$this->setProperty("status",0); //$this->setProperty("brightness",0); $this->callMethod("refresh");
Class properties:
Class methods:
$brightness=$this->getProperty("brightness"); $r=$this->getProperty("R"); $g=$this->getProperty("G"); $b=$this->getProperty("B"); if (!$this->getProperty('status')) { $r=0; $g=0; $b=0; $brightness=0; } else { if (!$brightness) { $brightness=100; $this->setProperty("brightness",$brightness); } } $sum=$r+$g+$b; if ($sum==0) { $sum=1; } $r_value=round((255*$r/$sum)*$brightness/100); $g_value=round((255*$g/$sum)*$brightness/100); $b_value=round((255*$b/$sum)*$brightness/100); if ($this->getProperty("rolling")) { $this->callMethod("sendCommand",array('command'=>'-roll_color_ch'.$this->getProperty("channel"))); } else { $this->callMethod("sendCommand",array('command'=>'-set_color_ch'.$this->getProperty("channel").' -'.$r_value.' -'.$g_value.' -'.$b_value)); } /* if ($brightness>0) { $this->setProperty('status',1); } else { $this->setProperty('status',0); } */
Class properties:
Class methods:
getURL("http://192.168.0.114/send?data=rcoff".$this->getProperty('Code1').":".$this->getProperty('Code2').";",0); $this->setProperty("status",0);
getURL("http://192.168.0.114/send?data=rcon".$this->getProperty('Code1').":".$this->getProperty('Code2').";",0); $this->setProperty("status",1);
Class properties:
Class methods:
$url='http://'.$this->getProperty('Host').'/?LCLICK,'.$this->getProperty('OnPin'); getURL($url,0); $this->setProperty("status",1);
$url='http://'.$this->getProperty('Host').'/?RCLICK,'.$this->getProperty('OffPin'); getURL($url,0); $this->setProperty("status",0);
Class properties:
Class methods:
$room_terminal=$this->getProperty('terminal'); $room_greeting=$this->getProperty('greeting'); if ($room_terminal && $room_greeting) { $room_greeting=processTitle($room_greeting,$this); sayTo($room_greeting,1,$room_terminal); }
//echo "Updated"; /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php'); /* end injection of {SDevices} */
$this->setProperty('SomebodyHere',0); $this->callMethod("updateActivityStatus"); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onIdle.php'); /* end injection of {SDevices} */
$latestActivity=$this->getProperty('LatestActivity'); $this->setProperty('LatestActivity',time()); $this->setProperty('LatestActivityTime',date('H:i')); if (!$this->getProperty('SomebodyHere')) { $this->setProperty('SomebodyHere',1); $this->callMethod('onNewActivity'); if ((time()-$latestActivity)>1*60*60) { $this->callMethod('onNewActivityLong'); } } /* $camera=$this->getProperty('LinkedCamera'); if ($camera) { callMethod($camera.'.activate'); } */ $ot=$this->object_title; if ($this->getProperty("IdleDelay")) { $activity_timeout=(int)$this->getProperty("IdleDelay"); } else { $activity_timeout=10*60; } clearTimeOut($ot."_activity_timeout"); setTimeOut($ot."_activity_timeout","callMethod('".$ot.".onIdle');",$activity_timeout); $this->callMethod("updateActivityStatus"); if ($this->object_title=='Bedroom' && timeBetween('23:00', '09:00')) { return; // не реагируем на движение в спальне } if (($this->object_title=='Kidroom' || $this->object_title=='GuestRoom' || $this->object_title=='Hall2' || 0 ) && getGlobal('NobodyHomeMode.active')) { return; // не реагируем внутренние датчики, если никого нет дома } ClearTimeOut("nobodyHome"); SetTimeOut("nobodyHome","callMethod('NobodyHomeMode.activate');", 1*60*60); // выполняем если целый час никого не было if (getGlobal('NobodyHomeMode.active')) { callMethod('NobodyHomeMode.deactivate',array('sensor'=>$params['sensor'],'room'=>$ot)); } $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'); // запускаем скрипт "доброе утро" } } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onActivity.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_setUpdatedText.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SDevices_logicAction.php');
require(DIR_MODULES.'devices/SDevices_statusUpdated.php');
Class properties:
Class methods:
require(DIR_MODULES.'devices/SButtons_pressed.php');
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_updatePreview.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_motionDetected.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
require(DIR_MODULES.'devices/SControllers_turnOff.php');
require(DIR_MODULES.'devices/SControllers_switch.php');
require(DIR_MODULES.'devices/SControllers_turnOn.php');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_levelWorkUpdated.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_levelUpdated.php');
require(DIR_MODULES.'devices/SDimmers_turnOn.php');
require(DIR_MODULES.'devices/SDimmers_turnOff.php');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_statusUpdated.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_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOn.php'); /* end injection of {SDevices} */
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_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_setColor.php'); /* end injection of {SDevices} */
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_switchEnable.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_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_tempUp.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_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOn.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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueUpdated.php'); /* end injection of {SDevices} */
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_statusUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
require(DIR_MODULES.'devices/SMotions_motionDetected.php');
Class properties:
Class methods:
require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php');
Class properties:
Class methods:
require(DIR_MODULES.'devices/SSensors_valueUpdated.php');
Class properties:
Class properties:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_loadStatusChanged.php'); /* end injection of {SDevices} */
runScript('calcOtherPower'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_valueUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STempHumSensors_valueUpdated.php'); /* end injection of {SDevices} */
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_statusUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_next.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_previous.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_seeknext.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_seekprevious.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_pause-unpause.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_volume.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_stop.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_playNextUrl.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_playUrl.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaRenderer_mute-unmute.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMediaServer_getFileList.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
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'])) { $t=$this->getProperty('temp'); } else { $t=round($params['t'],1); if ($t>110) return; $old_temp=$this->getProperty('temp'); $this->setProperty('temp',$t); 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); } if ($params['uptime']) { $this->setProperty('uptime',$params['uptime']); }
Class properties:
Class methods:
say("ТЦЛ",1); sg('TV_TCL.RemoteVisible',1); sg('Rostel_Hall.RemoteVisible',0); sg('Rostel_Bed.RemoteVisible',0); sg('TV_LG.RemoteVisible',0);
say("ростел спальня",1); sg('Rostel_Bed.RemoteVisible',1); sg('Rostel_Hall.RemoteVisible',0); sg('TV_TCL.RemoteVisible',0); sg('TV_LG.RemoteVisible',0);
say("ростел зал",1); sg('Rostel_Hall.RemoteVisible',1); sg('Rostel_Bed.RemoteVisible',0); sg('TV_TCL.RemoteVisible',0); sg('TV_LG.RemoteVisible',0);
say("элджи",1); sg('TV_LG.RemoteVisible',1); sg('TV_TCL.RemoteVisible',0); sg('Rostel_Hall.RemoteVisible',0); sg('Rostel_Bed.RemoteVisible',0);
say("ТЦЛ",1); sg('TV_TCL.RemoteVisible',1); sg('Rostel_Hall.RemoteVisible',0); sg('Rostel_Bed.RemoteVisible',0); sg('TV_LG.RemoteVisible',0);
say("ростел зал",1); sg('Rostel_Hall.RemoteVisible',1); sg('Rostel_Bed.RemoteVisible',0); sg('TV_TCL.RemoteVisible',0); sg('TV_LG.RemoteVisible',0);
say("элджи",1); sg('TV_LG.RemoteVisible',1); sg('TV_TCL.RemoteVisible',0); sg('Rostel_Hall.RemoteVisible',0); sg('Rostel_Bed.RemoteVisible',0);
say("ростел спальня",1); sg('Rostel_Bed.RemoteVisible',1); sg('Rostel_Hall.RemoteVisible',0); sg('TV_TCL.RemoteVisible',0); sg('TV_LG.RemoteVisible',0);
Class properties:
Class methods:
//$params["location"]
say($this->getProperty('fullName').' подъехал к локации '.$params['LOCATION'],1);
@include_once(ROOT . 'languages/devices_' . SETTINGS_SITE_LANGUAGE . '.php'); @include_once(ROOT . 'languages/devices_default' . '.php'); $ot = $this->object_title; $updatedTime = $this->getProperty('CoordinatesUpdatedTimestamp'); $passed = time() - $updatedTime; $newTimeout=0; if ($passed<10) { $newTimeout = 10; $this->setProperty('updatedText',LANG_DEVICES_PASSED_NOW); } elseif ($passed<60) { $newTimeout = 10; $this->setProperty('updatedText',$passed.' '.LANG_DEVICES_PASSED_SECONDS_AGO); } elseif ($passed<60*60) { $newTimeout = 60; $this->setProperty('updatedText',round($passed/60).' '.LANG_DEVICES_PASSED_MINUTES_AGO); /* } elseif ($passed<12*60*60) { $newTimeout = 60 * 60; $this->setProperty('updatedText',round($passed/60/60).' '.LANG_DEVICES_PASSED_HOURS_AGO); */ } elseif ($passed<20*60*60) { //just time $newTimeout = 60 * 60; $this->setProperty('updatedText',date('H:i',$updatedTime)); } else { //time and date $this->setProperty('updatedText',date('d.M.Y H:i',$updatedTime));// } if ($newTimeout > 0) { setTimeOut($ot.'_updateTime','callMethod("'.$ot.'.setUpdatedText");',$newTimeout); }
$ot=$this->object_title; $filename="c:/data/Dropbox/MyNotes/".$ot.'_wunderlist.txt'; $old_data=LoadFile($filename); $new_data=$this->getProperty('WunderlistTasksToday'); if ($old_data!=$new_data) { SaveFile($filename,$new_data); }
$this->setProperty('latestTraining',date('Y-m-d H:i:s')); $this->setProperty('trainingPassed',0);
$this->setProperty('isGoingHome',1); setTimeOut('goingHomeTimer'.$this->id,"setGlobal('".$this->object_title.".isGoingHome',0);",2*60*60);
$this->setProperty('atHome',0);
if (timeBetween('05:00','10:00')) { say("Доброе утро!",2); if (gg('needOpenCurtains')) { setGlobal('needOpenCurtains',0); runScript('moveCurtainsBedroom',array('open'=>1)); runScript('moveCurtains',array('open'=>1)); } if (gg('DarknessMode.active')) { //включаем свет в прихожей callMethod('lcw0.turnOn'); //включаем свет на кухне callMethod('lcw8.turnOn'); //включаем свет в спальне callMethod('noo7.turnOn'); } }
$name=$this->getProperty('fullname'); if (!$this->getProperty('atHome')) { if (gg('WaitingSomebody.active')) { cm('WaitingSomebody.deactivate'); if (gg('sensorEntry.status')) { say('Автоматически открываем ворота для '.$name,2); callMethod('EntryGates.open'); } } $this->setProperty('atHome',1); if ($name) { say($name.' уже здесь',2); //setTimeout($this->object_title.'greetingTimer','say("'.$name.', добрый день!",1);',5*60); } } //runScript('checkStreetLight'); setTimeout($this->object_title.'athometimer','sg("'.$this->object_title.'.atHome",0);',8*60*60); $this->setProperty('isGoingHome',0);
Class properties:
Class methods:
$ot=$this->object_title; if ((float)$this->getProperty("windLatest")>=3) { clearTimeOut("windOver"); if (!$this->getProperty("isWindy")) { say("Похоже поднялся ветер...",1); //sg("ignoreEntryGates",1); $this->setProperty('isWindy',1); } } else { if ($this->getProperty("isWindy")) { clearTimeOut("windOver"); setTimeOut("windOver",'setGlobal("'.$ot.'.isWindy",0);say("Ветер стих...",1);',15*60); } }
$ot=$this->object_title; if ((float)$this->getProperty("rainfallRate")>0) { $this->setProperty("latestRain",time()); clearTimeOut("rainOver"); if (!$this->getProperty("isRain")) { say("Похоже пошёл дождь...",1); } $this->setProperty("isRain",1); } else { if ($this->getProperty("isRain")) { clearTimeOut("rainOver"); setTimeOut("rainOver",'say("Дождь закончился...",1);setGlobal("'.$ot.'.isRain",0);',15*60); } }
$this->setProperty("updatedTimestamp",time()); $this->setProperty("Alive",1); $ot=$this->object_title; clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".Alive',0);",30*60); sg('Sensor_temp11.value',$this->getProperty('tempOutside')); sg('Sensor_humidity09.value',$this->getProperty('relHumOutside'));
Class properties:
Class methods:
$ot=$this->object_title; $status=ping($this->getProperty('ip')); $online=$this->getProperty('online'); if ($status) { $this->setProperty('LastSeen',date('Y-m-d H:i:s')); setTimeout($ot.'_connection_check','callMethod("'.$ot.'.check");',30*60); } if ($online && !$status) { $this->setProperty('online',0); $this->callMethod('disconnected'); } elseif (!$online && $status) { $this->setProperty('online',1); }
$last_seen=strtotime($this->getProperty('LastSeen')); if ($last_seen>0) { $missing=time()-$last_seen; $this->setProperty('MissingPeriod',$missing); } else { $missing=0; } $missingDays=round($missing/24/60/60); $this->setProperty('LastSeen',date('Y-m-d H:i:s')); $user=$this->getProperty('User'); if ($user) { callMethod($user.'.gotHome',array('missing'=>$missing)); } elseif ($missingDays>=2) { say('Появилось устройство '.$this->object_title.' (не было дней: '.$missingDays.', IP-адрес: '.$this->getProperty('IP').')',1); } elseif ($missing == 0) { say('Появилось новое устройство в сети '.$this->object_title.' (IP-адрес: '.$this->getProperty('IP').')',1); } $this->callMethod('check');
© 2024 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Public agreement
SmartLiving