Class properties:
Class methods:
Class properties:
Class methods:
Class properties:
Class methods:
//safe_exec('start /c "" "scripts\fp_mdm.bat'); //say("Запустилась");
$volume=round(65535*$params['VALUE']/100); $this->setProperty('volumeLevel',$params['VALUE']); safe_exec('..\\apps\\nircmd\\nircmdc setsysvolume '.$volume); say("Изменилась громкость до ".$params['VALUE']." процентов");
Class properties:
Class methods:
$this->setProperty('LastRun',date('Y-m-d H:i:s'));
$name='Cron_'.$this->object_title; SQLExec("DELETE FROM jobs WHERE title='".$name."'");
Class properties:
Class methods:
if ((int)$params['status']==0) { //callMethod('MegaD6-12.turnOn'); say("Потеряна связь",0); } else { say("Восстановлена связь",1); // callMethod('MegaD4-12.turnOff'); }
Class properties:
Class properties:
Class methods:
//$params["USER_OBJECT"]
//$params["USER_OBJECT"]
Class properties:
Class methods:
$this->setProperty('lastDone',time()); $this->setProperty('lastTime',date("d-m-Y")); $this->callMethod('refresh');
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); }
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; } */ $data1 = getHistoryValue("$ot.humidity", strtotime("-1 hour")); $data2 = getGlobal("$ot.humidity"); $data3 = (($data2) - ($data1)); $this->setProperty('raznica',round($data3,2)); if ($data1 > $data2) $this->setProperty('dinamic','<font color="blue">'."↓".'</font>'); if ($data1 < $data2) $this->setProperty('dinamic','<font color="red">'."↑".'</font>'); if ($data1 == $data2) $this->setProperty('dinamic',"≡"); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Humidity',$t); }
Class properties:
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:
$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);",1); $linked_room=$this->getProperty('LinkedRoom'); if ($linked_room!='') { callMethod($linked_room.'.onActivity'); // } // if ($this->object_title=='sensorMovement33' || $this->object_title=='sensorMovementRemote1' || $this->object_title=='sensorMovementRemote2') { //|| $this->object_title=='sensorMovement5' // return; // не реагируем на движение в спальне, по ip-сенсорам и по сенсору на втром этаже } ClearTimeOut("nobodyHome"); SetTimeOut("nobodyHome","callMethod('NobodyHomeMode.activate');", 1800); // выполняем если целый час никого не было 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'); // запускаем скрипт "доброе утро" } */ if (gg("SecurityArmedMode.active")!="0") { include_once(ROOT.'lib/hardware/smsgw.php'); $data="Тревога: ".gg("ThisComputer.somebodyHomeText"); $res=sendSMS("+79274043117",$data, "2791"); getUrl("http://sms.ru/sms/send?api_id=4dbfa4a5-b2b2-4bb4-e196-86ef4259be0f&to=79173980117&text=$data"); // runScript('callGSM'); include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); //$telegram_module->sendImageToAll($img); $telegram_module->sendMessageToUser(-1001114255674, "$data"); say("$data",5); } }
Class properties:
Class methods:
/*$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); */
/*$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); */
Class properties:
Class methods:
$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=2*60*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);
Class methods:
$linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Humidity', $this->getProperty("Humidity")); }
$linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Temperature', $this->getProperty("Temperature")); }
Class properties:
Class methods:
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',1);
$this->setProperty('active',0);
Class properties:
Class properties:
Class methods:
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOn'); } else { $this->callMethod('turnOff'); } /* if ($status=="0"){ $this->callMethod('turnOff'); } if ($status=="1"){ $this->callMethod('turnOn'); } */
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOff'); } else { $this->callMethod('turnOn'); }
$this->setProperty("status",0);
$this->setProperty("status",1);
Class properties:
Class methods:
$this->setProperty('status',1); $this->callMethod('sendCommand',array('command'=>'disco'));
$this->setProperty('status',0); $this->callMethod('sendCommand',array('command'=>'off'));
$this->setProperty('status',1); $this->callMethod('sendCommand',array('command'=>'on'));
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOn'); } else { $this->callMethod('turnOff'); }
$level=$this->getProperty("Level"); if ($level>0) { $this->callMethod('setLevel',array('level'=>$level)); } else { $this->callMethod('turnOff'); }
$colors=array( '#ff0000', '#00ff00', '#0000ff'); $color=$colors[rand(0,count($colors)-1)]; $this->callMethod('setColor',array('color'=>$color));
$this->setProperty('status',1); $this->setProperty('Mode','C'); if ($params['color']) { $this->setProperty('Color',$params['color']); } else { $params['color']=$this->getProperty('Color'); } $this->callMethod('sendCommand',array('command'=>'color','value'=>$params['color']));
$this->setProperty('Level',$params['level']); $this->callMethod('sendCommand',array('command'=>'level','value'=>$params['level']));
$this->setProperty('Mode','W'); $this->callMethod('sendCommand',array('command'=>'white'));
$this->setProperty('updated',time()); $this->setProperty('updatedTime',date('H:i')); include_once(ROOT.'lib/hardware/milight.php'); if (is_array($params)) { $command=$params['command']; $value=$params['value']; } else { $command=$params; } $host=$this->getProperty('Host'); $type=(int)$this->getProperty('LampType'); $zone=(int)$this->getProperty('Zone'); $milight = new Milight($host); $commands=''; if ($type==0) { $milight->setWhiteActiveGroup($zone); if ($command=='leveldown') { $milight->command('whiteBrightnessDown'); } if ($command=='levelup') { $milight->command('whiteBrightnessUp'); } if ($command=='level' && $value>=90) { $command='levelmax'; } if ($command=='level' && $value<=90) { $command='levelmin'; } if ($command=='levelmax') { $milight->command('whiteGroup'.$zone.'BrightnessMax'); } if ($command=='levelmin') { $milight->command('whiteGroup'.$zone.'BrightnessMin'); } if ($command=='nightmode') { $milight->command('whiteGroup'.$zone.'NightMode'); } if ($zone==1) { if ($command=='on') { $milight->whiteGroup1On(); } if ($command=='off') { $milight->whiteGroup1Off(); } } if ($zone==2) { if ($command=='on') { $milight->whiteGroup2On(); } if ($command=='off') { $milight->whiteGroup2Off(); } } if ($zone==3) { if ($command=='on') { $milight->whiteGroup3On(); } if ($command=='off') { $milight->whiteGroup3Off(); } } if ($zone==4) { if ($command=='on') { $milight->whiteGroup4On(); } if ($command=='off') { $milight->whiteGroup4Off(); } } } if ($type==1) { if ($command=='disco') { $milight->setRgbwActiveGroup($zone); $milight->rgbwSendOnToActiveGroup(); $milight->command('rgbwDiscoMode'); } if ($command=='discofaster') { $milight->setRgbwActiveGroup($zone); $milight->rgbwSendOnToActiveGroup(); $milight->command('rgbwDiscoFaster'); } if ($command=='discoslower') { $milight->setRgbwActiveGroup($zone); $milight->rgbwSendOnToActiveGroup(); $milight->command('rgbwDiscoSlower'); } if ($command=='level') { $milight->setRgbwActiveGroup($zone); $milight->rgbwBrightnessPercent($value); } if ($command=='color') { $milight->setRgbwActiveGroup($zone); $milight->rgbwSetColorHexString($value); } if ($zone==1) { if ($command=='on') { $milight->rgbwGroup1On(); } if ($command=='off') { $milight->rgbwGroup1Off(); } if ($command=='white') { $milight->rgbwGroup1SetToWhite(); } } if ($zone==2) { if ($command=='on') { $milight->rgbwGroup2On(); } if ($command=='off') { $milight->rgbwGroup2Off(); } if ($command=='white') { $milight->rgbwGroup2SetToWhite(); } } if ($zone==3) { if ($command=='on') { $milight->rgbwGroup3On(); } if ($command=='off') { $milight->rgbwGroup3Off(); } if ($command=='white') { $milight->rgbwGroup3SetToWhite(); } } if ($zone==4) { if ($command=='on') { $milight->rgbwGroup4On(); } if ($command=='off') { $milight->rgbwGroup4Off(); } if ($command=='white') { $milight->rgbwGroup4SetToWhite(); } } } sleep(1);
$this->setProperty('status',1); $this->callMethod('sendCommand',array('command'=>'discofaster'));
$this->setProperty('status',1); $this->callMethod('sendCommand',array('command'=>'discoslower'));
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 properties:
Class properties:
Class methods:
$data=gg('Dimmer01.level'); getUrl("http://192.168.2.144/uartbrget?data=TW$data");
Class properties:
Class methods:
$latestActivity=$this->getProperty('LatestActivity'); $this->setProperty('LatestActivity',time()); $this->setProperty('LatestActivityTime',date('H:i')); $this->setProperty('SomebodyHere',1); $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"); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onActivity.php'); /* end injection of {SDevices} */
$this->setProperty('SomebodyHere',0); //$this->setProperty('SomebodyHereTXT',"никого нет");
$rooms=getObjectsByClass("Rooms"); $total=count($rooms); for($i=0;$i<$total;$i++) { $rooms[$i]['room']=getGlobal($rooms[$i]['TITLE'].'.Title'); if (!$rooms[$i]['room']) { $rooms[$i]['room']=$rooms[$i]['TITLE']; } $rooms[$i]['active']=getGlobal($rooms[$i]['TITLE'].'.SomebodyHere'); $rooms[$i]['time']=getGlobal($rooms[$i]['TITLE'].'.LatestActivity'); $rooms[$i]['diff']=time()-$rooms[$i]['time']; } function rooms_cmp($a, $b) { if ($a['diff'] == $b['diff']) { return 0; } return ($a['diff'] < $b['diff']) ? -1 : 1; } usort($rooms,"rooms_cmp"); if (!$rooms[0]['active']) { $somebodyHomeText="Никого нет дома. Были в ".date('H:i',$rooms[0]['time'])." (".$rooms[0]['room'].")"; } else { $res_rooms=array(); for($i=0;$i<$total;$i++) { if ($rooms[$i]['active']) { $res_rooms[]=$rooms[$i]['room']; } } $somebodyHomeText="Кто-то дома: ".implode(", ",$res_rooms); } setGlobal('somebodyHomeText',$somebodyHomeText); //echo "Updated"; /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
require(DIR_MODULES.'devices/SDevices_logicAction.php');
require(DIR_MODULES.'devices/SDevices_statusUpdated.php');
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_setUpdatedText.php'); /* end injection of {SDevices} */
Class methods:
require(DIR_MODULES.'devices/SButtons_pressed.php');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_motionDetected.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} */
Class properties:
Class methods:
require(DIR_MODULES.'devices/SControllers_turnOn.php');
require(DIR_MODULES.'devices/SControllers_turnOff.php');
require(DIR_MODULES.'devices/SControllers_switch.php');
Class properties:
Class methods:
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/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 properties:
Class methods:
/* 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_tempUp.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_tempDown.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* 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 methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_statusUpdated.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['h'])) { return; } */ $data1 = getHistoryValue("$ot.temp", strtotime("-1 hour")); $data2 = getGlobal("$ot.temp"); $data3 = (($data2) - ($data1)); $this->setProperty('raznica',round($data3,2)); if ($data1 > $data2) $this->setProperty('dinamic','<font color="blue">'."↓".'</font>'); if ($data1 < $data2) $this->setProperty('dinamic','<font color="red">'."↑".'</font>'); if ($data1 == $data2) $this->setProperty('dinamic',"≡"); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.temp',$t); }
Class properties:
Class methods:
Class properties:
Class properties:
Class methods:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
Class properties:
Class properties:
, Россия
© 2024 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Public agreement
SmartLiving