Свойства класса:
Методы класса:
Объекты класса:
/* begin injection of {Alarmclock} */ sg('switchbuttons.command_off', 1); /* end injection of {Alarmclock} */
Свойства класса:
Методы класса:
$this->setProperty('volumeLevel',$params['VALUE']); if (IsWindowsOs()) { $volume=round(65535*$params['VALUE']/100); safe_exec('..\\apps\\nircmd\\nircmdc setsysvolume '.$volume); } else { safe_exec('amixer sset PCM,0 '.$params['VALUE'].'%'); } say("Изменилась громкость до ".$params['VALUE']." процентов");
Объекты класса:
$command=$params['command']; $short_command=''; $dt=recognizeTime($command,$short_command); if (preg_match('/скажи сколько врем/uis',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say('Сейчас '.timeNow(),2); } elseif (preg_match('/сколько время/uis',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята'); echo $short_command; return; } say('Сейчас '.timeNow()); } elseif (preg_match('/повтори (.+)/uis',$command,$m) || preg_match('/скажи (.+)/uis',$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); }
say("Отключено питание");
Свойства класса:
Методы класса:
getURL('http://192.168.1.179/gpio?st=1&pin=4');
Объекты класса:
Свойства класса:
Методы класса:
//$params["USER_OBJECT"]
//$params["USER_OBJECT"]
Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/processHomebridgeMQTT.inc.php');
Объекты класса:
Объекты класса:
Свойства класса:
Методы класса:
$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);
if ($this->getProperty('active')) { $this->setProperty('active', 0); } else { $this->setProperty('active', 1); }
Объекты класса:
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_activate.php'); /* end injection of {SDevices} */
$objects=getObjectsByProperty('groupSunrise','=','1'); if (is_array($objects)) { foreach($objects as $obj) { callMethod($obj.'.turnOff'); } } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_activate.php'); /* end injection of {SDevices} */
if (gg('DarknessMode.active')) { $objects=getObjectsByProperty('greetingOnGroup','=','1'); if (is_array($objects)) { foreach($objects as $obj) { callMethod($obj.'.turnOn'); } } } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_deactivate.php'); /* end injection of {SDevices} */ //ClearTimeOut('svetvannaOff'); //ClearTimeOut('svetwcOff'); //ClearTimeOut('svetkoridorOff');
$objects=getObjectsByProperty('groupEco','=','1'); if (is_array($objects)) { foreach($objects as $obj) { callMethod($obj.'.turnOff'); } } $objects=getObjectsByProperty('allOffGroup','=','1'); if (is_array($objects)) { foreach($objects as $obj) { callMethod($obj.'.turnOff'); } } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_activate.php'); /* end injection of {SDevices} */ //sg('Button29.status', 1); cm("Relay05.TurnOff"); //SetTimeOut(‘svetvannaOff’,"sg('Button35.status', 1);", 20*60); //SetTimeOut(‘svetwcOff’,"sg('Button33.status', 1);", 20*60); //SetTimeOut(‘svetkoridorOff’,"sg('switchbuttons.command_off', 1);", 3*60); //SetTimeOut(‘ReleyHungdiOff’,"sg('Button38.status', 1);", 2); ///sg('Button35.status', 1); ///sg('Button33.status', 1); sg('switchbuttons.command_off', 1); //sg('Button38.status', 1); brLinkCommand('туалет OFF'); brLinkCommand('ванная OFF'); //getURL('localhost/modules/dev_broadlink/command.php?command=ванная OFF'); brLinkCommand('Hongdi_Выкл все реле'); //SetTimeOut(‘svetvannaOff’,"sg('Button35.status', 1);", 20*60); //SetTimeOut(‘svetwcOff’,"sg('Button33.status', 1);", 20*60); //SetTimeOut(‘svetkoridorOff’,"sg('switchbuttons.command_off', 1);", 3*60); //SetTimeOut(‘ReleyHungdiOff’,"sg('Button38.status', 1);", 2);
Методы класса:
Объекты класса:
/* 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} */
Свойства класса:
Методы класса:
$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); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onIdle.php'); /* end injection of {SDevices} */
$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 cmp($a, $b) { if ($a['diff'] == $b['diff']) { return 0; } return ($a['diff'] < $b['diff']) ? -1 : 1; } usort($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} */
Объекты класса:
brLinkCommand('туалет OFF'); //sg('Button33.status', 1); getURL('http://192.168.1.179/gpio?st=0&pin=4');
getURL('http://192.168.1.179/gpio?st=1&pin=4'); //brLinkCommand('ванная ON'); //brLinkCommand('туалет ON'); //brLinkCommand('туалет OFF'); //brLinkCommand('туалет ON'); // //sg('Button32.status', 1); //getURL('http://192.168.1.179/gpio?st=1&pin=4'); //brLinkCommand('ванная ON');
brLinkCommand('ванная OFF'); brLinkCommand('ванная OFF');
//brLinkCommand('ванная ON');
brLinkCommand('коридор ВЫКЛ ВСЁ TC2_504'); //выключаем свет в коридоре по таймеру бездействия
brLinkCommand('кухня 1 лампа_1-клавиша_666'); //выключаем осн свет кухни
brLinkCommand('Зал 2 кнопки TC2_ВСЕ_ВЫКЛ_574'); //cm("Relay05.TurnOff"); if (timeBetween('00:01', '09:01')) { cm("Relay05.TurnOff"); //sg("XiDimmer02.level",3); //cm("XiRelay08.TurnOn"); //cm("XiRelay13.TurnOn"); //SetTimeOut('LightOFF','cm("Relay05.TurnOff");',300); //SetTimeOut('GateOn','sg("XiDimmer02.level",0);',30); //SetTimeOut('Light1XiRelay08OFF','cm("XiRelay08.TurnOff");',300); //SetTimeOut('Light1XiRelay13OFF','cm("XiRelay13.TurnOff");',190); }
//brLinkCommand('туалет OFF'); //sg('Button33.status', 1); //getURL('http://192.168.1.179/gpio?st=0&pin=4');
//getURL('http://192.168.1.179/gpio?st=1&pin=4'); //brLinkCommand('ванная ON'); //brLinkCommand('туалет ON'); //brLinkCommand('туалет OFF'); //brLinkCommand('туалет ON'); // //sg('Button32.status', 1); //getURL('http://192.168.1.179/gpio?st=1&pin=4'); //brLinkCommand('ванная ON');
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_setUpdatedText.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SDevices_statusUpdated.php');
require(DIR_MODULES.'devices/SDevices_logicAction.php');
Свойства класса:
Методы класса:
if ($this->getProperty('statusfackeDet')) { $this->setProperty('command_on', 1); } else { $this->setProperty('command_off', 1); }
if ($this->getProperty('statusfacke')) { $this->setProperty('command_on', 1); } else { $this->setProperty('command_off', 1); }
require(DIR_MODULES.'devices/SButtons_pressed.php');
Объекты класса:
//if (gg('XiRelay08.Status')==0) { //cm("miioRelay07.TurnOn"); //SetTimeOut('TimerRele','cm("XiRelay08.TurnOn");',2); //} //else { //cm("XiRelay08.TurnOff"); //cm("miioRelay07.TurnOff"); // Тут смотри сам - нужна тебе такая строчка или нет //}
if (gg('XiRelay08.Status')==0) { cm("miioRelay07.TurnOn"); SetTimeOut('TimerRele','cm("XiRelay08.TurnOn");',2); } else { cm("XiRelay08.TurnOff"); cm("miioRelay07.TurnOff"); // Тут смотри сам - нужна тебе такая строчка или нет }
brLinkCommand('коридор ВЫКЛ ВСЁ TC2_504');
brLinkCommand('детская Вкл TC2_1-клавиша_497');
brLinkCommand('детская Выкл TC2_1-клавиша_498');
brLinkCommand('коридор ВКЛ ВСЁ TC2_503');
brLinkCommand('коридор ВЫКЛ ВСЁ TC2_504');
say('кондей в решиме для сна');
say('телевизор самсунг ');
say('включаем кондей на 24 градуса');
say('выключаем кондиционер', 2);
say('включаем кондей на 23 градуса');
say('кондей в турбо режиме...');
/* 1 - Анекдот; 2 - Рассказы; 3 - Стишки; 4 - Афоризмы; 5 - Цитаты; 6 - Тосты; 8 - Статусы; 11 - Анекдот (+18); 12 - Рассказы (+18); 13 - Стишки (+18); 14 - Афоризмы (+18); 15 - Цитаты (+18); 16 - Тосты (+18); 18 - Статусы (+18); */ function GetJoke($ctype = 1) { $pretext = array("Слушай", "Слушайте шутку", "Слушай анекдот", "Вот шутка смешная", "Еще шутка"); $number = mt_rand(0, count($pretext) - 1); $res = geturl('http://rzhunemogu.ru/Rand.aspx?CType=' . $ctype, 0); $res = win2utf($res); $xml = new SimpleXMLElement($res); $joke = trim(preg_replace('/\s{2,}/', ' ', $xml->content)); $joke = $pretext[$number] . ': ' . $joke; if (strlen($joke) > 500) { sleep(10); GetJoke(); } else { //return $joke; //say($pretext[$number].':', 1); say($joke, 1); } } //if (gg('ThisComputer.SayJokes') != 0) { GetJoke(); //}
Свойства класса:
Методы класса:
/* 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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_takeSeries.php'); /* end injection of {SDevices} */
Объекты класса:
Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SControllers_turnOff.php');
require(DIR_MODULES.'devices/SControllers_switch.php');
require(DIR_MODULES.'devices/SControllers_turnOn.php');
Свойства класса:
Методы класса:
/* 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} */
require(DIR_MODULES.'devices/SDimmers_turnOn.php');
require(DIR_MODULES.'devices/SDimmers_turnOff.php');
require(DIR_MODULES.'devices/SDimmers_levelUpdated.php');
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_statusUpdated.php'); /* end injection of {SDevices} */
/* 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_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_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOn.php'); /* end injection of {SDevices} */
Объекты класса:
//cm("торшер.switch"); //cm("Rele5.TurnOff");
Свойства класса:
Методы класса:
/* 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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_colorUpdated.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_turnOff.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_turnOn.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_enable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_disable.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_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} */
Свойства класса:
Методы класса:
/* 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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueWorkUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Свойства класса:
Методы класса:
/* 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} */
Объекты класса:
Свойства класса:
Методы класса:
if (timeBetween('14:31', '09:01')) { //cm("Relay05.TurnOn"); //sg("XiDimmer02.level",3); cm("XiRelay08.TurnOn"); cm("XiRelay13.TurnOn"); //SetTimeOut('LightOFF','cm("Relay05.TurnOff");',300); //SetTimeOut('GateOn','sg("XiDimmer02.level",0);',30); SetTimeOut('Light1XiRelay08OFF','cm("XiRelay08.TurnOff");',300); SetTimeOut('Light1XiRelay13OFF','cm("XiRelay13.TurnOff");',190); }
require(DIR_MODULES.'devices/SMotions_motionDetected.php');
Объекты класса:
SetTimeOut('NoBodyBedroom','rs("NoBodyBedroom");',60*10);
SetTimeOut('NoBodyKinderroom','rs("NoBodyKinderroom");',60*10);
if (timeBetween('15:30', '09:00')) { //cm("Relay05.TurnOn"); sg("XiDimmer02.level",1); //cm("XiRelay08.TurnOn"); //cm("XiRelay13.TurnOn"); //cm("Button18.pressed"); //SetTimeOut('LightOFF','cm("Relay05.TurnOff");',300); //SetTimeOut('LightOFFshkaf','cm("Button17.pressed");',30); SetTimeOut('GateOn','sg("XiDimmer02.level",0);',20); //SetTimeOut('Light1XiRelay08OFF','cm("XiRelay08.TurnOff");',300); //SetTimeOut('Light1XiRelay13OFF','cm("XiRelay13.TurnOff");',190); } if (timeOutExists('LightOFFshkaf')) { SetTimeOut('LightOFFshkaf', 'cm("Button17.pressed");',120); } if (timeOutExists('LightmorningOFFshkaf')) { SetTimeOut('LightmorningOFFshkaf', 'cm("Button17.pressed");',120); }
//brLinkCommand('туалет ON'); //sg('Button32.status', 1); SetTimeOut('NoBodyToilet','rs("NoBodyToilet");',60*2); getURL('http://192.168.1.179/gpio?st=0&pin=16');
Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php');
Объекты класса:
//---------------------------------------- //callMethod('Camera01.takeSnapshot'); //---------------------------------------- //exec("ffmpeg -i rtsp://192.168.1.162/unicast -vframes 1 -r 1 -s 1280x720 /var/www/cms/images/474/$(date +'%Y%m%d_%H%M%S').jpg"); if ($this->getProperty('status')==0) { say('Дверь открыта'); //runScript('SendToNotifyEvents', array('text' => 'Дверь открылась')); sg("XiDimmer02.level",2); SetTimeOut('Gate1On','sg("XiDimmer02.level",0);',10); } else { say('Дверь закрыта'); //runScript('SendToNotifyEvents', array('text' => 'Дверь закрыта')); } //if (timeBetween('17:30', '23:30')) { if (timeBetween(gg('SunSet30m'), '23:30')) { cm("Button18.pressed"); //SetTimeOut('LightOFF','cm("Relay05.TurnOff");',300); SetTimeOut('LightOFFshkaf','cm("Button17.pressed");',60); //SetTimeOut('Light1XiRelay13OFF','cm("Button17.pressed");',20); } if (timeBetween('05:00', '10:30')) { //if (timeBetween('05:00', gg('SunRise1h'))) { cm("Button18.pressed"); SetTimeOut('LightmorningOFFshkaf','cm("Button17.pressed");',40); } //If (gg('NobodyHomeMode.active')) { //callMethod('Camera01.takeSnapshot'); // callMethod('Camera01.takeSnapshot'); // callMethod('Camera01.takeSnapshot'); //---------------------------------------- // callMethod('Camera01.takeSnapshot'); //---------------------------------------- //exec("ffmpeg -i rtsp://192.168.1.162/unicast -vframes 1 -r 1 -s 1280x720 /var/www/cms/images/474/$(date +'%Y%m%d_%H%M%S').jpg"); //} // Делаем фотку с конкретной камеры // callMethod('Camera03.takeSnapshot'); // Считываем путь до файла //http://192.168.1.114/cms/images/474/20180930_195612.jpg //$img = './cms/images/'.gg('Camera01.snapshot'); // Отправляем фотку в телеграм Админу // include_once(DIR_MODULES . 'telegram/telegram.class.php'); // $telegram_module = new telegram(); // $telegram_module->sendImageToAdmin($img); //$telegram_module->sendImageToAdmin("/var/www/cms/images/474/$(date +'%Y%m%d_%H%M%S').jpg"); $img ='/var/www/cms/images/474/' .date('y_m_d_H_i_s') .'.jpg'; exec('ffmpeg -i rtsp://192.168.1.162/unicast -vframes 1 -r 1 -s 1920x1080 ' . $img); // Отправляем фотку в телеграм Админу include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $telegram_module->sendImageToAdmin($img); SetTimeOut('photocam3sec','runScript("photocam2");',2); exec('rm ' .$img); exec('rm ' .$img1);
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_alert.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SSensors_valueUpdated.php');
Свойства класса:
Объекты класса:
Свойства класса:
Объекты класса:
Объекты класса:
Свойства класса:
Методы класса:
/* 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} */
Объекты класса:
Свойства класса:
Методы класса:
include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $luts=gg("MiVacuumCleaner.timestamp"); $diff=(gmdate('i',trim(time()-$luts))); $pattern = "|\b[0]+([1-9][\d]*)|is"; $diff2= preg_replace($pattern, "\\1", $diff); $status .= "Информация о пылесосе была обновлена " .$diff2 . " минут назад."; if (gg('MiVacuumCleaner.online')=='1') {$status =$status." Пылесос на связи, "; } else {$status=$status." Связь с пылесосом отсутсвует,";} if (gg("MiVacuumCleaner.state_text")=='Charging') {$status =$status." заряжается, установлен на базе, "; } if (gg("MiVacuumCleaner.state_text")=='Cleaning') {$status =$status." производит уборку, "; } if (gg("MiVacuumCleaner.state_text")=='Back to home') {$status =$status." едет на базу, "; } if (gg("MiVacuumCleaner.state_text")=='Sleeping') {$status =$status." отдыхает от трудовых будней, "; } if (gg("MiVacuumCleaner.state_text")=='Pause') {$status =$status." установлен на паузу, "; } //$status .= " температура двигателя ".round(gg("kia ceed.etemp"))." градусов, температура в салоне ".round(gg("kia ceed.ctemp"))." градусов."; $status .= " Заряд аккумуляторной батареи ".gg("MiVacuumCleaner.battery")." процентов. "; if (gg("MiVacuumCleaner.battery")<10) {$status = $status." Внимание, аккумулятор сильно разряжен, рекомендуется зарядить как можно скорее!";} $status .= " Последняя уборка заняла ".round(gg("MiVacuumCleaner.clean_time")/60)." минут, "; $status .= " убрано ".round(gg("MiVacuumCleaner.clean_area")/1000000,1)." метров. "; if (gg("MiVacuumCleaner.error_text")=='No error') {$status =$status." Ошибок не зафиксировано. "; } if (gg("MiVacuumCleaner.error_text")=='Clean main brush') {$status =$status." Необходимо очистить нижнюю щетку."; } ////////////////////////////////// $resurs=1800; $resursp=100-round((gg("MiVacuumCleaner.sensor_dirty_time")/60*100)/$resurs); $resursh=round(($resurs-(gg("MiVacuumCleaner.sensor_dirty_time")/60))/60); $status .= " Очистка боковых сенсоров необходима через $resursh часов."; $resurs=18000; $resursp=100-round((gg("MiVacuumCleaner.main_brush_work_time")/60*100)/$resurs); $resursh=round(($resurs-((gg("MiVacuumCleaner.main_brush_work_time")/60)))/60); if ($resursp<30) {$replacemain=1; }else{ $replacemain=0;} $status .= " Ресурс нижней щетки ".$resursp." процентов ($resursh часов)."; $resurs=12000; //$resurs=120; $resursp=100-round((gg("MiVacuumCleaner.side_brush_work_time")/60*100)/$resurs); $resursh=round(($resurs-((gg("MiVacuumCleaner.side_brush_work_time")/60)))/60); if ($resursp<30){ $replaceside=1;} else {$replaceside=0;} $status .= " Ресурс боковой щетки ".$resursp." процентов ($resursh часов)."; $resurs=9000; //$resurs=90; $resursp=100-round((gg("MiVacuumCleaner.filter_work_time")/60*100)/$resurs); $resursh=round(($resurs-((gg("MiVacuumCleaner.filter_work_time")/60)))/60); if ($resursp<30) {$replacefilter=1;} else {$replacefilter=0;} $status .= " Ресурс фильтра ".$resursp." процентов ($resursh часов)."; if (($replacefiler=='1')or ($replaceside=='1') or ($replacemian=='1')) {$status .= " Необходимо преобрести расходники: "; if ($replaceside==1) $status .= "боковую щетку " ; if ($replacefiler==1) $status .= "фильтр "; if ($replacemain==1) $status .= "главную щетку " ; $status .= "."; } $telegram_module->sendMessageToAll($status);
Объекты класса:
Свойства класса:
Методы класса:
/* 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} */
Объекты класса:
//if ($this->getProperty('status')==1) { //say('Задымление, сработала пожарная сигнализация'); // runScript('SendToNotifyEvents', array('text' => 'Задымление, сработала пожарная сигнализация')); //sg("XiDimmer02.level",4); //SetTimeOut('Gate1On','sg("XiDimmer02.level",0);',30); //} //else //{ //say('Нормальное состояние, отключение сигнала оповещения'); // runScript('SendToNotifyEvents', array('text' => 'Отключение сигнала оповещения, нормальное состояние')); //}
Свойства класса:
Свойства класса:
Свойства класса:
Свойства класса:
Свойства класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_playUrl.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_playNextUrl.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_pause-unpause.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_next.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_previous.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_seeknext.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_seekprevious.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_stop.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_volume.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaRenderer_mute-unmute.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'ssdpdevices/SMediaServer_getFileList.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
('status',(('status')+1)%2);
require(DIR_MODULES.'Yeelight/Yeelight_getdata.php');
require(DIR_MODULES.'Yeelight/Yeelight_on_off.php');
require(DIR_MODULES.'Yeelight/Yeelight_set_bright.php');
require(DIR_MODULES.'Yeelight/Yeelight_set_name.php');
require(DIR_MODULES.'Yeelight/Yeelight_set_rgb.php');
require(DIR_MODULES.'Yeelight/Yeelight_set_ct.php');
require(DIR_MODULES.'Yeelight/Yeelight_set_hsv.php');
Объекты класса:
Свойства класса:
Методы класса:
Объекты класса:
$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'); }
$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'); }
$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."."; } } /* $objects=array('MotionSensor1'=>'Датчик движения 1','MotionSensor2'=>'Датчик движения 2','TempSensor01'=>'Датчик температуры','HumSensor01'=>'Датчик влажности'); foreach($objects as $k=>$v) { if (!gg($k.'.alive')) { $yellow_state=1; $details[]="Не обновляется ".$v.'.'; } } */ 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),2); } else { say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title,2); } $this->callMethod('stateChanged'); } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/system_checkstate.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
//START openweather module $updateTime = gg('ow_setting.updateTime'); if($updateTime > 0) { $count = gg('ow_setting.countTime'); if($count >= $updateTime) { include_once(DIR_MODULES . 'app_openweather/app_openweather.class.php'); $app_openweather = new app_openweather(); $app_openweather->get_weather(gg('ow_city.id')); sg('ow_setting.countTime', 1); } else { $count++; sg('ow_setting.countTime', $count); } } // END openweather module//START openweather module $updateTime = gg('ow_setting.updateTime'); if($updateTime > 0) { $count = gg('ow_setting.countTime'); if($count >= $updateTime) { include_once(DIR_MODULES . 'app_openweather/app_openweather.class.php'); $app_openweather = new app_openweather(); $app_openweather->get_weather(gg('ow_city.id')); sg('ow_setting.countTime', 1); } else { $count++; sg('ow_setting.countTime', $count); } } // END openweather module
Объекты класса:
$paths=array('/var/log/*.1','/var/log/*.2', '/var/log/*.1.*', '/var/log/*.2.*', '/var/log/*.3.*', '/var/log/*.4.*', '/var/log/*.5.*', '/var/log/*.6.*', '/var/log/*.7.*' ); foreach($paths as $p) { safe_exec('rm '.$p); } runScript('Hourly'); runScript('filesClearOld'); $h=(int)date('G',time()); //if ($h==19) { //say('включен синий свет'); //cm("miioRelay07.TurnOn"); //} if ($h==10) { say('выключаю принудительно синий свет'); cm("miioRelay07.TurnOff"); } $h=(int)date('G',time()); if ($h==1) { $sun_info = date_sun_info(time(), 55.8, 37.6); sg('civil_twilight_begin',date("H:i", $sun_info['civil_twilight_begin'])) ; sg('civil_twilight_end',date("H:i", $sun_info['civil_twilight_end'])); sg('SunSetTime',date("H:i", $sun_info['sunset'])) ; sg('SunSet1h',date("H:i", $sun_info['sunset']-3600)) ; sg('SunSet30m',date("H:i", $sun_info['sunset']-1800)) ; sg('SunSet0',date("H:i", $sun_info['sunset']-1800)) ; sg('SunRiseTime',date("H:i", $sun_info['sunrise'])) ; sg('SunRise1h',date("H:i", $sun_info['sunrise']+3600)) ; sg('SunRise30m',date("H:i", $sun_info['sunrise']+1800)) ; sg('SunRise0',date("H:i", $sun_info['sunrise']+1800)) ; } //$h=(int)date('G',time()); //if ($h==1) { //$sun_info = date_sun_info(time(), 55.8, 37.6); //sg('civil_twilight_begin',date("H:i", $sun_info['civil_twilight_begin'])) ; //sg('civil_twilight_end',date("H:i", $sun_info['civil_twilight_end'])); //sg('SunSetTime',date("H:i", $sun_info['sunset'])) ; //sg('SunRiseTime',date("H:i", $sun_info['sunrise'])) ; //} //предсказатель погоды v0.1 beta /*$sensor='Sensor_pressure01.value'; $period=60*60; $history=getHistory($sensor, time()-$period, time()); $sumX=0; $sumY=0; $sumX2=0; $sumXY=0; $i=0; foreach($history as $h_part){ $pres=$h_part['VALUE']*133.322; //перевести в паскали $sumX += time()-strtotime($h_part['ADDED']); $sumY += $pres; $sumX2 += (time()-strtotime($h_part['ADDED']))*(time()-strtotime($h_part['ADDED'])); $sumXY += (time()-strtotime($h_part['ADDED'])) * $pres; $i++; } $a=$i*$sumXY; $a=$a-$sumX*$sumY; $a=$a/($i*$sumX2-$sumX*$sumY); $dt = -$a * $i; $dt = round($dt); //print_r($dt); if($dt<-250) { say('Апокалипсис не за горами. Дельта'.$dt); } elseif ($dt<-150) { say('Ожидается резкое ухудшение погоды. Значение дельты '.$dt); } elseif ($dt<-50) { say('Ожидается ухудшение погоды. Значение дельты '.$dt); } elseif ($dt>50) { say('Ожидается улучшение погоды. Значение дельты '.$dt); } elseif ($dt>150) { say('Ожидается резкое улучшение погоды. Значение дельты '.$dt); } elseif ($dt>250) { say('Апокалипсис не за горами. Дельта '.$dt); } */
$h=(int)date('G',time()); $m=date('i',time()); if (isWeekDay()) { } if (timeBetween(getGlobal('NightModeEnd'),getGlobal('NightModeStart')) && getGlobal('clockChimeEnabled')) { if ($m=="00") { say(timeNow(),1); } } setGlobal('timeNow',date('H:i')); $homeStatus=date('H:i'); if (getGlobal('NobodyHomeMode.active')) { $homeStatus.=' Дома никого'; } else { $homeStatus.=' Дома кто-то есть'; } $homeStatus.=' '.getGlobal('Security.stateDetails'); $homeStatus.=' '.getGlobal('System.stateDetails'); $homeStatus.=' '.getGlobal('Communication.stateDetails'); setGlobal('HomeStatus',$homeStatus); // if (timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')=="1") { // setGlobal("isDark",0); // callMethod('DarknessMode.deactivate'); // } elseif (!timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')!="1") { // setGlobal("isDark",1); // callMethod('DarknessMode.activate'); // } //----------------------------------новое---------------------------------------------------- if (timeIs(getGlobal('SunRise1h'))) { //say('Всходит солнце+1час',1); cm("Relay05.TurnOff"); cm("miioRelay07.TurnOff"); cm("Relay14.TurnOff"); say('выключен синий свет на рассвете+1час'); say('выключена розетка Relay05 Led подсветка в зале+1час',2); say('выключена розетка Relay14 Лампа слот 1 в детской+1час',2); } if (timeIs(getGlobal('SunSet30m'))) { //say('Солнце заходит'); cm("miioRelay07.TurnOn"); cm("Relay14.TurnOn"); cm("Relay05.TurnOn"); say('включен синий свет на закате-30',2); say('включена розетка Relay05 Led подсветка в зале-30мин',2); say('включена розетка Relay14 Лампа слот 1 в детской-30мин',2); cm("Relay05.TurnOn"); } //------------------------------------------------------------------------------------------- if (timeIs(getGlobal('SunRiseTime'))) { say('Восходит солнце'); setGlobal("isDark",0); callMethod('DarknessMode.deactivate'); setGlobal('DarknessMode.active',0); // cm("Relay05.TurnOff"); //cm("miioRelay07.TurnOff"); // cm("Relay14.TurnOff"); // say('выключен синий свет на рассвете'); // say('выключена розетка Relay05 Led подсветка в зале'); // say('выключена розетка Relay14 Лампа слот 1 в детской'); } if (timeIs(getGlobal('SunSetTime'))) { say('Солнце заходит',2); //cm("miioRelay07.TurnOn"); // cm("Relay14.TurnOn"); // cm("Relay05.TurnOn"); setGlobal("isDark",1); callMethod('DarknessMode.activate'); setGlobal('DarknessMode.active',1); // say('включен синий свет на закате'); // say('включена розетка Relay05 Led подсветка в зале'); // say('включена розетка Relay14 Лампа слот 1 в детской'); } //-------------------------------------------------------------------------------------------- //if (timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')=="1") { //setGlobal("isDark",0); //say('Всходит солнце'); //cm("Relay05.TurnOff"); //cm("miioRelay07.TurnOff"); //cm("Relay14.TurnOff"); //say('вылючен синий свет на рассвете'); //say('выключена розетка Relay05 Led подсветка в зале'); //say('выключена розетка Relay14 Лампа слот 1 в детской'); //callMethod('DarknessMode.deactivate'); //} elseif (!timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')!="1") { //setGlobal("isDark",1); //say('Солнце заходит',2); //cm("Relay05.TurnOn"); //cm("miioRelay07.TurnOn"); //cm("Relay14.TurnOn"); //say('включен синий свет на закате'); //say('включена розетка Relay05 Led подсветка в зале'); //say('включена розетка Relay14 Лампа слот 1 в детской'); //callMethod('DarknessMode.activate'); //} //--------------------------------------------------------------------------------------------------- if (timeIs("23:30") && (gg("EconomMode.active")!="1") && (gg("NobodyHomeMode.active")=="1")) { say("Похоже никого нет сегодня, можно сэкономить немного."); callMethod('EconomMode.activate'); } if (timeIs(gg('NightModeStart'))) { callMethod('NightMode.activate'); } elseif (timeIs(gg('NightModeEnd'))) { callMethod('NightMode.deactivate'); } if (timeIs("03:00")) { runScript("systemMaintenance"); } if (gg('ThisComputer.AlarmStatus') && timeIs(gg('ThisComputer.AlarmTime'))) { runScript('MorningAlarm'); } if (timeIs(getGlobal('civil_twilight_end'))) { say('Сумерки заканчиваются, надвигается тьма'); cm("Relay17.TurnOn"); say('включена розетка Relay17 последний слот'); } if (timeIs(getGlobal('civil_twilight_begin'))) { say('Сумерки отступают, становится светло',2); cm("Relay17.TurnOff"); say('выключена розетка Relay17 последний слот'); } if ( ((int)$m)%5 == 0 ) { runScript('monitoringPi'); }
Свойства класса:
Методы класса:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
Объекты класса:
, Россия
На форуме: chibis
© 2025 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Публичный договор
SmartLiving