Class properties:
Class methods:
$this->setProperty('status', 1); $this->setProperty('AlarmOn', 1);
$this->setProperty('status', 0); $this->setProperty('AlarmOn', 0);
$currentStatus=$this->getProperty('status'); if ($currentStatus) { $this->callmethodSafe('turnOff'); } else { $this->callmethodSafe('turnOn'); }
//$ot = $this->object_title; //$des = $this->description; $str = $this->getProperty('days'); //echo $str; switch ($str) { case '0000011': $this->setProperty('Week','выходные дни'); break; case '1111100': $this->setProperty('Week','рабочие дни'); break; case '1111111': $this->setProperty('Week','ежедневно'); break; case '0000000': $this->setProperty('Week','!выключен'); $this->setProperty('AlarmOn',0); break; case '1000000': $this->setProperty('Week','Пн'); break; case '1100000': $this->setProperty('Week','Пн-Вт'); break; case '1110000': $this->setProperty('Week','Пн-Ср'); break; case '1111000': $this->setProperty('Week','Пн-Чт'); break; case '1111100': $this->setProperty('Week','Пн-Пт'); break; case '1111110': $this->setProperty('Week','Пн-Сб'); break; case '0100000': $this->setProperty('Week','Вт'); break; case '0110000': $this->setProperty('Week','Вт-Ср'); break; case '0111000': $this->setProperty('Week','Вт-Чт'); break; case '0111100': $this->setProperty('Week','Вт-Пт'); break; case '0111110': $this->setProperty('Week','Вт-Сб'); break; case '0111111': $this->setProperty('Week','Вт-Вс'); break; case '0010000': $this->setProperty('Week','Ср'); break; case '0011000': $this->setProperty('Week','Ср-Чт'); break; case '0011100': $this->setProperty('Week','Ср-Пт'); break; case '0011110': $this->setProperty('Week','Ср-Сб'); break; case '0011111': $this->setProperty('Week','Ср-Вс'); break; case '0001000': $this->setProperty('Week','Чт'); break; case '0001100': $this->setProperty('Week','Чт-Пт'); break; case '0001110': $this->setProperty('Week','Чт-Сб'); break; case '0001111': $this->setProperty('Week','Чт-Вс'); break; case '0000100': $this->setProperty('Week','Пт'); break; case '0000110': $this->setProperty('Week','Пт-Сб'); break; case '0000111': $this->setProperty('Week','Пт-Вс'); break; case '0000010': $this->setProperty('Week','Сб'); break; case '0000001': $this->setProperty('Week','Вс'); break; case '1100000': $this->setProperty('Week','Пн-Вт'); break; default: $this->setProperty('AlarmOn',0); $this->setProperty('Week','Ошибка !!!'); break; }
//$ot = $this->object_title; //$des = $this->description; // Проверяет состояние обьектов в заданном классе сообщает о состоянии обьекта. /* $objects = getObjectsByClass("AlarmClock"); foreach($objects as $obj) { // переберем все будильники в системе // $Obj_Title = $obj['TITLE']; $AlarmOn = getGlobal($obj['TITLE'].'.AlarmOn'); if ($AlarmOn) { //если будильник включен // if (getGlobal($obj['TITLE'].".AlarmOn")) { setGlobal("AlarmGlobal.status", 1); setGlobal('AlarmGlobal.alarm_led', 1); // callMethod($obj['TITLE'].".turnOff"); } else { setGlobal("AlarmGlobal.status", 0); setGlobal('AlarmGlobal.alarm_led', 0); // callMethod($obj['TITLE'].".turnOff"); } } */ if ($this->getProperty('AlarmOn')) { $this->setProperty('alarm_led',1); $this->setProperty('status',1); // setGlobal("AlarmGlobal.status", 1); // setGlobal("AlarmGlobal.alarm_led", 1); // say("Будильник " .$ot. " включен", 1); } else { $this->setProperty('alarm_led',0); $this->setProperty('status',0); // setGlobal("AlarmGlobal.status", 0); // setGlobal("AlarmGlobal.alarm_led", 0); // say("Будильник " .$ot. " выключен", 0); } callMethod("AlarmGlobal.allAlarmOn"); /* //проверка будильников $alarms = array(); $objects=getObjectsByClass("AlarmClock"); foreach($objects as $obj) { // переберем все будильники в системе if (getGlobal($obj['TITLE'].".AlarmOn")){ //если будильник включен $AlarmName = getGlobal($obj['TITLE'].".name"); $AlarmTime = getGlobal($obj['TITLE'].".AlarmTime"); $alarms[]=("Будильник ".$AlarmName." установлен на ".$AlarmTime); } } if (!$alarms) { $alarms[]="Будильников включенных в настоящий момент нет."; }; say (implode(". ",$alarms),1); // --------------------------------------------------------------------- if (gg("Sets.all_lights_off")==0) { say ("Весь свет на втором этаже выключен.",1); } else { $objects=getObjectsByClass("SButtons"); foreach($objects as $obj) { // переберем все модули освещения if (getGlobal($obj['TITLE'].".status")){ //если свет включен $RoomName = $obj['TITLE']; // say ("Свет сейчас включен: ".str_replace("_"," ",$RoomName),1); } } } */
// Установка времени срабатывания последнего будулльника setGlobal("ThisComputer.lastalarm", time());
//$ot = $this->object_title; //$des = $this->description; //$str = $params['NEW_VALUE']; //$this->setProperty('batteryLevel'); //передает значение из метода info_battery_level в метод batteryLevel //Понедельник $str = $this->getProperty('days'); //определение выходного дня /*function weekDays() { $response = $this->getProperty('days'); if ($response == "0000011") $result = "выходные дни"; if ($response == "1111100") $result = "рабочие дни"; if ($response == "1111111") $result = "ежедневно"; if ($response == "0000000") $result = "!выключен"; if ($response == "100") $result = "Ошибка в дате"; if ($response == "101") $result = "Данные не найдены"; if ($response == "199") $result = "Ошибка сервиса"; return $result; } $ret = weekDays(); //$ret = $this->setProperty('Week'); sg($ot.'.Week',$ret); */ if ($str == '0000011') $this->setProperty('Week','выходные дни'); else if ($str == '1111100') $this->setProperty('Week','рабочие дни'); else if ($str == '1111111') $this->setProperty('Week','ежедневно'); else if ($str == '0000000') $this->setProperty('Week','!выключен'); else if ($str == '1000000') $this->setProperty('Week','Пн'); else if ($str == '1100000') $this->setProperty('Week','Пн-Вт'); else if ($str == '1110000') $this->setProperty('Week','Пн-Ср'); else if ($str == '1111000') $this->setProperty('Week','Пн-Чт'); else if ($str == '1111100') $this->setProperty('Week','Пн-Пт'); else if ($str == '1111110') $this->setProperty('Week','Пн-Сб'); else if ($str == '0100000') $this->setProperty('Week','Вт'); else if ($str == '0110000') $this->setProperty('Week','Вт-Ср'); else if ($str == '0111000') $this->setProperty('Week','Вт-Чт'); else if ($str == '0111100') $this->setProperty('Week','Вт-Пт'); else if ($str == '0111110') $this->setProperty('Week','Вт-Сб'); else if ($str == '0111111') $this->setProperty('Week','Вт-Вс'); else if ($str == '0010000') $this->setProperty('Week','Ср'); else if ($str == '0011000') $this->setProperty('Week','Ср-Чт'); else if ($str == '0011100') $this->setProperty('Week','Ср-Пт'); else if ($str == '0011110') $this->setProperty('Week','Ср-Сб'); else if ($str == '0011111') $this->setProperty('Week','Ср-Вс'); else if ($str == '0001000') $this->setProperty('Week','Чт'); else if ($str == '0001100') $this->setProperty('Week','Чт-Пт'); else if ($str == '0001110') $this->setProperty('Week','Чт-Сб'); else if ($str == '0001111') $this->setProperty('Week','Чт-Вс'); else if ($str == '0000100') $this->setProperty('Week','Пт'); else if ($str == '0000110') $this->setProperty('Week','Пт-Сб'); else if ($str == '0000111') $this->setProperty('Week','Пт-Вс'); else if ($str == '0000010') $this->setProperty('Week','Сб'); else if ($str == '0000001') $this->setProperty('Week','Вс');//sg($ot.'.Week','Вс'); else { $this->setProperty('AlarmOn',0); return; }
Class objects:
/* begin injection of {Alarmclock} */ Hourly /* end injection of {Alarmclock} */
if (isWeekDay()){ // сегодня рабочий день WeekEnd WeekDay playSound('7h'); say(timeNow()." Мальчики Пора вставать Нужно собираться в школу. ",2); //callmethod('yw_mycity.sayweather'); // Напоминалки 15 мин setTimeOut('sad15', 'say(timeNow()." через 30 минут выходить",2); playSound("15min");', 15*60); // Напоминалки 30 мин setTimeOut('sadl30', 'say(timeNow()." через 15 минут выходить",2); playSound("30min");', 30*60); // Напоминалки 35 мин setTimeOut('sadl35', 'say(timeNow()." через 10 минут выходить",2);', 35*60); // Напоминалки 40 мин setTimeOut('sad40', 'say(timeNow()." через 5 минут выходить",2);', 40*60); // Напоминалки 45 мин setTimeOut('sad45', 'say(timeNow()." Мальчики Пора в школу. Завтрак ждёт",2); playSound("45min");', 45*60); // Напоминалки 50 мин setTimeOut('sad50', 'playSound("50min"); callmethod("yw_mycity.sayforecast");', 50*60); }
Class objects:
Class properties:
Class methods:
$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']." процентов");
Class objects:
$command=$params['command']; $short_command='5'; $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("Отключено питание");
//$command='Сколько время'; //callMethod('ThisComputer.commandReceived',array('command'=>$command)); //callMethod('mqttIn.cmdChanged', array('VALUE'=>$params['NEW_VALUE']));
Class properties:
Class objects:
$connection = ssh2_connect($this->GetProperty('IPAddress'), 2); ssh2_auth_password($connection, $this->GetProperty('Ssh_login'), $this->GetProperty('Ssh_pass')); ssh2_exec($connection, 'shutdown -p now');
//$connection = ssh2_connect($this->GetProperty('IPAddress'), 22);//IPAddress //ssh2_auth_password($connection, $this->GetProperty('Ssh_login'), $this->GetProperty('Ssh_pass')); //ssh2_exec($connection, 'shutdown -h +5 "Компьютер будет выключен через 5 минут"'); //poweroff|shutdown -r|p now //safe_exec('192.168.10.30 shutdown -r now "Компьютер будет выключен через 5 минут"'); //poweroff|shutdown -r|p now //setTimeout("shutdownTimer","safe_exec('shutdown -r now');",15);
Class properties:
Class methods:
$ip_hl = $this->getProperty("menu_cmd"); $hl = $this->getProperty("GA_name"); //print_r($ip_hldns); //($ip_hldns) switch ($ip_hl) { // для fa case 0: $str = "cmd=process"; break; case 1: $str = "cmd=mkp_e"; break; case 2: $str = "cmd=mkp"; break; case 3: $str = "cmd=vlc"; break; case 4: $str = "cmd=shutdown"; break; case 5: $str = "cmd=poweroff"; break; case 6: $str = "cmd=reboot"; break; case 7: $str = "cmd=forceifhung"; break; case 8: $str = "cmd=logoff"; break; case 9: $str = "key=CTRL+ALT+DOWN"; break; case 10: $str = "key=VOLUP"; break; case 11: $str = "key=VOLDOWN"; break; case 12: $str = "key=MUTE"; break; case 13: $str = "key=NEXT"; break; case 14: $str = "key=PREV"; break; case 15: $str = "key=PLAY"; break; case 16: $str = "key=STOP"; break; case 17: $str = "chk=GetAdmin"; break; case 18: $str = "*"; break; default: $str = " "; // вообще, сюда попасть мы не должны } sg("$hl.GA_cmd", $str); //$this->setProperty('GA_cmd', $str); // записываем в свой объект sg("Sets.GA_cmd", $str); // записываем для меню sg("Sets.GA_cmd_txt", $str); // записываем для меню
/* * Сценарий 'addGetAdmin' для MajorDoMo * автор: Владимир Попов, на форуме - Vovix * дата последнего изменения: 18.01.2018 * обязательно наличие программы GetAdmin на управляемом устройстве (ПК) * runScript('getAdmin', array('url'=>$хххх,'cmd'=>$yyyy,'port'=>$zzzz,'doit'=>$qqqq)) */ $addGA_ot = ($params['name'] == '') ? gg("Sets.addGA_name") : $params['name']; $addGA_cmd = ($params['cmd'] == '') ? gg("Sets.addGA_cmd") : $params['cmd']; $addGA_path = ($params['path'] == '') ? gg("Sets.addGA_path") : $params['path']; $addGA_path = str_ireplace('/', '\\', $addGA_path); $addGA_param = ($params['param'] == '') ? gg("Sets.addGA_param") : $params['param']; $addGA_show = ($params['show'] == '') ? gg("Sets.addGA_show") : $params['show']; //$addGA_ot2 = ($params['name2'] == '') ? gg("Sets.GA_name") : $params['name2']; //$GA_ip = gg($addGA_ot.'.IPint'); //$GA_port = gg($addGA_ot.'.port'); //$GA_online = gg($addGA_ot.'.online'); //$GA_ol_color = gg($addGA_ot.'.online_color'); $GA_ip = gg($GA_ot.'.IPint'); $GA_port = gg($GA_ot.'.port'); $GA_online = gg($GA_ot.'.Online'); $GA_ol_color = gg($GA_ot.'.online_color'); // $config = parse_ini_file('./templates_alt/'.$GA_ot.'.ini',true); //$config = parse_ini_file('./cms/texts/'.$addGA_ot2.'.txt',true); // $config = parse_ini_file('\\\\'.$GA_ip.'\\GetAdmin\\GetAdmin.ini',true); // file://dsys01k/GetAdmin/GetAdmin.ini //$addGA_file = '\\\\'.$GA_ip.'\\GetAdmin\\GetAdmin.ini'; $addGA_file = './templates_alt/'.$addGA_ot.'.ini'; ///var/www/html/cms/texts/ switch ($GA_online) { // для fa case 0: $fa1 = "question-"; break; case 1: $fa1 = "check-"; break; case 2: $fa1 = "times-"; break; default: // вообще, сюда попасть мы не должны $fa1 = ""; } $str = '<i class="fa fa-'.$fa1.'circle" aria-hidden="true" style="color:'.$GA_ol_color.';"></i> <b>'.$addGA_ot.'</b>'; $timeGA = 'Время и дата выполнения: <span style="float: right;"><b>'.date( "H:i:s - d.m.Y", time()).'</span></b>'; $str = $str.'<br>'.$timeGA; $str = $str.'<hr>'; $imput = ""; $impstr = ""; //$str = $str.'<span style="float: right;">наж. на красн.ком.и потом выполн.</span><br>'.$timeGA; if (file_exists($addGA_file)) { // проверим доступность файла GetAdmin.ini // файл доступен, формируем список команд из него //$config = parse_ini_file('\\\\'.$GA_ip.'\\GetAdmin\\GetAdmin.ini',true); $config = parse_ini_file('./templates_alt/'.$addGA_ot.'.ini',true); if (!copy($addGA_file, $addGA_file.'.old')) { // скопируем файл ini с изменением расширения и проверим смоги ли // не смогли скопировать } else { // смогли скопировать $count = $config[Properties][Count]; $input = "[Properties]"."\r\n"; $inpstr = '<font color="blue"><b>[Properties]</b></font><br>'; foreach($config[Properties] as $key=>$object) { if ($key == 'Count') { $object = $object + 1; } $input = $input.$key.'='.$object."\r\n"; $inpstr = $inpstr.'<font color="green">'.$key.'</font>='.$object."<br>"; } $c_str = $count * 4; $i = 0; $input = $input."[Commands]"."\r\n"; $inpstr = $inpstr.'<font color="blue"><b>[Commands]</b></font><br>'; foreach($config[Commands] as $key=>$object) { if (($i == $c_str)||($i == $c_str + 1)||($i == $c_str + 2)||($i == $c_str + 3)) { if (strpos($key, "Command") !== false) { $key = "Command_".$count; $object = $addGA_cmd; } if (strpos($key, "Path") !== false) { $key = "Path_".$count; $object = $addGA_path; } if (strpos($key, "Param") !== false) { $key = "Param_".$count; $object = $addGA_param; } if (strpos($key, "show") !== false) { $key = "show_".$count; $object = $addGA_show; } } $input = $input.$key.'='.$object."\r\n"; $inpstr = $inpstr.'<font color="green">'.$key.'</font>='.$object.'<br>'; $i++; } $fd = fopen( $addGA_file , "w+" ); fwrite( $fd , $input , strlen( $input ) ); fclose( $fd ); } } else { // файл GetAdmin.ini не доступен, выясним причины $str = $str.'<hr>'; $provresult = getURL('http://'.$GA_ip.':'.$GA_port.'/?chk=GetAdmin', 0); // проверим выполив заведомо имеющейся командой switch ($GA_online) { // проверим варианты с учетом online/offline терминала case 0: case 2: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- нет доступа по сети к <b>'.$addGA_ot.'</b>;<br>'; $str = $str.'- GetAdmin на <b>'.$addGA_ot.'</b> не установлен;<br>'; $str = $str.'- на <b>'.$addGA_ot.'</b> GetAdmin не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- к папке GetAdmin на <b>'.$addGA_ot.'</b> нет доступа;<br>'; $str = $str.'- GetAdmin на <b>'.$addGA_ot.'</b> в другой папке.<br>'; } break; case 1: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- GetAdmin на <b>'.$addGA_ot.'</b> не установлен;<br>'; $str = $str.'- на <b>'.$addGA_ot.'</b> GetAdmin не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- к папке GetAdmin на <b>'.$addGA_ot.'</b> нет доступа;<br>'; $str = $str.'- GetAdmin на <b>'.$addGA_ot.'</b> в другой папке.<br>'; } break; default: // вообще, сюда попасть мы не должны echo "ошибка в режиме онлайн!"; } } $str = $str.$inpstr; $this->setProperty('addGA_result', $str); // записываем в свой объект //sg($addGA_ot.".addGA_result", $str); // записываем в свой объект sg("Sets.addGA_result", $str); // записываем для меню
$GA_ot = $this->object_title; $GA_ip = $this->getProperty("IPint"); $GA_port = $this->getProperty("port"); $GA_online = $this->getProperty("online"); $GA_ol_color = $this->getProperty("online_color"); $GA_doit = gg('Sets.GA_cmd_txt'); switch ($GA_online) { // для fa case 0: $fa1 = "question"; break; case 1: $fa1 = "info"; break; case 2: $fa1 = "times"; break; default: $fa1 = ""; // вообще, сюда попасть мы не должны } //<i class="fa-solid fa-circle-xmark"></i> //<i class="fa-solid fa-circle-question"></i> //<i class="fa-sharp fa-solid fa-circle-info"></i> aria-hidden="true" $str = '<i class="fa-sharp fa-solid fa-circle-'.$fa1.'" style="color:'.$GA_ol_color.';"></i> <b>'.$GA_ot.'</b>'; $timeGA = 'Время и дата выполнения: <span style="float: right;"><b>'.date( "H:i:s - d.m.Y", time()).'</span></b>'; // проверим - это специальная команда выводящая список команд из файла GetAdmin.ini или нет ? if ($GA_doit != '*') { // нет это не спец.команда, это команда из программы GetAdmin $GA_cmd = str_ireplace("-", "=", $GA_doit); $str = $str.'<span style="float: right;"><b>'.$GA_cmd.'</b></span><br>'; $str = $str.$timeGA.'<hr>'; if (preg_match("/(key=[A-Z0-9+]+$)|(cmd=[a-zA-Z0-9_]+$)|(chk=[a-zA-Z0-9+-_]+$)/", $GA_cmd)) { // через рег.выражения выявим ошибки синтаксиса $result = getURL('http://'.$GA_ip.':'.$GA_port.'/?'.$GA_cmd, 0); //echo $result; if ($result == false) { // проверим - а вообще можем получить данные? $provresult = getURL('http://'.$GA_ip.':'.$GA_port.'/?chk=GetAdmin', 0); // проверим выполив заведомо имеющейся командой switch ($GA_online) { // проверим варианты с учетом online/offline терминала case 0: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- нет доступа по сети к <b>'.$GA_ot.'</b>;<br>'; $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- команда <b>'.$GA_cmd.'</b> отсутствует на <b>'.$GA_ot.'</b>.<br>'; } break; case 1: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- команда <b>'.$GA_cmd.'</b> отсутствует на <b>'.$GA_ot.'</b>.<br>'; } break; case 2: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- нет доступа по сети к <b>'.$GA_ot.'</b>.<br>'; } else { $str = $str.'- команда <b>'.$GA_cmd.'</b> отсутствует на <b>'.$GA_ot.'</b>.<br>'; } break; default: // вообще, сюда попасть мы не должны echo "ошибка в режиме онлайн!"; } } else { // данные (ответ) получаем, сформируем их $str = $str.iconv ("CP1251", "UTF-8", $result); $str = str_ireplace("<html>", "",$str); $str = str_ireplace("</html>", "",$str); $str = str_ireplace("<p>", "<br>",$str); $str = str_ireplace("</p>", "<br>",$str); $str = ($GA_cmd == "cmd=process") ? str_ireplace(";", "; ",$str) : $str; } } else { // регулярные выражения выявили ошибку $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Причина: ошибка синтаксиса! => '.$GA_cmd; } $this->setProperty('GA_result', $str); // записываем в свой объект sg("Sets.GA_result", $str); // записываем для меню } else { // да, это спец.команда $str = $str.'<span style="float: right;"><b>из GetAdmin.ini</b></span>'; $str = $str.'<br>'.$timeGA; //if (file_exists('\\\\'.$GA_ip.'\\GetAdmin\\GetAdmin.ini')) { // проверим доступность файла GetAdmin.ini if (file_exists('./templates_alt/'.$GA_ot.'.ini')) { // проверим доступность файла GetAdmin.ini // файл доступен, формируем список команд из него //$config = parse_ini_file('file://dsys01k/GetAdmin/GetAdmin.ini',true); $config = parse_ini_file('./templates_alt/'.$GA_ot.'.ini',true); //$config = parse_ini_file('./cms/texts/'.$addGA_ot2.'.txt',true); // $config = parse_ini_file('\\\\'.$GA_ip.'\\GetAdmin\\GetAdmin.ini',true); // file://dsys01k/GetAdmin/GetAdmin.ini $count = $config[Properties][Count]; $max = $count * 4; foreach($config[Commands] as $key=>$object) { if (($object != "") && (strpos($key, "show") === false)) { if (strpos($key, "Command") !== false) { $str = $str.'<hr>'; $object = '<span style="cursor:pointer"><font size="+1" color="red" onclick = "ajaxSetGlobal(\'Sets.GA_cmd_txt\', \'cmd='.$object.'\');">'.$object.'</font></span>'; } $str = $str.'<font color="green">'.$key.'</font> = '.$object.'<br>'; } if (--$max <=0) break; } } else { // файл GetAdmin.ini не доступен, выясним причины $str = $str.'<hr>'; $provresult = getURL('http://'.$GA_ip.':'.$GA_port.'/?chk=GetAdmin', 0); // проверим выполив заведомо имеющейся командой switch ($GA_online) { // проверим варианты с учетом online/offline терминала case 0: case 2: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- нет доступа по сети к <b>'.$GA_ot.'</b>;<br>'; $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> не установлен;<br>'; $str = $str.'- на <b>'.$GA_ot.'</b> GetAdmin не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- к папке GetAdmin на <b>'.$GA_ot.'</b> нет доступа;<br>'; $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> в другой папке.<br>'; } break; case 1: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> не установлен;<br>'; $str = $str.'- на <b>'.$GA_ot.'</b> GetAdmin не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- к папке GetAdmin на <b>'.$GA_ot.'</b> нет доступа;<br>'; $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> в другой папке.<br>'; } break; default: // вообще, сюда попасть мы не должны echo "ошибка в режиме онлайн!"; } } $this->setProperty('GA_result', $str); // записываем в свой объект sg("Sets.GA_result", $str); // записываем для меню }
Class objects:
// if (!isset($params['mac'])) { $mac = $this->GetProperty('MacAddress'); } else { $mac=$params['mac']; } if (!function_exists('magicPacke')) { function magicPacket($mac,$addr='192.168.8.255',$socket_number=9) { //split up the mac address based upon the colons in the string $addr_byte = explode(':', $mac); $hw_addr = ''; for ($a=0; $a <6; $a++) $hw_addr .=chr(hexdec($addr_byte[$a])); //convert the hex to its decimal equivalent, encode as a character, and repeat 16 times $msg = str_repeat(chr(255),6); //FF in decimal is 255, which is then encoded as a char as with our mac address for ($a = 1; $a <= 16; $a++) $msg .= $hw_addr; $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); //create our socket if ($s == false) { echo "Error creating socket!\n"; echo "Error code is '".socket_last_error($s)."'- " . socket_strerror(socket_last_error($s)); return false; } else { // setting a broadcast option to socket: //$opt_ret = socket_set_option($s, 1, 6, TRUE); $opt_ret = socket_set_option($s,SOL_SOCKET,SO_BROADCAST,true); if($opt_ret <0) { echo "setsockopt() failed, error: " . strerror($opt_ret) ."\n"; return false; } if(socket_sendto($s, $msg, strlen($msg), 0, $addr,$socket_number)) { socket_close($s); return true; } else { return false; } } } } magicPacket($mac); /* //------------------------------------------------------------------------------------------------------------------------------------------------ $mac = $this->GetProperty('MacAddress'); magicPacket($mac); function magicPacket($mac,$addr='255.255.255.255',$socket_number=7) { //split up the mac address based upon the colons in the string $addr_byte = explode(':', $mac); $hw_addr = ''; for ($a=0; $a <6; $a++) $hw_addr .=chr(hexdec($addr_byte[$a])); //convert the hex to its decimal equivalent, encode as a character, and repeat 16 times $msg = str_repeat(chr(255),6); //FF in decimal is 255, which is then encoded as a char as with our mac address for ($a = 1; $a <= 16; $a++) $msg .= $hw_addr; $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); //create our socket if ($s == false) { echo "Error creating socket!\n"; echo "Error code is '".socket_last_error($s)."'- " . socket_strerror(socket_last_error($s)); return false; } else { // setting a broadcast option to socket: //$opt_ret = socket_set_option($s, 1, 6, TRUE); $opt_ret = socket_set_option($s,SOL_SOCKET,SO_BROADCAST,true); if($opt_ret <0) { echo "setsockopt() failed, error: " . strerror($opt_ret) ."\n"; return false; } if(socket_sendto($s, $msg, strlen($msg), 0, $addr,$socket_number)) { socket_close($s); return true; } else { return false; } } } */
//http://majordomo.smartliving.ru/forum/viewtopic.php?f=4&t=572&hilit=%D0%BF%D0%B5%D1%80%D0%B5%D0%B7%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B0&start=20 //shell_exec("net rpc shutdown -f -I 192.168.8.115 -U '192.168.8.115\admin%197994'"); //Lenovo.IP_address //shell_exec("shutdown -s -f -m \\\\192.168.10.29 -t60 -d up:125:1"); //не работает getURL('http://192.168.8.115:8870/?cmd=hiber');
//не работает shell_exec("reboot 192.168.8.115 '192.168.8.115\admin%197994'");
$currentStatus=$this->getProperty('status'); if ($currentStatus) { $this->callMethodSafe('WakedUp'); } else { $this->callMethodSafe('Shutdown'); }
Class properties:
Class methods:
$name='Cron_'.$this->object_title; SQLExec("DELETE FROM jobs WHERE title='".$name."'");
$this->setProperty('LastRun',date('Y-m-d H:i:s'));
Class objects:
callMethod('sankt-peterburge.roadway_visibility_description');
callmethod('sankt-peterburge.roadway_visibility_description');
say(timeNow(), 3);
callMethod('sayMode.modeNews');
callMethod('sayMode.modeNews');
if(!isOnline('Internet')){return;} // если не доступен интернет, выход //if (gg('Sets.checkGMail')) { // если разрешено проверять, продолжим $objects=getObjectsByClass("Users"); foreach($objects as $obj) { if (gg($obj['TITLE'].".GMailAcc")!="" && gg($obj['TITLE'].".GMailPass")!=""){ // если есть аккаунт и пароль $user = gg($obj['TITLE'].".GMailAcc"); // аккаунт пользователя $pass = gg($obj['TITLE'].".GMailPass"); // пароль пользователя $data_file="https://$user:$pass@mail.google.com/mail/feed/atom"; $xml = simplexml_load_file($data_file); // раскладываем xml на массив $unread=$xml->fullcount; if($unread==""){$unread="0";} // если значение пустое, присваиваем 0 if(gg($obj['TITLE'].".GMailUnread")!=$unread){sg($obj['TITLE'].".GMailUnread",$unread);} // если значение не равно полученному, запишем полученное } // } }
Class properties:
Class methods:
/* */ //проверка будильников $alarms = array(); $objects=getObjectsByClass("AlarmClock"); foreach($objects as $obj) { // переберем все будильники в системе $alarmOn = getGlobal($obj['TITLE'].'.AlarmOn'); $this->setProperty($obj['TITLE'], $alarmOn); if (getGlobal($obj['TITLE'].".AlarmOn")){ //если будильник включен // $AlarmName = getGlobal($obj['TITLE'].".name"); // $AlarmTime = getGlobal($obj['TITLE'].".AlarmTime"); $alarms[] = ("Будильник ".$AlarmName." установлен на ".$AlarmTime); $this->setProperty('alarm_led', 1); $this->setProperty('status', 1); } } if (!$alarms) { $alarms[] = "Будильников включенных в настоящий момент нет."; $this->setProperty('alarm_led', 0); $this->setProperty('status', 0); };
if ($params['pt']) { say("Что-то включилось", 1); $this->setProperty('meeee', $params['pt']); } else { $this->setProperty('meeee', $params['pt']); say("Что-то выключилось", 1); } if ($params['VALUE']) { say("Что-то включилось", 1); $this->setProperty('meeee1', $params['VALUE']); } else { $this->setProperty('meeee1', $params['VALUE']); say("Что-то выключилось", 1); }
Class objects:
Class properties:
Class methods:
/* * Поддерживаемые Состояния и Топик Состояний * Панель сигнализации подписывается на изменения состояния MQTT, публикуемые удаленной системой сигнализации. * Тема состояния по умолчанию - home/alarm, и ее можно изменить в настройках. * Вот список значений состояния и их описаний, которые может обрабатывать приложение. * * disarmed The alarm is disabled/off. Сигнализация отключена/выкл. * arming The alarm is arming. Сигнализация включена. Сигнализация будет включена после задержки. (The alarm will be armed after the delay.) * armed_away The alarm is armed in away mode. * armed_home The alarm is armed in home mode. * armed_night The alarm is armed in night mode. * armed_custom_bypass The alarm is armed in custom mode. * pending The alarm is pending. Сигнал тревоги сработает после задержки. (The alarm will be triggered after the delay.) * triggered The alarm is triggered. * ----------------------------------------------------------------------- * Поддерживаемое мероприятие и тема мероприятия (Supported Event and Event Topic) * Alarm Panel может подписаться на тему события, чтобы получать дополнительную информацию от удаленной системы сигнализации. * Например, топик евент будет уведомлять приложение об ошибках сигнализации, * таких как неверные коды и невозможность активировать сигнализацию из-за открытых датчиков. * Топик евент по умолчанию - home/alarm/event, и его можно изменить в настройках. * Вот список полезных нагрузок событий, которые может обрабатывать панель сигнализации, полезная нагрузка используется в формате JSON. * * invalid_code_provided Неверный код для снятия с охраны или постановки на охрану сигнализации. * no_code_provided Код для снятия или постановки на охрану сигнализации требуется, но отсутствует. * failed_to_arm Сигнализация не могла быть включена из-за разомкнутых датчиков. * system_disabled Состояние тревоги изменить не удалось, поскольку система не отвечала на запросы или была недоступна. * unknown Состояние тревоги не удалось изменить из-за неизвестной ошибки, проверьте настройки. * ARM_AWAY, ARM_HOME, ARM_NIGHT, ARM_CUSTOM_BYPASS Используется для синхронизации команд тревоги между несколькими устройствами или с удаленным сервером. * * Если вы хотите отправить сообщение об ошибке, что был введен неверный код для снятия с охраны или постановки на охрану сигнализации, * вы должны отправить следующую полезную нагрузку в формате JSON по теме события: * {"event": "invalid_code_provided"} * ------------------------------------------------------------------------ * */ $payload = $params['NEW_VALUE']; // Принимаем данные //$this->setProperty('arms', $params['VALUE']); // Записываем сырые данные в свойство при необходимости switch ($payload) { case 'armed_away': say('Сообщение armed away', $msl); // The alarm is armed in away mode. (Полностью) $status = 'armed_away'; break; case 'armed_home': say('Сообщение armed home', $msl); // The alarm is armed in home mode. (Только дом) $status = 'armed_home'; break; case 'armed_night': say('Запрос на установку ночной охраны', $msl); // The alarm is armed in night mode. (Частично) $status = 'armed_night'; break; case 'armed_custom_bypass': say('Сообщение armed custom bypass', $msl); // The alarm is armed in custom mode. (Выборочно) $status = 'armed_custom_bypass'; break; case 'arming': say('Сообщение arming', $msl); // Сигнализация включена. Сигнализация будет включена после задержки. $status = 'arming'; break; case 'pending': say('Сообщение pending', $msl); // Сигнал тревоги находится в ожидании. Сигнал тревоги сработает после задержки. $status = 'pending'; break; case 'triggered': say('Сообщение triggered', $msl); // The alarm is triggered. Срабатывает сигнализация $status = 'triggered'; break; case 'disarmed': say('Сообщение disarmed', $msl); // Сигнализация отключена/выкл $status = 'disarmed'; break; default: say('Сообщение не распознано', 0); //$this->result = array('status' => 'не распознано', 'date' => date('Y/m/d H:i:s', time())); //DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение не распознано о - '.$state['event'].' от - '.$state['deviceId'].' - '.$this->result['status'].' - в - '.$this->result['date'], $msl); break; } $name = $this->getProperty('name'); $topic = $name."/home/alarm"; mqttMob($topic, $status, 0, 0); //Передаем в MQTT /* $arms = $this->getProperty('arms'); */
/* * {"payload": "alert": "Hello!", "topic": "alarmpanel/command"} * {"payload": "{'sun':'below_horizon'}", "topic": "alarmpanel/command"} * {"condition":"sunny","humidity":61,"temperature":27.2,"forecast":[ * {'condition': 'sunny', 'temperature': 19.8, 'templow': 13.5, 'datetime': '2020-11-30T15:00:00+00:00', 'wind_bearing': 101.4, 'wind_speed': 30.6}]} * * https://github.com/thanksmister/android-mqtt-alarm-panel * * $prop = $params['PROPERTY']; * $new = $params['NEW_VALUE']; * $old = $params['OLD_VALUE']; * $oot = $params['ORIGINAL_OBJECT_TITLE']; */ $ot = $this->object_title; $desc = $this->description; $name = $this->getProperty('name'); //$msl = 0; //$msl = $this->getProperty('minMsgLevel'); if ($params['ph']) { // callMethod('alarmPanel02.command', array('ph'=>$ph,'level'=>$level)); // вставить Общие настройки -> Обработчики -> After SAY (code) $params['PROPERTY'] = 'spech'; $params['NEW_VALUE'] = $params['ph']; } $payload = $params['PROPERTY']; switch ($payload) { // SWM07E/alarmpanel/command case 'dashboard': // number {"dashboard": 0} Переход к определенной панели (работает только 0) $array = array('dashboard' => $params['NEW_VALUE']); $status = json_encode($array, true, JSON_UNESCAPED_UNICODE); break; case 'audio': // URL {"audio": "http://<url>"} Немедленно воспроизводит аудио, указанное по URL-адресу $array = array('audio' => $params['NEW_VALUE']); $status = json_encode($array, JSON_UNESCAPED_UNICODE); // {"audio":"http://192.168.10.26/cms/sounds/10h.mp3"} break; case 'wake': // true {"wake": true} Пробуждает экран, если он находится в спящем режиме $status = '{"wake": true}'; break; case 'speak': // data {"speak": "Hello!"} Uses the devices TTS to speak the message Использует устройства TTS для озвучивания сообщения $array = array('speak' => $params['NEW_VALUE']); $status = json_encode($array, true, JSON_UNESCAPED_UNICODE); break; case 'spech': // data {"speak": "Hello!"} Uses the devices TTS to speak the message Использует устройства TTS для озвучивания сообщения $array = array('speak' => $params['NEW_VALUE']); $status = json_encode($array, JSON_UNESCAPED_UNICODE); $topic2 = $name."/home/alarm/sensor/spech"; mqttMob($topic2, $params['NEW_VALUE'], 0, 0); //Передаем в MQTT break; case 'alert': // data {"alert": "Hello!"} Displays an alert dialog within the application Отображает диалоговое окно предупреждения в приложении $array = array('alert' => $params['NEW_VALUE']); $status = json_encode($array, JSON_UNESCAPED_UNICODE); break; case 'notification': // data {"notification": "Hello!"} Displays a system notification on the device Отображает системное уведомление на устройстве $array = array('notification' => $params['NEW_VALUE']); $status = json_encode($array, JSON_UNESCAPED_UNICODE); break; case 'sun': // data {"sun": "above_horizon"} Changes the application day or night mode based on sun value (above_horizon, below_horizon) // Изменяет дневной или ночной режим приложения в зависимости от значения солнца (выше_горизонта, ниже_горизонта) $array = array('sun' => $params['NEW_VALUE']); $status = json_encode($array); break; case 'clearCache': // {"clearCache":true, "relaunch":true} $status = '{"clearCache": true, "relaunch": true}'; break; case 'relaunch': // {"clearCache":true, "relaunch":true} $status = '{"clearCache": true, "relaunch": true}'; break; case 'weather': $status = '{"weather": {"condition": "sunny", "humidity": 61, "temperature": 27.2, "forecast": [ {"condition": "sunny", "temperature": 19.8, "templow": 13.5, "datetime": "2020-11-30T15:00:00+00:00", "wind_bearing": 101.4, "wind_speed": 30.6}, {"condition": "cloudy", "precipitation": 1.2, "temperature": 23.0, "templow": 16.8, "datetime": "2020-12-01T15:00:00+00:00", "wind_bearing": 17.1, "wind_speed": 24.5}, {"condition": "partlycloudy", "temperature": 26.0, "templow": 20.5, "datetime": "2020-12-02T15:00:00+00:00", "wind_bearing": 48.8, "wind_speed": 14.0}, {"condition": "partlycloudy", "precipitation": 0.3, "temperature": 25.2, "templow": 19.7, "datetime": "2020-12-03T15:00:00+00:00", "wind_bearing": 71.5, "wind_speed": 22.7}, {"condition": "partlycloudy", "temperature": 22.7, "templow": 18.0, "datetime": "2020-12-04T15:00:00+00:00", "wind_bearing": 105.5, "wind_speed": 33.5} ]}}'; break; default: //say('Сообщение не распознано', 0); $this->result = array('status' => 'не распознано', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); say('Сообщение не распознано о - '.$state['event'].' от - '.$state['deviceId'].' - '.$this->result['status'].' - в - '.$this->result['date'], $msl); break; } $topic = $name."/alarmpanel/command"; mqttMob($topic, $status, 0, 0); //Передаем в MQTT
/* * Application State Data * Приложение также может публиковать данные о состоянии дисплея, такие как текущий URL-адрес, панели, состояние экрана. * {"currentUrl": "","screenOn": true,"brightness": 255,"presence": "true"} * {"currentUrl": "http://192.168.10.26/popup/plans.html?id=2","screenOn": true,"brightness": 32,"presence": "true"} * {"currentUrl": "http://192.168.10.26/menu/526.html","screenOn": true} */ $state = json_decode($params['VALUE'], true); // alarmpanel/state foreach ($state as $k=>$v) { $this->setProperty('state_'.$k, $v); } /* или $this->setProperty('state_screenOn', $params['screenOn']); $this->setProperty('state_currentUrl', $params['currentUrl']); $this->setProperty('state_brightness', $params['brightness']); $this->setProperty('state_presence', $params['presence']); */
/* * $message = $params['VALUE']; // Принимаем данные * * Camera Motion, Face, and QR Codes Detections * В дополнение к публикации данных датчиков устройства, приложение также может публиковать состояния для обнаружения движения и распознавания лиц, * а также данные из QR-кодов, полученных с камеры устройства. * In addition to device sensor data publishing, the application can also publish states for Motion detection and Face detection, * as well as the data from QR Codes, derived from the device camera. */ $state = json_decode($params['VALUE'], true); // Принимаем и Декодируем в массив //$this->setProperty('message_face', $params['VALUE']); // Записываем сырые данные в свойство при необходимости //------------------------------------------- Записываем основные данные в свойства из MQTT alarmpanel/sensor/face // {"value": false} Published immediately when face detected Публикуется сразу же при обнаружении лица $this->setProperty('sensorFace', $state['value']); //Передаем в MQTT $name = $this->getProperty('name'); if ($state['value']) { $json = '1'; } else { $json = '0'; } $topic = $name. "/home/alarm/sensor/face"; mqttMob($topic, $json, 0, 0);
/* * $state = $params['VALUE']; // Принимаем данные * * Camera Motion, Face, and QR Codes Detections * В дополнение к публикации данных датчиков устройства, приложение также может публиковать состояния для обнаружения движения и распознавания лиц, * а также данные из QR-кодов, полученных с камеры устройства. * In addition to device sensor data publishing, the application can also publish states for Motion detection and Face detection, * as well as the data from QR Codes, derived from the device camera. */ $state = json_decode($params['VALUE'], true); // Принимаем и Декодируем в массив //$this->setProperty('message_qrcode', $params['VALUE']); // Записываем сырые данные в свойство при необходимости //------------------------------------------- Записываем основные данные в свойства из MQTT alarmpanel/sensor/qrcode // {"value": data} Published immediately when QR Code scanned Публикуется сразу после сканирования QR-кода $this->setProperty('sensorQrcode', $state['value']); if ($state['value']) { getURL('/popup/app_qrcodes.html?qr='.urlencode($state['value'])); }
/* * Поддерживаемые команды и раздел команд: * Панель сигнализации может отправлять на сервер команды для различных состояний сигнализации. * Брокер MQTT прослушивает эти команды, чтобы обновить состояние тревоги. * Тема команды по умолчанию - home/alarm/set, которую можно изменить в настройках. * Вот список команд, отправляемых из приложения брокеру MQTT. * { "event": "invalid_code_provided" } * { "event": "arm_away" } * { "event": "arm_away","delay": 60 } # exit delay * { "state": "pending","delay": 60 } # disarm time */ $ot = $this->object_title; $desc = $this->description; switch ($payload) { // Принимаем SWM07E/home/alarm/event case 'invalid_code_provided': // The code to disarm or arm the alarm is incorrect $status = '{ "event": "invalid_code_provided" }' ; //$status = 'invalid_code_provided' ; break; case 'no_code_provided': // The code to disarm or arm the alarm is required but missing $status = '{ "event": "no_code_provided" }' ; break; case 'failed_to_arm': // The alarm could not be armed due to open sensors $status = '{ "event": "failed_to_arm" }' ; break; case 'system_disabled': // The alarm state could not be changed, because the system was unresponsive or unavailable $status = '{ "event": "system_disabled" }' ; break; case 'unknown': // The alarm state could not be changed due to an unknown error, check your setup $status = '{ "event": "unknown" }' ; break; case 'ARM_AWAY': // Используется для синхронизации команды тревоги между несколькими устройствами или с удаленным сервером $status = '{ "event": "ARM_AWAY" }' ; break; case 'ARM_HOME': // Используется для синхронизации команды тревоги между несколькими устройствами или с удаленным сервером $status = '{ "event": "ARM_HOME" }' ; break; case 'ARM_NIGHT': // Используется для синхронизации команды тревоги между несколькими устройствами или с удаленным сервером $status = '{ "event": "ARM_NIGHT" }' ; break; case 'ARM_CUSTOM_BYPASS': // Используется для синхронизации команды тревоги между несколькими устройствами или с удаленным сервером $status = '{ "event": "ARM_CUSTOM_BYPASS" }' ; break; default: //say('Сообщение не распознано', 0); $this->result = array('status' => 'не распознано', 'date' => date('Y/m/d H:i:s', time())); //DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); say('Сообщение не распознано о - '.$state['event'].' от - '.$state['deviceId'].' - '.$this->result['status'].' - в - '.$this->result['date'], $msl); break; } $name = $this->getProperty('name'); $topic = $name."/home/alarm/event"; mqttMob($topic, $status, 0, 0); //Передаем в MQTT
/* * Поддерживаемые команды и раздел команд: * Панель сигнализации может отправлять на сервер команды для различных состояний сигнализации. * Брокер MQTT прослушивает эти команды, чтобы обновить состояние тревоги. * Тема команды по умолчанию - home/alarm/set, которую можно изменить в настройках. * Вот список команд, отправляемых из приложения брокеру MQTT. * * ARM_AWAY Arm the alarm in mode armed_away. * ARM_HOME Arm the alarm in mode armed_home. * ARM_NIGHT Arm the alarm in mode armed_night. * ARM_CUSTOM_BYPASS Arm the alarm in mode armed_custom_bypass. * DISARM Disarm the alarm. * PANIC Alarm panic button pressed. * {"command": "ARM_HOME","code": "1234"} * ----------------------------------------------------------------------- * Поддерживаемые Состояния и Топик Состояний * Панель сигнализации подписывается на изменения состояния MQTT, публикуемые удаленной системой сигнализации. * Тема состояния по умолчанию - home/alarm, и ее можно изменить в настройках. * Вот список значений состояния и их описаний, которые может обрабатывать приложение. * * disarmed The alarm is disabled/off. Сигнализация отключена/выкл. * arming The alarm is arming. Сигнализация включена. Сигнализация будет включена после задержки. (The alarm will be armed after the delay.) * armed_away The alarm is armed in away mode. * armed_home The alarm is armed in home mode. * armed_night The alarm is armed in night mode. * armed_custom_bypass The alarm is armed in custom mode. * pending The alarm is pending. Сигнал тревоги сработает после задержки. (The alarm will be triggered after the delay.) * triggered The alarm is triggered. * ----------------------------------------------------------------------- * Поддерживаемое мероприятие и тема мероприятия (Supported Event and Event Topic) * Alarm Panel может подписаться на тему события, чтобы получать дополнительную информацию от удаленной системы сигнализации. * Например, топик евент будет уведомлять приложение об ошибках сигнализации, * таких как неверные коды и невозможность активировать сигнализацию из-за открытых датчиков. * Топик евент по умолчанию - home/alarm/event, и его можно изменить в настройках. * Вот список полезных нагрузок событий, которые может обрабатывать панель сигнализации, полезная нагрузка используется в формате JSON. * * invalid_code_provided Неверный код для снятия с охраны или постановки на охрану сигнализации. * no_code_provided Код для снятия или постановки на охрану сигнализации требуется, но отсутствует. * failed_to_arm Сигнализация не могла быть включена из-за разомкнутых датчиков. * system_disabled Состояние тревоги изменить не удалось, поскольку система не отвечала на запросы или была недоступна. * unknown Состояние тревоги не удалось изменить из-за неизвестной ошибки, проверьте настройки. * ARM_AWAY, ARM_HOME, ARM_NIGHT, ARM_CUSTOM_BYPASS Используется для синхронизации команд тревоги между несколькими устройствами или с удаленным сервером. * * Если вы хотите отправить сообщение об ошибке, что был введен неверный код для снятия с охраны или постановки на охрану сигнализации, * вы должны отправить следующую полезную нагрузку в формате JSON по теме события: * {"event": "invalid_code_provided"} * ------------------------------------------------------------------------ * $this->setProperty('messageSet', $params['VALUE']); // Записываем сырые данные в свойство при необходимости */ $name = $this->getProperty('name'); //alarmPanel02.name alarmPanel02.code //$payload = $params['VALUE']; // Принимаем данные $json = json_decode($params['VALUE'], true); // Декодируем в массив {"command": "ARM_HOME","code": "1234"} if (!isset($json["command"])) { $payload = $params['VALUE']; } else { $payload = $json['command']; } switch ($payload) { case 'ARM_AWAY': say('Сообщение ARM AWAY', $msl); // Arm the alarm in mode armed_away (Полностью) if (!isset($json["code"])) { $topic = $name."/home/alarm/event"; $status = '{"event": "no_code_provided"}'; say('Нужен код', $msl); } if ($json['code'] == $this->getProperty('code')) { $topic = $name."/home/alarm"; $status = "armed_away"; $topic = $name."/home/alarm/event"; $status = '{"event": "arm_away", "delay": 5}'; say('Код принят, включена задержка', $msl); } else { $topic = $name."/home/alarm/event"; $status = '{"event": "invalid_code_provided"}'; say('Неверный код', $msl); } break; case 'ARM_HOME': say('Сообщение ARM HOME', $msl); // Arm the alarm in mode armed_home (Только дом) if (!isset($json["code"])) { $topic = $name."/home/alarm/event"; $status = '{"event": "no_code_provided"}'; } else { if ($json['code'] == $this->getProperty('code')) { $topic = $name."/home/alarm"; $status = "armed_home"; $topic = $name."/home/alarm/event"; $status = '{"event": "arm_home", "delay": 10}'; } else { $topic = $name."/home/alarm/event"; $status = '{"event": "invalid_code_provided"}';} } break; case 'ARM_NIGHT': say('Запрос на установку ночной охраны', $msl); // Arm the alarm in mode armed_night (Частично) if (!isset($json["code"])) { $topic = $name."/home/alarm/event"; $status = '{"event": "no_code_provided"}'; } else { if ($json['code'] == $this->getProperty('code')) { $topic = $name."/home/alarm"; $status = "armed_night"; $topic = $name."/home/alarm/event"; $status = '{"event": "arm_night", "delay": 10}'; } else { $topic = $name."/home/alarm/event"; $status = '{"event": "invalid_code_provided"}';} } break; case 'ARM_CUSTOM_BYPASS': say('Сообщение ARM CUSTOM BYPASS', $msl); // Arm the alarm in mode armed_custom_bypass (Выборочно) if (!isset($json["code"])) { $topic = $name."/home/alarm/event"; $status = '{"event": "no_code_provided"}'; } else { if ($json['code'] == $this->getProperty('code')) { $topic = $name."/home/alarm"; $status = "armed_custom_bypass"; $topic = $name."/home/alarm/event"; $status = '{"event": "arm_custom_bypass", "delay": 30}'; } else { $topic = $name."/home/alarm/event"; $status = '{"event": "invalid_code_provided"}';} } break; case 'DISARM': say('Сообщение DISARM', $msl); // Disarm the alarm (Выключить) if (!isset($json["code"])) { $topic = $name."/home/alarm/event"; $status = '{"event": "no_code_provided"}'; say('Нужен код', $msl); } else { if ($json['code'] == $this->getProperty('code')) { $topic = $name."/home/alarm"; $status = "disarmed"; say('Код принят', $msl); } else { $topic = $name."/home/alarm/event"; $status = '{"event": "invalid_code_provided"}'; say('Неверный код', $msl); } } break; case 'PANIC': say('Сообщение ПАНИКА', $msl);// Alarm panic button pressed $topic = $name."/alarmpanel/command"; $status = '{"audio":"http://192.168.10.26/cms/sounds/10h.mp3"}'; break; default: say('Сообщение не распознано', 0); //$this->result = array('status' => 'не распознано', 'date' => date('Y/m/d H:i:s', time())); //DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение не распознано о - '.$state['event'].' от - '.$state['deviceId'].' - '.$this->result['status'].' - в - '.$this->result['date'], $msl); break; } include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); $rezult = $mqtt->mqttPublish($topic, $status, 0, 0);
/* * $message = $params['VALUE']; // Принимаем данные * * Camera Motion, Face, and QR Codes Detections * В дополнение к публикации данных датчиков устройства, приложение также может публиковать состояния для обнаружения движения и распознавания лиц, * а также данные из QR-кодов, полученных с камеры устройства. * In addition to device sensor data publishing, the application can also publish states for Motion detection and Face detection, * as well as the data from QR Codes, derived from the device camera. */ $state = json_decode($params['VALUE'], true); // Принимаем и Декодируем в массив //$this->setProperty('message_motion', $params['VALUE']); // Записываем сырые данные в свойство при необходимости //------------------------------------------- Записываем основные данные в свойства из MQTT alarmpanel/sensor/motion // {"value": false} Published immediately when face detected Публикуется сразу же при обнаружении лица $this->setProperty('sensorMotion', $state['value']); //Передаем в MQTT $name = $this->getProperty('name'); if ($state['value']) { $json = '1'; } else { $json = '0'; } $topic = $name. "/home/alarm/sensor/motion"; mqttMob($topic, $json, 0, 0); $ot = $this->object_title; if (!isset($params['statusUpdated'])) { setTimeout($ot . '_motion_timer_status', '', 3); } if (isset($params['VALUE']) && !$params['VALUE'] && !isset($params['statusUpdated'])) { $this->setProperty('status', 0); return; } $motion_timeout = $this->getProperty('timeout'); // seconds timeout if (!$motion_timeout) { $motion_timeout = 20; // timeout by default } if (!isset($params['statusUpdated'])) { $this->setProperty('status', 1); } setTimeout($ot . '_motion_timer', 'setGlobal("' . $ot . '.status", 0);', $motion_timeout); $is_blocked=(int)$this->getProperty('blocked'); if ($is_blocked) { return; }
/* * $state = $params['VALUE']; // Принимаем данные * * Сенсоры * Приложение будет публиковать данные датчиков устройства в соответствии с описанием API и частотой считывания показаний датчиков. * В настоящее время опубликованы датчики устройства для измерения давления, температуры, освещенности и уровня заряда батареи. * The application will post device sensors data per the API description and Sensor Reading Frequency. * Currently device sensors for Pressure, Temperature, Light and Battery Level are published. */ $state = json_decode($params['VALUE'], true); // Принимаем и Декодируем в массив //этот цикл раскидает всё по свойствам //foreach ($state as $k=>$v) { // Записываем циклом //$this->setProperty('battery_'.$k, $v); //} //------------------------------------------- Записываем основные данные в свойства из MQTT alarmpanel/sensor/battery switch ($state['unit']) { case '%': // уровнь заряда батареи {"value": 84,"unit": "%","charging": true,"acPlugged": true,"usbPlugged": false} $this->setProperty('batteryLevel', $state['value']); $this->setProperty('batteryCharging', $state['charging']); $this->setProperty('acPlugged', $state['acPlugged']); $this->setProperty('usbPlugged', $state['usbPlugged']); //$this->setProperty('batteryUnit', $state['unit']); break; case 'lx': // уровнь освещенности {"unit":"lx", "value":"920"} $this->setProperty('sensorLight', $state['value']); break; case 'uT': // уровнь magneticField {"unit":"uT", "value":"-1780.699951171875"} $this->setProperty('sensorMagneticField', $state['value']); break; case 'hPa': // уровнь давления {"unit":"hPa", "value":"1011.584716796875"} $this->setProperty('sensorPressure', $state['value']); break; case '°C': // уровнь температуры {"unit":"°C", "value":"24"} $this->setProperty('sensorTemperature', $state['value']); break; default: //say('Сообщение не распознано', 0); $this->result = array('status' => 'не распознано', 'date' => date('Y/m/d H:i:s', time())); //DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); say('Сообщение не распознано о - '.$state['event'].' от - '.$state['deviceId'].' - '.$this->result['status'].' - в - '.$this->result['date'], $msl); break; }
Class objects:
Class properties:
Class methods:
Class objects:
//include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); // $mqtt = new mqtt(); // $path = 'mjd/26/mqtt/xor/#'; // $rezult = $mqtt->processMessage($path, true); $value = $params['VALUE']; if (!isset($params['VALUE'])) { $value = $params['NEW_VALUE'];// return; //ThisComputer->onSwitch } //else { // $value = $params['VALUE']; //} $this->setProperty('value', $value); //if($params['NEW_VALUE']){ // $txt = $params['NEW_VALUE']; //пришёл текст в mqttIn.value say($value,2,'1'); //проговорим его от имени пользователя, а не Алисы. Это третий параметр в say //} //processCommand($value); // отправляет текстовую команду на исполнение (например, "скажи сколько время"). Сами команды настраиваются методе ThisComputer->commandReceived. //say($ph,$level,$from_user_id) -- говорит фразу (использует глобальные переменные // global $voicemode; //$voicemode($value); // '' [именно говорить] и // global $commandLine; //$commandLine($value); // [преобразует ответ в echo utf2win(), иначе просто echo]). //callMethod('mqttIn.jsonChanged', array('VALUE'=>$value, 'level'=>$params['level'])); //callMethod('ThisComputer.commandReceived',array('VALUE'=>$value));
/** * * Позволяет подключить системные сообщения SAY и посылает их в MQTT * * Подключать в локальный метод ThisComputer -> onSwitch код callMethod('mqttIn.cmdChanged', array('NEW_VALUE'=>$params['NEW_VALUE'])); * Или в модуле Общие настройки -> Обработчики -> After SAY (code) вставить код callMethod('mqttIn.cmdChanged', array('ph'=>$ph,'level'=>$level)); * callMethod('mqttIn.cmdChanged', array('ph'=>$ph.' - '.$level)); * After SAY - Код, вызываемый после отправки фразы на произношение. * В данном коде можно использовать значение фразы ($ph) и уровень важности ($level). * * @return mixed */ //if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; //if (!isset($params['cmd'])) { $cmd = $params['PROPERTY']; } else { $cmd = $params['cmd']; } //$prop = $params['PROPERTY']; //$old = $params['OLD_VALUE']; //$new = $params['NEW_VALUE']; //$oot = $params['ORIGINAL_OBJECT_TITLE']; if ($params['ph']) { // callMethod('MobileFKB01.setFully', array('ph'=>$ph,'level'=>$level)); // вставить Общие настройки -> Обработчики -> After SAY (code) $params['VALUE'] = $params['ph']; } if (!isset($params['VALUE'])) { $value = $params['NEW_VALUE'];// return; //ThisComputer->onSwitch } else { $value = $params['VALUE']; } $array = array( 'ph' => $value, //urlencode($value) 'level' => $params['level'], 'info' => 'Сообщение от Алисы', // 'vibrate' => 'true', // 'sound' => 'true', // 'light' => 'true', // 'id' => $id, ); $val = json_encode($array, JSON_UNESCAPED_UNICODE);//, true, JSON_UNESCAPED_UNICODE $top = $this->getProperty('topic'); //preTopic mjd/26/mqtt/xor include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); $topic = "/".$top."/cmd"; //топик mjd/26/mqtt/ //$value = gg('ThisComputer.lastSayMessage') ;// по идее топик и пэйлоад можно сделать параметрами и слать из методов $rezult = $mqtt->mqttPublish($topic, $value, 0, 0); $topic = "/".$top."/Home"; //топик mjd/26/mqtt/ //$value = gg('ThisComputer.lastSayMessage') ;// по идее топик и пэйлоад можно сделать параметрами и слать из методов $rezult = $mqtt->mqttPublish($topic, $val, 0, 0); //callMethod('mqttIn.jsonChanged', array('VALUE'=>$value, 'level'=>$params['level'])); //callMethod('ThisComputer.commandReceived',array('VALUE'=>$value)); //global $voicemode; // $voicemode='on'; // say('Сейчас '.timeNow(),2); //say('Сейчас '.$value, 2); //$passw = $this->getProperty('passw'); //$ipterm = 'http://'.$this->getProperty('ip4').':2323'; //getURL($ipterm.'/?cmd=textToSpeech&text='.urlencode($value).'&locale=ru&password='.urlencode($passw)); //getURL($ipterm.'/?cmd=setOverlayMessage&text='.urlencode($value).'&password='.urlencode($passw)); //$ot = $this->object_title; //DebMes('Принято сообщение - '.$value.' для устройства '.$ot); //$this->result = array('status' => 'принято', 'date' => date('Y/m/d H:i:s', time()));
/** * * Позволяет подключить системные сообщения SAY и посылает их в MQTT * * Подключать в локальный метод ThisComputer -> onSwitch код callMethod('mqttIn.cmdChanged', array('NEW_VALUE'=>$params['NEW_VALUE'])); * Или в модуле Общие настройки -> Обработчики -> After SAY (code) вставить код callMethod('mqttIn.cmdChanged', array('VALUE'=>$ph,'level'=>$level)); * * After SAY - Код, вызываемый после отправки фразы на произношение. * В данном коде можно использовать значение фразы ($ph) и уровень важности ($level). * * @return mixed */ //if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; //if (!isset($params['cmd'])) { $cmd = $params['PROPERTY']; } else { $cmd = $params['cmd']; } //$prop = $params['PROPERTY']; //$old = $params['OLD_VALUE']; //$new = $params['NEW_VALUE']; //$origot = $params['ORIGINAL_OBJECT_TITLE']; /* $value = $params['VALUE']; if (!isset($params['VALUE'])) { $value = $params['NEW_VALUE'];// return; //ThisComputer->onSwitch } else { $value = $params['VALUE']; } $array = array( 'ph' => $value, //urlencode($value) 'level' => $params['level'], 'info' => 'Сообщение от Алисы', // 'vibrate' => 'true', // 'sound' => 'true', // 'light' => 'true', // 'id' => $id, ); $val = json_encode($array, JSON_UNESCAPED_UNICODE);//, true, JSON_UNESCAPED_UNICODE include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); $topic = "mjd/26/mqtt/xor/json"; //топик mjd/26/mqtt/ //$value = gg('ThisComputer.lastSayMessage') ;// по идее топик и пэйлоад можно сделать параметрами и слать из методов $rezult = $mqtt->mqttPublish($topic, $val, 0, 0); */ //global $voicemode; // $voicemode='on'; // say('Сейчас '.timeNow(),2); //say('Сейчас '.$value, 2); //$passw = $this->getProperty('passw'); //$ipterm = 'http://'.$this->getProperty('ip4').':2323'; //getURL($ipterm.'/?cmd=textToSpeech&text='.urlencode($value).'&locale=ru&password='.urlencode($passw)); //getURL($ipterm.'/?cmd=setOverlayMessage&text='.urlencode($value).'&password='.urlencode($passw)); //$ot = $this->object_title; //DebMes('Принято сообщение - '.$value.' для устройства '.$ot); //$this->result = array('status' => 'принято', 'date' => date('Y/m/d H:i:s', time()));
Class properties:
Class methods:
//$alias = $this->object_title; $aliases = $this->getProperty('aliases'); if ($this->getProperty('online') == 1) { include_once(DIR_MODULES.'app_smarttv/app_smarttv.class.php'); $smartTv = new app_smarttv(); $listChan = $smartTv->control($aliases,'listChan');// - Возвращает массив с информацией о настроенных каналах; if ($listChan['ROAPError'] == '200') { //$this->setProperty('progNum', $res['data']['major']); // "major":"7", $json2 = json_encode($listChan, JSON_UNESCAPED_UNICODE); echo $json2; // здесь ответ от запроса к Fully в json echo '<br>'; } else { echo 'Ошибка <br>'; } } elseif ($this->getProperty('online') == 2) { echo 'Нет связи <br>'; } elseif ($this->getProperty('online') == 0) { echo 'Не извесно <br>'; } /* $res = $smartTv->control($alias,'curChan'); // - Возвращает массив с информацией о текущем канале; $vol = $smartTv->control($alias,'getVol'); // - Возвращает текущую громкость; //----------------------- Записываем данные в свойства write_to_properties $this->setProperty('vol', $vol); // sg($ot.'.v',$ver); $this->setProperty('progNum', $res['data']['major']); // "major":"7", $this->setProperty('physicalNum', $res['data']['physicalNum']); // "physicalNum":"63", $this->setProperty('progName', $res['data']['progName']); // "progName":"Новости", "progName":[], $this->setProperty('inputSourceName', $res['data']['inputSourceName']); // "inputSourceName":"Кабельное ТВ", "inputSourceName":"Антенна", $this->setProperty('chName', $res['data']['chname']); // "chname":"Россия-24", "chname":"S 09", $this->setProperty('chType', $res['data']['chtype']); // "chtype":"cable", "chtype":"terrestrial", { "ROAPError":"200", "ROAPErrorDetail":"OK", "data":[ {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"1","displayMajor":"1","minor":"1","displayMinor":"-1","chname":"Первый канал"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"2","displayMajor":"2","minor":"2","displayMinor":"-1","chname":"Россия-1"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"3","displayMajor":"3","minor":"3","displayMinor":"-1","chname":"Матч ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"4","displayMajor":"4","minor":"4","displayMinor":"-1","chname":"НТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"5","displayMajor":"5","minor":"5","displayMinor":"-1","chname":"5 канал"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"6","displayMajor":"6","minor":"6","displayMinor":"-1","chname":"Россия-К"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"7","displayMajor":"7","minor":"7","displayMinor":"-1","chname":"Россия-24"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"8","displayMajor":"8","minor":"8","displayMinor":"-1","chname":"Карусель"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"9","displayMajor":"9","minor":"9","displayMinor":"-1","chname":"ОТР"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"63","major":"10","displayMajor":"10","minor":"10","displayMinor":"-1","chname":"ТВ Центр"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"11","displayMajor":"11","minor":"11","displayMinor":"-1","chname":"РЕН"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"12","displayMajor":"12","minor":"12","displayMinor":"-1","chname":"Спас"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"13","displayMajor":"13","minor":"13","displayMinor":"-1","chname":"СТС"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"14","displayMajor":"14","minor":"14","displayMinor":"-1","chname":"Домашний"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"15","displayMajor":"15","minor":"15","displayMinor":"-1","chname":"ТВ-3"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"16","displayMajor":"16","minor":"16","displayMinor":"-1","chname":"Пятница"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"17","displayMajor":"17","minor":"17","displayMinor":"-1","chname":"Звезда"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"18","displayMajor":"18","minor":"18","displayMinor":"-1","chname":"Мир"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"19","displayMajor":"19","minor":"19","displayMinor":"-1","chname":"ТНТ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"20","displayMajor":"20","minor":"20","displayMinor":"-1","chname":"МУЗ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"21","displayMajor":"21","minor":"21","displayMinor":"-1","chname":"Вести ФМ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"22","displayMajor":"22","minor":"22","displayMinor":"-1","chname":"Радио Маяк"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"31","displayMajor":"31","minor":"31","displayMinor":"-1","chname":"Санкт-Петербург"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"32","displayMajor":"32","minor":"32","displayMinor":"-1","chname":"ЛенТВ24"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"33","displayMajor":"33","minor":"33","displayMinor":"-1","chname":"Че"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"34","displayMajor":"34","minor":"34","displayMinor":"-1","chname":"Рыболов"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"35","displayMajor":"35","minor":"35","displayMinor":"-1","chname":"Время"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"36","displayMajor":"36","minor":"36","displayMinor":"-1","chname":"Ю-ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"37","displayMajor":"37","minor":"37","displayMinor":"-1","chname":"78"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"38","displayMajor":"38","minor":"38","displayMinor":"-1","chname":"РБК"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"39","displayMajor":"39","minor":"39","displayMinor":"-1","chname":"FAN"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"40","displayMajor":"40","minor":"40","displayMinor":"-1","chname":"2x2"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"42","displayMajor":"42","minor":"42","displayMinor":"-1","chname":"Детский мир"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"43","displayMajor":"43","minor":"43","displayMinor":"-1","chname":"Карусель"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"44","displayMajor":"44","minor":"44","displayMinor":"-1","chname":"Мультимузыка"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"45","displayMajor":"45","minor":"45","displayMinor":"-1","chname":"Мульт"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"46","displayMajor":"46","minor":"46","displayMinor":"-1","chname":"Ani"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"47","displayMajor":"47","minor":"47","displayMinor":"-1","chname":"Da Vinci"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"48","displayMajor":"48","minor":"48","displayMinor":"-1","chname":"O!"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"49","displayMajor":"49","minor":"49","displayMinor":"-1","chname":"Мама"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"66","major":"50","displayMajor":"50","minor":"50","displayMinor":"-1","chname":"Доктор"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"51","displayMajor":"51","minor":"51","displayMinor":"-1","chname":"Ключ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"52","displayMajor":"52","minor":"52","displayMinor":"-1","chname":"Еда"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"53","displayMajor":"53","minor":"53","displayMinor":"-1","chname":"КВН ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"54","displayMajor":"54","minor":"54","displayMinor":"-1","chname":"Сарафан"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"55","displayMajor":"55","minor":"55","displayMinor":"-1","chname":"Союз"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"56","displayMajor":"56","minor":"56","displayMinor":"-1","chname":"Загородный"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"57","displayMajor":"57","minor":"57","displayMinor":"-1","chname":"Усадьба ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"58","displayMajor":"58","minor":"58","displayMinor":"-1","chname":"Ретро"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"59","displayMajor":"59","minor":"59","displayMinor":"-1","chname":"Вопросы и ответы"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"67","major":"60","displayMajor":"60","minor":"60","displayMinor":"-1","chname":"Охота и рыбалка"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"68","major":"61","displayMajor":"61","minor":"61","displayMinor":"-1","chname":"Драйв"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"68","major":"62","displayMajor":"62","minor":"62","displayMinor":"-1","chname":"Тномер"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"68","major":"63","displayMajor":"63","minor":"63","displayMinor":"-1","chname":"Insight TV"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"68","major":"64","displayMajor":"64","minor":"64","displayMinor":"-1","chname":"Museum"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"68","major":"65","displayMajor":"65","minor":"65","displayMinor":"-1","chname":"HDL"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"65","major":"66","displayMajor":"66","minor":"66","displayMinor":"-1","chname":"Победа"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"69","major":"71","displayMajor":"71","minor":"71","displayMinor":"-1","chname":"Наша Сибирь"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"69","major":"72","displayMajor":"72","minor":"72","displayMinor":"-1","chname":"Первый Космический"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"69","major":"73","displayMajor":"73","minor":"73","displayMinor":"-1","chname":"Viasat History"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"69","major":"74","displayMajor":"74","minor":"74","displayMinor":"-1","chname":"Viasat Explore"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"69","major":"75","displayMajor":"75","minor":"75","displayMinor":"-1","chname":"Viasat Nature"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"70","major":"81","displayMajor":"81","minor":"81","displayMinor":"-1","chname":"National Geographic Wild"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"70","major":"82","displayMajor":"82","minor":"82","displayMinor":"-1","chname":"National Geographic HD"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"70","major":"83","displayMajor":"83","minor":"83","displayMinor":"-1","chname":"RTG HD"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"70","major":"84","displayMajor":"84","minor":"84","displayMinor":"-1","chname":"365 дней ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"70","major":"85","displayMajor":"85","minor":"85","displayMinor":"-1","chname":"Оружие"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"86","displayMajor":"86","minor":"86","displayMinor":"-1","chname":"Ностальгия"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"87","displayMajor":"87","minor":"87","displayMinor":"-1","chname":"Поехали!"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"89","displayMajor":"89","minor":"89","displayMinor":"-1","chname":"Живи!"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"90","displayMajor":"90","minor":"90","displayMinor":"-1","chname":"E TV"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"91","displayMajor":"91","minor":"91","displayMinor":"-1","chname":"Наука"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"92","displayMajor":"92","minor":"92","displayMinor":"-1","chname":"Моя Планета"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"93","displayMajor":"93","minor":"93","displayMinor":"-1","chname":"Живая Планета"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"94","displayMajor":"94","minor":"94","displayMinor":"-1","chname":"Бобер"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"95","displayMajor":"95","minor":"95","displayMinor":"-1","chname":"Здоровое ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"96","displayMajor":"96","minor":"96","displayMinor":"-1","chname":"Психология"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"97","displayMajor":"97","minor":"97","displayMinor":"-1","chname":"Домашние животные"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"71","major":"98","displayMajor":"98","minor":"98","displayMinor":"-1","chname":"Телекафе"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"81","major":"101","displayMajor":"101","minor":"101","displayMinor":"-1","chname":"Viasat Nature\/History HD"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"81","major":"102","displayMajor":"102","minor":"102","displayMinor":"-1","chname":"VIP Comedy"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"82","major":"111","displayMajor":"111","minor":"111","displayMinor":"-1","chname":"VIP Megahit"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"82","major":"112","displayMajor":"112","minor":"112","displayMinor":"-1","chname":"VIP Premiere"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"121","displayMajor":"121","minor":"121","displayMinor":"-1","chname":"AMEDIA Premium"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"122","displayMajor":"122","minor":"122","displayMinor":"-1","chname":"AMEDIA Hit"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"123","displayMajor":"123","minor":"123","displayMinor":"-1","chname":"A1"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"124","displayMajor":"124","minor":"124","displayMinor":"-1","chname":"TV 1000 Action"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"125","displayMajor":"125","minor":"125","displayMinor":"-1","chname":"TV1000"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"127","displayMajor":"127","minor":"127","displayMinor":"-1","chname":"Киномикс"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"128","displayMajor":"128","minor":"128","displayMinor":"-1","chname":"Наше новое кино"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"129","displayMajor":"129","minor":"129","displayMinor":"-1","chname":"Родное кино"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"83","major":"130","displayMajor":"130","minor":"130","displayMinor":"-1","chname":"Кинокомедия"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"132","displayMajor":"132","minor":"132","displayMinor":"-1","chname":"НСТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"133","displayMajor":"133","minor":"133","displayMinor":"-1","chname":"Кинопоказ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"134","displayMajor":"134","minor":"134","displayMinor":"-1","chname":"Кино ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"135","displayMajor":"135","minor":"135","displayMinor":"-1","chname":"Русский Иллюзион"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"136","displayMajor":"136","minor":"136","displayMinor":"-1","chname":"TV1000 Русское кино"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"137","displayMajor":"137","minor":"137","displayMinor":"-1","chname":"Дом Кино"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"138","displayMajor":"138","minor":"138","displayMinor":"-1","chname":"Дом Кино Премиум HD"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"139","displayMajor":"139","minor":"139","displayMinor":"-1","chname":"Cinema"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"84","major":"140","displayMajor":"140","minor":"140","displayMinor":"-1","chname":"Иллюзион+"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"141","displayMajor":"141","minor":"141","displayMinor":"-1","chname":".sci-fi"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"142","displayMajor":"142","minor":"142","displayMinor":"-1","chname":".black"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"143","displayMajor":"143","minor":"143","displayMinor":"-1","chname":".red"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"144","displayMajor":"144","minor":"144","displayMinor":"-1","chname":"FilmBox Arthouse"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"145","displayMajor":"145","minor":"145","displayMinor":"-1","chname":"Русский роман"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"146","displayMajor":"146","minor":"146","displayMinor":"-1","chname":"Русский детектив"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"147","displayMajor":"147","minor":"147","displayMinor":"-1","chname":"Золотая коллекция"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"148","displayMajor":"148","minor":"148","displayMinor":"-1","chname":"Dorama"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"149","displayMajor":"149","minor":"149","displayMinor":"-1","chname":"Zee TV"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"85","major":"150","displayMajor":"150","minor":"150","displayMinor":"-1","chname":"Shot TV"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"151","displayMajor":"151","minor":"151","displayMinor":"-1","chname":"FOX HD"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"152","displayMajor":"152","minor":"152","displayMinor":"-1","chname":"FOX Life HD"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"153","displayMajor":"153","minor":"153","displayMinor":"-1","chname":"Fashion TV"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"154","displayMajor":"154","minor":"154","displayMinor":"-1","chname":"о2тв"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"155","displayMajor":"155","minor":"155","displayMinor":"-1","chname":"THT Music"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"156","displayMajor":"156","minor":"156","displayMinor":"-1","chname":"Музыка Первого"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"157","displayMajor":"157","minor":"157","displayMinor":"-1","chname":"RU.TV"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"158","displayMajor":"158","minor":"158","displayMinor":"-1","chname":"Шансон-ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"159","displayMajor":"159","minor":"159","displayMinor":"-1","chname":"Bridge"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"86","major":"160","displayMajor":"160","minor":"160","displayMinor":"-1","chname":"Bridge Classic"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"87","major":"161","displayMajor":"161","minor":"161","displayMinor":"-1","chname":"Stingray iConcerts"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"87","major":"162","displayMajor":"162","minor":"162","displayMinor":"-1","chname":"Trace Urban"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"87","major":"163","displayMajor":"163","minor":"163","displayMinor":"-1","chname":"Trace Sport Stars"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"87","major":"164","displayMajor":"164","minor":"164","displayMinor":"-1","chname":"Viasat Sport"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"87","major":"165","displayMajor":"165","minor":"165","displayMinor":"-1","chname":"Футбол"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"87","major":"166","displayMajor":"166","minor":"166","displayMinor":"-1","chname":"KHL"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"87","major":"167","displayMajor":"167","minor":"167","displayMinor":"-1","chname":"Матч! Боец"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"87","major":"170","displayMajor":"170","minor":"170","displayMinor":"-1","chname":"Матч! Страна"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"88","major":"171","displayMajor":"171","minor":"171","displayMinor":"-1","chname":"Матч! Игра"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"88","major":"172","displayMajor":"172","minor":"172","displayMinor":"-1","chname":"Матч! Арена"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"88","major":"173","displayMajor":"173","minor":"173","displayMinor":"-1","chname":"Матч Премьер"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"88","major":"174","displayMajor":"174","minor":"174","displayMinor":"-1","chname":"Mezzo"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"89","major":"175","displayMajor":"175","minor":"175","displayMinor":"-1","chname":"Bridge Deluxe"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"89","major":"176","displayMajor":"176","minor":"176","displayMinor":"-1","chname":"Театр"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"89","major":"177","displayMajor":"177","minor":"177","displayMinor":"-1","chname":"Мир 24"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"89","major":"178","displayMajor":"178","minor":"178","displayMinor":"-1","chname":"ТНТ4"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"89","major":"179","displayMajor":"179","minor":"179","displayMinor":"-1","chname":"Cуббота"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"89","major":"180","displayMajor":"180","minor":"180","displayMinor":"-1","chname":"СТС Love"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"89","major":"181","displayMajor":"181","minor":"181","displayMinor":"-1","chname":"Домашний"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"89","major":"182","displayMajor":"182","minor":"182","displayMinor":"-1","chname":"CTC"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"90","major":"183","displayMajor":"183","minor":"183","displayMinor":"-1","chname":"Матч! ТВ"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"90","major":"184","displayMajor":"184","minor":"184","displayMinor":"-1","chname":"Россия-1 HD"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"90","major":"185","displayMajor":"185","minor":"185","displayMinor":"-1","chname":"Первый канал HD"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"16407","displayMajor":"23","minor":"23","displayMinor":"-1","chname":"Радио России"}, {"chtype":"cable","sourceIndex":"3","physicalNum":"64","major":"16408","displayMajor":"24","minor":"24","displayMinor":"-1","chname":"Радио Петербург"}]} */
//$alias = $this->object_title; //if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; if ($this->getProperty('online') == 1) { $aliases = $this->getProperty('aliases'); include_once(DIR_MODULES.'app_smarttv/app_smarttv.class.php'); $smartTv = new app_smarttv(); $res = $smartTv->control($aliases,'curChan'); // - Возвращает массив с информацией о текущем канале; $vol = $smartTv->control($aliases,'getVol'); // - Возвращает текущую громкость; //----------------------- Записываем данные в свойства write_to_properties $this->setProperty('vol', $vol); // sg($ot.'.v',$ver); $this->setProperty('progNum', $res['data']['major']); // "major":"7", $this->setProperty('physicalNum', $res['data']['physicalNum']); // "physicalNum":"63", $this->setProperty('progName', $res['data']['progName']); // "progName":"Новости", "progName":[], $this->setProperty('inputSourceName', $res['data']['inputSourceName']); // "inputSourceName":"Кабельное ТВ", "inputSourceName":"Антенна", $this->setProperty('chName', $res['data']['chname']); // "chname":"Россия-24", "chname":"S 09", $this->setProperty('chType', $res['data']['chtype']); // "chtype":"cable", "chtype":"terrestrial", // --------------------------------------------------------------------------------------------------------- $this->setProperty('sourceIndex', $res['data']['sourceIndex']); // "sourceIndex":"3", $this->setProperty('displayMajor', $res['data']['displayMajor']); // "displayMajor":"7", $this->setProperty('minor', $res['data']['minor']); // "minor":"7", $this->setProperty('displayMinor', $res['data']['displayMinor']); // "displayMinor":"-1", $this->setProperty('audioCh', $res['data']['audioCh']); // "audioCh":"0", $this->setProperty('inputSourceType', $res['data']['inputSourceType']); // "inputSourceType":"0", $this->setProperty('labelName', $res['data']['labelName']); // "labelName":[], $this->setProperty('inputSourceIdx', $res['data']['inputSourceIdx']); // "inputSourceIdx":"0" /* ------------------------------------------------------------------------------------------------------------------------ */ } elseif ($this->getProperty('online') == 2) { $this->setProperty('vol', 'нет связи'); // sg($ot.'.v',$ver); $this->setProperty('progNum', 'нет связи'); // "major":"7", $this->setProperty('physicalNum', 'нет связи'); // "physicalNum":"63", $this->setProperty('progName', 'нет связи'); // "progName":"Новости", "progName":[], $this->setProperty('inputSourceName', 'нет связи'); // "inputSourceName":"Кабельное ТВ", "inputSourceName":"Антенна", $this->setProperty('chName', 'нет связи'); // "chname":"Россия-24", "chname":"S 09", $this->setProperty('chType', 'нет связи'); // "chtype":"cable", "chtype":"terrestrial", // --------------------------------------------------------------------------------------------------------- $this->setProperty('sourceIndex', 'нет связи'); // "sourceIndex":"3", $this->setProperty('displayMajor', 'нет связи'); // "displayMajor":"7", $this->setProperty('minor', 'нет связи'); // "minor":"7", $this->setProperty('displayMinor', 'нет связи'); // "displayMinor":"-1", $this->setProperty('audioCh', 'нет связи'); // "audioCh":"0", $this->setProperty('inputSourceType', 'нет связи'); // "inputSourceType":"0", $this->setProperty('labelName', 'нет связи'); // "labelName":[], $this->setProperty('inputSourceIdx', 'нет связи'); // "inputSourceIdx":"0" } /* //$this->setProperty('alarm',intval($alarm)); //$this->setProperty('time',date('H:i:s d-m-Y', $time)); //$this->setProperty('curChan',$json); //$json = json_encode($res, JSON_UNESCAPED_UNICODE); //echo $json; // здесь ответ от запроса в json //echo '<br>'; */ /*----------------------------------------------------------------------------------------------------- labelName - { "ROAPError":"200", "ROAPErrorDetail":"OK", "data":{ "chtype":"terrestrial", "sourceIndex":"0", "physicalNum":"8", "major":"7", "displayMajor":"7", "minor":"0", "displayMinor":"-1", "chname":"S 09", "progName":[], "audioCh":"0", "inputSourceName":"Антенна", "inputSourceType":"0", "labelName":[], "inputSourceIdx":"0"}} { "ROAPError":"200", "ROAPErrorDetail":"OK", "data":{ "chtype":"cable", "sourceIndex":"3", "physicalNum":"63", "major":"7", "displayMajor":"7", "minor":"7", "displayMinor":"-1", "chname":"Россия-24", "progName":"Новости", "audioCh":"0", "inputSourceName":"Кабельное ТВ", "inputSourceType":"0", "labelName":[], "inputSourceIdx":"0" } } http://192.168.10.26/objects/?object=28LB491U-ZB_20&op=m&m=curChan --------------------------------------------------------------------------------------------------------*/
//$alias = $this->object_title; $aliases = $this->getProperty('aliases'); $val = $this->getProperty('setChan'); include_once(DIR_MODULES.'app_smarttv/app_smarttv.class.php'); $smartTv = new app_smarttv(); $smartTv->control($aliases,'setChan', $val); //- Переключает на канал = $val; //$smartTv->control($alias,'sendCode', $val); //- Отправляет команду $val;
//if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; //$prop = $params['PROPERTY']; //$old = $params['OLD_VALUE']; //$new = $params['NEW_VALUE']; //$oot = $params['ORIGINAL_OBJECT_TITLE']; $val = $params['VALUE']; // из MQTT if (!isset($params['VALUE'])) { // из ThisComputer -> onSwitch или из свойства $val = $params['NEW_VALUE']; // из ThisComputer->onSwitch } else { $val = $this->getProperty('sendCode'); } //$alias = $this->object_title; $alias = $this->getProperty('aliases'); $val = $this->getProperty('sendCode'); include_once(DIR_MODULES.'app_smarttv/app_smarttv.class.php'); $smartTv = new app_smarttv(); $smartTv->control($alias,'sendCode', $val); //- Отправляет команду $val; /* Код команды Описание команды 1 POWER 2 Number 0 3 Number 1 4 Number 2 5 Number 3 6 Number 4 7 Number 5 8 Number 6 9 Number 7 10 Number 8 11 Number 9 12 UP key among remote Controller’s 4 direction keys 13 DOWN key among remote Controller’s 4 direction keys 14 LEFT key among remote Controller’s 4 direction keys 15 RIGHT key among remote Controller’s 4 direction keys 20 OK 21 Home menu 22 Menu key (same with Home menu key) 23 Previous key (Back) 24 Volume up 25 Volume down 26 Mute (toggle) 27 Channel UP (+) 28 Channel DOWN (-) 29 Blue key of data broadcast 30 Green key of data broadcast 31 Red key of data broadcast 32 Yellow key of data broadcast 33 Play 34 Pause 35 Stop 36 Fast forward (FF) 37 Rewind (REW) 38 Skip Forward 39 Skip Backward 40 Record 41 Recording list 42 Repeat 43 Live TV 44 EPG 45 Current program information 46 Aspect ratio 47 External input 48 PIP secondary video 49 Show / Change subtitle 50 Program list 51 Tele Text 52 Mark 400 3D Video 401 3D L/R 402 Dash (-) 403 Previous channel (Flash back) 404 Favorite channel 405 Quick menu 406 Text Option 407 Audio Description 408 NetCast key (same with Home menu) 409 Energy saving 410 A/V mode 411 SIMPLINK 412 Exit 413 Reservation programs list 414 PIP channel UP 415 PIP channel DOWN 416 Switching between primary/secondary video 417 My Apps */
//$alias = $this->object_title; $aliases = $this->getProperty('aliases'); include_once(DIR_MODULES.'app_smarttv/app_smarttv.class.php'); $smartTv = new app_smarttv(); $image = ($smartTv->control($aliases,'getImg')); $path = ('./cms/cached/tv/tv.jpg'); /////cms/cached/tv/ //file_put_contents($path, file_get_contents($image)); SaveFile($path, $image); //echo 'Каналы - <img src="../cms/cached/tv/tv.jpg" alt="альтернативный текст"></br>'; //- Возвращает изображение с экрана в формате JPEG(960x540). //var_dump($img); $this->setProperty('img','.'.$path); // sg($ot.'.v',$ver);
//- Устанавливает громкость до уровня $val //if ($this->getProperty('online') == 1) { //$alias = $this->object_title; //$alias = '28LB491U-ZB_20'; include_once(DIR_MODULES.'app_smarttv/app_smarttv.class.php'); $smartTv = new app_smarttv(); $alias = $this->getProperty('aliases'); $val = $params['NEW_VALUE']; // $val = $this->getProperty('setVol'); $smartTv->control($alias,'setVol', $val); //Устанавливает громкость до уровня $val, для устройства с псевдонимом $alias; //} elseif ($this->getProperty('online') == 2) { // echo 'Не в сети <br>'; //} elseif ($this->getProperty('online') == 0) { // echo 'Не извесно <br>'; //}
Class objects:
Class methods:
//TuyaIR('bf46f187d985ea2bfbop6h', 'Название клавиши'); $dev_id = 'bf46f187d985ea2bfbop6h'; $id = $params['id']; TuyaIR($dev_id, $id);
Class objects:
Class properties:
Class methods:
$gps = $this->getProperty('HomeGPS'); $wifi = $this->getProperty('HomeWiFi'); if (!$gps && !$wifi) { $this->setProperty('alive','0'); $this->setProperty('NameColor','orange'); } else { $this->setProperty('alive','1'); $this->setProperty('NameColor','green'); } if ($wifi) { $this->setProperty('NetworkPic', 'wifi'); } else { $this->setProperty('NetworkPic', ''); } // Сброс присутствия //$ot=$this->object_title; //$alive_timeout = 30*60; //clearTimeOut($ot."_isHome"); //setTimeOut($ot."_isHome","sg('".$ot.".isHome',0);",$alive_timeout); // Сброс "nobodyHome", "непростые устройства" в Rooms ClearTimeOut("nobodyHome"); // Установка флага и проверка на $status //$status = $this->getProperty("isHome"); //if (!$status) { //$this->setProperty("isHome", 1); //} $last = $this->getProperty("isHomeTime"); $this->setProperty("isHomeTime", time()); $this->setProperty("isHomeUpdate", date("Y-m-d H:i",time()));
$charg = $this->getProperty('Charging'); $level = $this->getProperty('BattLevel'); if ($level > 88 && $level <= 100) { $this->setProperty("BattPic",'fa fa-battery-full'); $this->setProperty("BattColor",'green'); } else if ($level > 62 && $level <= 88) { $this->setProperty("BattPic",'fa fa-battery-three-quarters'); $this->setProperty("BattColor",'greenyellow'); } else if ($level > 37 && $level <= 62) { $this->setProperty("BattPic",'fa fa-battery-half'); $this->setProperty("BattColor",'yellow'); } else if ($level > 12 && $level <= 37) { $this->setProperty("BattPic",'fa fa-battery-quarter'); $this->setProperty("BattColor",'orange'); } else if ($level <= 12) { $this->setProperty("BattPic",'fa fa-battery-empty'); $this->setProperty("BattColor",'red'); } if ($charg == 1) { $this->setProperty("BattPic",'fa fa-plug'); } if (!$this->getProperty("Charging")) { if ($params['NEW_VALUE'] > 0 && $params['NEW_VALUE'] < 10 && $params['NEW_VALUE'] < $params['OLD_VALUE']) { // проверяем когда в последний раз срабатывало событие "Уведомиление о низком заряде батареи у пользователя" $last_register=registeredEventTime($this->object_title . 'LowBatteryNotification'); if ((time()-$last_register) > 1*60*60) { say('Заряд телефона у ' . mb_substr($this->getProperty("fullName"), 0, -1, 'UTF-8') . 'и ' . $params['NEW_VALUE'] . '%. Скоро выключиться.'); registerEvent($this->object_title . 'LowBatteryNotification', $this->name, 1); // регистрируем событие "Уведомиление о низком заряде батареи у пользователя" } } }
$this->setProperty('alive', 1); $ot = $this->object_title; // проверка заданно ли время жизни для объекта $alive_timeout = (int)$this->getProperty('aliveTimeOut'); if (!$alive_timeout) { $alive_timeout = 1*60*60; // если не было заданно, то берем 1 час } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive', 0);",$alive_timeout);
Class objects:
Class properties:
Class methods:
$ot = $this->object_title; //$desc = $this->description; //$mqtt_st = $this->getProperty('mqtt_status'); //$telegram_st = $this->getProperty('telegram_status'); //$registerEvent_st = $this->getProperty('registerEvent_status'); //$write_to_properties = $this->getProperty('write_to_properties'); //$ipter = 'http://192.168.8.129:2323'; //$passw = '197994'; $pass = $this->getProperty('passw'); $ipterm = 'http://'.$this->getProperty('ip4').':2323'; $getList = getURL($ipterm.'/?cmd=listSettings&password='.urlencode($pass).'&type=json'); //echo $getInfo; // здесь ответ от запроса к Fully в json //echo '<br>'; $state = json_decode($getList, true); //-------------------------------------------------------------------------print_r($array); //$mdmDisableVolumeButtons = $state['mdmDisableVolumeButtons']; // mdmDisableVolumeButtons: false, //---------------------------------------------------------------------------------------- //$this->setProperty('mdmDisableVolumeButtons', $mdmDisableVolumeButtons); /* { mdmDisableVolumeButtons: false, : "200", playMedia: true, actionBarFgColor: -1, deleteHistoryOnReload: true, wifiSSID: "dsys2", actionBarBgUrl: "", mdmApkToInstall: "", mdmDisableADB: false, movementWhenUnplugged: false, tabsBgColor: -2236963, errorUrlOnDisconnection: "0", screensaverBrightness: "10", showActionBar: false, mdmDisableScreenCapture: false, restartOnCrash: true, deleteWebstorageOnReload: true, kioskMode: true, showStatusBar: false, kioskWifiPinAction: "0", mqttBrokerUrl: "tcp://m2.wqtt.ru:8901", removeNavigationBar: false, kioskAppWhitelist: " com.thanksmister.iot.mqtt.alarmpanel com.android.chrome com.google.android.apps.nbu.files de.ozerov.fully ru.codedevice.iobrokerpawii ru.smartliving.majordroid in.dc297.mqttclpro", softKeyboard: true, kioskHomeStartURL: true, authPassword: "", launchOnBoot: true, knoxDisableUsbHostStorage: false, mdmPasswordQuality: "0", resendFormData: true, clearCacheEach: true, sleepOnPowerConnect: false, knoxDisableAirViewMode: false, pauseMotionInBackground: true, mqttBrokerPassword: "xbmc", rootEnable: true, resetZoomEach: true, showHomeButton: true, wifiMode: "1", motionCameraId: "", waitInternetOnReload: true, inUseWhileAnotherAppInForeground: false, geoLocationAccess: true, enableUrlOtherApps: true, showNavigationBar: false, timeToScreenOffV2: "1200", loadCurrentPageOnReload: false, lastVersionInfo: "1.36.1", loadOverview: false, remoteAdminScreenshot: true, screenOnOnMotion: true, useWideViewport: true, enableTapSound: true, clientCaPassword: "", forceScreenOrientation: "0", movementDetection: false, progressBarColor: -13611010, formAutoComplete: true, webHostFilter: false, advancedKioskProtection: false, swipeTabs: false, screensaverPlaylist: "", webcamAccess: true, screenBrightness: "255", urlWhitelist: "", enableQrScan: true, launcherInjectCode: "", timeToRegainFocus: "0", cloudService: false, initialScale: "90", kioskExitGesture: "2", motionDetection: true, resumeVideoAudio: true, inUseWhileKeyboardVisible: false, kioskPin: "", remoteAdminCamshot: true, bluetoothMode: "2", reloadOnScreensaverStop: false, forceSleepIfUnplugged: false, actionBarInSettings: false, timeToGoBackground: "0", enablePopups: true, actionBarQrScanButtonUrl: "", screensaverOtherApp: false, screensaverWallpaperURL: "fully://color#000000", recreateTabsOnReload: false, timeToClearSingleAppData: "0", mdmDisableKeyguard: false, knoxHideStatusBar: false, addressBarBgColor: -2236963, showAddressBar: false, remoteAdminLan: true, timeToShutdownOnPowerDisconnect: "0", knoxDisableTaskManager: false, knoxEnabled: false, reloadPageFailure: "0", cacheMode: "2", knoxDisableEdgeScreen: false, alarmSoundFileUrl: "", folderCleanupTime: "", disableOtherApps: false, mdmDisableSafeModeBoot: false, remoteAdminFileManagement: true, knoxDisableMtp: false, compassSensitivity: "50", textSelection: true, websiteIntegration: true, motionFps: "5", videoCaptureUploads: true, reloadOnInternet: false, enableLocalhost: true, statusBarColor: 0, usageStatistics: false, isRunning: true, fileUploads: true, singleAppMode: false, //--------------------------------------------------------------------------------------------------------- launcherApps: "[ { "label": "Alarm Panel", "component": "com.thanksmister.iot.mqtt.alarmpanel\/com.thanksmister.iot.mqtt.alarmpanel.ui.activities.MainActivity" }, { "label": "Chrome", "component": "com.android.chrome\/com.google.android.apps.chrome.Main" }, { "label": "Files", "component": "com.google.android.apps.nbu.files\/com.google.android.apps.nbu.files.home.HomeActivity" }, { "label": "FM-радио", "component": "com.android.fmradio\/com.android.fmradio.FmMainActivity" }, { "label": "Fully Kiosk Browser", "component": "de.ozerov.fully\/de.ozerov.fully.MainActivity" }, { "label": "ioBroker.PAW II", "component": "ru.codedevice.iobrokerpawii\/ru.codedevice.iobrokerpawii.SplashActivity" }, { "label": "MajorDroid", "component": "ru.smartliving.majordroid\/ru.smartliving.majordroid.MainActivity" }, { "label": "MQTT Clock", "component": "se.jplantin.jp.alarmclock\/se.jplantin.jp.alarmclock.ui.AlarmsActivity2" }, { "label": "Tasker", "component": "net.dinglisch.android.taskerm\/net.dinglisch.android.taskerm.Tasker" }, { "label": "YouTube", "component": "com.google.android.youtube\/com.google.android.youtube.app.honeycomb.Shell$HomeActivity" }, { "label": "Браузер", "component": "com.yandex.browser\/com.yandex.browser.YandexBrowserActivity" }, { "label": "Настройки", "component": "com.android.settings\/com.android.settings.Settings" }, { "label": "MajorDoMo", "url": "http:\/\/192.168.10.26\/popup\/scenes\/1.html", "iconUrl": "http:\/\/192.168.10.26\/favicon.ico" } ]", //--------------------------------------------------------------------------------------------- appLauncherBackgroundColor: -9145228, reloadEachSeconds: "0", forceImmersive: true, mdmSystemAppsToEnable: "", knoxDisableScreenCapture: false, removeStatusBar: false, knoxHideNavigationBar: false, mdmDisableStatusBar: false, folderCleanupList: "", kioskWifiPin: "", showShareButton: true, knoxDisableMultiUser: false, redirectBlocked: false, forceSwipeUnlock: true, jsAlerts: false, screensaverDaydream: false, mdmDisableUsbStorage: false, screensaverFullscreen: true, defaultWebviewBackgroundColor: -14079703, batteryWarning: "35", lockSafeMode: false, scrollingDragging: true, keepOnWhileFullscreen: true, graphicsAccelerationMode: "2", wifiKey: "Pavlik89217548469", reloadOnScreenOn: false, safeBrowsing: false, deleteCookiesOnReload: false, loadContentZipFileUrl: "", sleepOnPowerDisconnect: false, runInForeground: true, screenOnOnMovement: false, appLauncherScaling: "100", motionSensitivity: "90", knoxDisableHomeButton: false, inactiveTabsBgColor: -4144960, knoxDisableStatusBar: false, accelerometerSensitivity: "80", mqttBrokerUsername: "xbmc", remoteFileMode: "1", enableZoom: true, playerCacheImages: true, detectIBeacons: false, navigationBarColor: 0, mdmDisableAppsFromUnknownSources: false, mdmMinimumPasswordLength: "5", screensaverOtherAppIntent: "", clientCaUrl: "", deleteCacheOnReload: true, stopScreensaverOnMovement: false, knoxDisableOtaUpgrades: false, fontSize: "100", motionDetectionAcoustic: false, stopScreensaverOnMotion: true, audioRecordUploads: true, timeToClearLauncherAppData: "0", showAppLauncherOnStart: false, mdmAppLockTaskWhitelist: "", knoxDisableSafeMode: false, showRefreshButton: true, knoxDisableVolumeButtons: false, autoImportSettings: true, showForwardButton: true, appToRunOnStart: "", mqttEnabled: true, motionSensitivityAcoustic: "90", killAppsBeforeStartingList: "", keepSleepingIfUnplugged: false, userAgent: "0", injectJsCode: "", disableVolumeButtons: false, showNewTabButton: false, errorURL: "file:///sdcard/paw_2/www/index.php", authUsername: "", showBackButton: true, enableBackButton: true, ignoreSSLerrors: true, webviewDebugging: true, disableStatusBar: false, confirmExit: false, showProgressBar: true, knoxDisableRecentTaskButton: false, remotePdfFileMode: "0", singleAppIntent: "", urlBlacklist: "", remoteAdminPassword: "197994", setWifiWakelock: false, customUserAgent: "", screenOffInDarkness: false, ignoreJustOnceLauncher: true, actionBarCustomButtonUrl: "fully://launcher", mdmSystemUpdatePolicy: "0", enablePullToRefresh: false, touchInteraction: true, enableFullscreenVideos: true, localPdfFileMode: "0", showTabCloseButtons: false, showMenuHint: false, disableHomeButton: false, appLauncherTextColor: -1184275, touchesOtherAppsBreakIdle: false, movementBeaconList: "", mdmRuntimePermissionPolicy: "0", fadeInOutDuration: "200", thirdPartyCookies: false, showPrintButton: true, keepScreenOn: true, knoxDisableMultiWindowMode: false, volumeLicenseKey: "", actionBarBgColor: -15906911, disableCamera: false, showCamPreview: false, addXffHeader: true, tabsFgColor: -16777216, remoteAdmin: true, forceScreenUnlock: true, mdmAppsToDisable: "", enableVersionInfo: false, knoxDisableAirCommandMode: false, reloadOnWifiOn: false, sleepSchedule: "", rebootTime: "", actionBarTitle: "Fully Kiosk Browser", knoxDisableBackButton: false, actionBarIconUrl: "", timeToScreensaverV2: "0", kioskWifiPinCustomIntent: "", playAlarmSoundOnMovement: false, addRefererHeader: true, startURL: "http://192.168.10.26/popup/scenes/1.html", remoteAdminSingleAppExit: false, movementBeaconDistance: "5", disablePowerButton: false, showTabs: false, microphoneAccess: true, value: "5", pageTransitions: false, restartAfterUpdate: true, swipeNavigation: false, skipReloadIfStartUrlShowing: false, setRemoveSystemUI: false, ignoreMotionWhenMoving: false, searchProviderUrl: "https://www.google.com/search?q=", setCpuWakelock: true, playAlarmSoundUntilPin: false, knoxDisableCamera: false, desktopMode: false, cameraCaptureUploads: true, autoplayAudio: true, autoplayVideos: true, darknessLevel: "10", preventSleepWhileScreenOff: true, mdmLockTask: false, knoxDisablePowerButton: false, readNfcTag: false } */
//$ot = $this->object_title; //$desc = $this->description; //$mqtt_st = $this->getProperty('mqtt_status'); //$telegram_st = $this->getProperty('telegram_status'); //$registerEvent_st = $this->getProperty('registerEvent_status'); //$write_to_properties = $this->getProperty('write_to_properties'); //$ipter = 'http://192.168.8.129:2323'; //$passw = '197994'; $pass = $this->getProperty('passw'); $ipterm = 'http://'.$this->getProperty('ip4').':2323'; $getInfo = getURL($ipterm.'/?cmd=deviceInfo&password='.urlencode($pass).'&type=json'); //echo $getInfo; // здесь ответ от запроса к Fully в json //echo '<br>'; $state = json_decode($getInfo, true); //-------------------------------------------------------------------------print_r($array); $internalStorageFreeSpace = $state['internalStorageFreeSpace']; $deviceName = $state['deviceName']; $appVersionCode = $state['appVersionCode']; $appTotalMemory = $state['appTotalMemory']; $lastAppStart = $state['lastAppStart']; $locationAltitude = $state['locationAltitude']; $locationLongitude = $state['locationLongitude']; $wifiSignalLevel = $state['wifiSignalLevel']; $isScreenOn = $state['isScreenOn']; $currentFragment = $state['currentFragment']; $ramFreeMemory = $state['ramFreeMemory']; $kioskMode = $state['kioskMode']; $displayHeightPixels = $state['displayHeightPixels']; $appVersionName = $state['appVersionName']; $maintenanceMode = $state['maintenanceMode']; $externalStorageTotalSpace = $state['externalStorageTotalSpace']; $appFreeMemory = $state['appFreeMemory']; $internalStorageTotalSpace = $state['internalStorageTotalSpace']; $ramUsedMemory = $state['ramUsedMemory']; $foregroundApp = $state['foregroundApp']; $ssid = $state['ssid']; $mac = $state['mac']; $startUrl = $state['startUrl']; $screenOrientation = $state['screenOrientation']; $externalStorageFreeSpace = $state['externalStorageFreeSpace']; $isLicensed = $state['isLicensed']; $androidSdk = $state['androidSdk']; $deviceManufacturer = $state['deviceManufacturer']; $plugged = $state['plugged']; $keyguardLocked = $state['keyguardLocked']; $currentTabIndex = $state['currentTabIndex']; $isDeviceAdmin = $state['isDeviceAdmin']; $batteryLevel = $state['batteryLevel']; $appUsedMemory = $state['appUsedMemory']; $locationProvider = $state['locationProvider']; $locationLatitude = $state['locationLatitude']; $hostname6 = $state['hostname6']; $hostname4 = $state['hostname4']; $ramTotalMemory = $state['ramTotalMemory']; $kioskLocked = $state['kioskLocked']; $ip4 = $state['ip4']; $deviceID = $state['deviceID']; $isDeviceOwner = $state['isDeviceOwner']; $ip6 = $state['ip6']; $displayWidthPixels = $state['displayWidthPixels']; $androidVersion = $state['androidVersion']; $screenBrightness = $state['screenBrightness']; $webviewUa = $state['webviewUa']; $deviceModel = $state['deviceModel']; $currentPage = $state['currentPage']; $motionDetectorState = $state['motionDetectorState']; //------------------------------------------------------------------------- $this->setProperty('internalStorageFreeSpace', $internalStorageFreeSpace); $this->setProperty('deviceName', $deviceName); $this->setProperty('appVersionCode', $appVersionCode); $this->setProperty('appTotalMemory', $appTotalMemory); $this->setProperty('lastAppStart', $lastAppStart); $this->setProperty('locationAltitude', $locationAltitude); $this->setProperty('locationLongitude', $locationLongitude); $this->setProperty('wifiSignalLevel', $wifiSignalLevel); $this->setProperty('isScreenOn', $isScreenOn); $this->setProperty('currentFragment', $currentFragment); $this->setProperty('ramFreeMemory', $ramFreeMemory); $this->setProperty('kioskMode', $kioskMode); $this->setProperty('displayHeightPixels', $displayHeightPixels); $this->setProperty('appVersionName', $appVersionName); $this->setProperty('maintenanceMode', $maintenanceMode); $this->setProperty('externalStorageTotalSpace', $externalStorageTotalSpace); $this->setProperty('appFreeMemory', $appFreeMemory); $this->setProperty('internalStorageTotalSpace', $internalStorageTotalSpace); $this->setProperty('ramUsedMemory', $ramUsedMemory); $this->setProperty('foregroundApp', $foregroundApp); $this->setProperty('ssid', $ssid); $this->setProperty('mac', $mac); $this->setProperty('startUrl', $startUrl); $this->setProperty('screenOrientation', $screenOrientation); $this->setProperty('externalStorageFreeSpace', $externalStorageFreeSpace); $this->setProperty('isLicensed', $isLicensed); $this->setProperty('androidSdk', $androidSdk); $this->setProperty('deviceManufacturer', $deviceManufacturer); $this->setProperty('isPlugged', $plugged); $this->setProperty('keyguardLocked', $keyguardLocked); $this->setProperty('currentTabIndex', $currentTabIndex); $this->setProperty('isDeviceAdmin', $isDeviceAdmin); $this->setProperty('batteryLevel', $batteryLevel); $this->setProperty('appUsedMemory', $appUsedMemory); $this->setProperty('locationProvider', $locationProvider); $this->setProperty('locationLatitude', $locationLatitude); $this->setProperty('hostname6', $hostname6); $this->setProperty('hostname4', $hostname4); $this->setProperty('ramTotalMemory', $ramTotalMemory); $this->setProperty('kioskLocked', $kioskLocked); $this->setProperty('ip4', $ip4); $this->setProperty('deviceID', $deviceID); $this->setProperty('isDeviceOwner', $isDeviceOwner); $this->setProperty('ip6', $ip6); $this->setProperty('displayWidthPixels', $displayWidthPixels); $this->setProperty('androidVersion', $androidVersion); $this->setProperty('screenBrightness', $screenBrightness); $this->setProperty('webviewUa', $webviewUa); $this->setProperty('deviceModel', $deviceModel); $this->setProperty('currentPage', $currentPage); $this->setProperty('motionDetectorState', $motionDetectorState); //-------------------------------------------------------------------------
$cmd = $params['cmd']; $origot = $params['ORIGINAL_OBJECT_TITLE']; //http://192.168.10.26/objects/?object=MobileFKB01&op=m&m=getFully //------------------------------------------------------Нужно дописать логику-------------------------------------------------------- $ot = $this->object_title; /* $desc = $this->description; $mqtt_st = $this->getProperty('mqtt_status'); $telegram_st = $this->getProperty('telegram_status'); $registerEvent_st = $this->getProperty('registerEvent_status'); */ $pass = $this->getProperty('passw'); $ipterm = 'http://'.$this->getProperty('ip4').':2323'; switch ($cmd) { //---------------------------------------------------------------------------------------------------------------------------------------------------- case 'deviceInfo': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'setBooleanSetting': //say('Параметр set Boolean Setting найден',0); //$cmd = $params['cmd']; $key = $params['key']; // echo "Ключ = $key <br>"; $value = $params['value']; // echo "Значение = $value <br>"; true false $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&key='.$key.'&value='.$value.'&password='.$pass.'&type=json',0,'admin','197994'); break; //callmethodSafe('mobilefkb01.getfully_cmd',array('cmd'=>'setBooleanSetting', 'key'=>'kioskMode', 'value'=>'true',)); case 'setStringSetting': //say('Параметр set String Setting найден',0); //$cmd = $params['cmd'];// say($params['cmd'], 0); $key = $params['key']; // echo "Ключ = $key <br>"; $value = $params['value']; // echo "Значение = $value <br>"; $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&key='.$key.'&value='.$value.'&password='.$pass.'&type=json',0); break; //callmethodSafe('mobilefkb01.getfully_cmd',array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'150',)); //callMethod('mobilefkb01.getfully_cmd',array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'150',)); //cm('mobilefkb01.getfully_cmd',array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'150',)); case 'textToSpeech': //say('Параметр text To Speech найден',0); $text = $params['text']; // текст [text] $locale = $params['locale']; // ru_RU de en_GB fr [locale] $engine = $params['engine']; // движок [engine] $queue = $params['queue']; // в очередь [0|1] ver. 1.38+ $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&text='.urlencode($text).'&locale='.$locale.'&password='.$pass.'&type=json'); break; // http://192.168.10.26/objects/?script=getFully&cmd=textToSpeech&text=много_много_воды_утекло&locale=ru case 'stopTextToSpeech': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; // ver. 1.38+ case 'setOverlayMessage': //say('Параметр set Overlay Message найден', 0); $text = $params['text']; // echo "Ключ = $text <br>"; $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&text='.urlencode($text).'&password='.$pass.'&type=json'); break; // http://192.168.10.26/objects/?script=getFully&cmd=setOverlayMessage&text=много_много_воды_утекло case 'setAudioVolume': //say('Параметр set Audio Volume найден', 0); $level = 50; //установим громкость 50 по умолчанию $stream = 3; //установим канал 3 по умолчанию if($params['level']) $level = $params['level']; if($params['stream']) $stream = $params['stream']; // $level = $params['level']; // level=[0-100] Уровень громкости // $stream = $params['stream']; // stream=[0-6 и 8-10] Канал // stream: 0–Voice Call, 1–System, 2–Ring, 3–Music, 4–Alarm, 5–Notification, 6–Bluetooth, 8–DTMF, 9–TTS, 10–Accessibility $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&level='.$level.'&stream='.$stream.'&password='.$pass.'&type=json'); break; //http://192.168.10.26/objects/?script=getFully&cmd=setAudioVolume&level=100&stream=3 case 'playSound': //say('Параметр play Sound найден', 0); $url = $params['url']; // [url] https://youtu.be/uJMFUJ1L4Tw $stream = $params['stream']; // stream=[1-6 и 10] Канал $loop = $params['loop']; // [0|1] [true|false] $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&url='.$url.'&stream='.$stream.'&loop='.$loop.'&password='.$pass.'&type=json'); break; //http://192.168.10.26/objects/?script=getFully&cmd=playSound&url=http://192.168.10.26/cms/sounds/10h.mp3&stream=3&loop=false case 'stopSound': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'playVideo': //say('Параметр play Video найден', 0); $url = $params['url']; // [url] https://youtu.be/uJMFUJ1L4Tw xxx.flv $loop = $params['loop']; // [0|1] $showControls = $params['showControls']; // [0|1] $exitOnTouch = $params['exitOnTouch']; // [0-1] $exitOnCompletion = $params['exitOnCompletion']; // [0-1] $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&url='.$url.'&loop='.$loop.'&showControls='.$showControls.'&exitOnTouch='.$exitOnTouch.'&exitOnCompletion='.$exitOnCompletion.'&password='.$pass.'&type=json'); break; //http://192.168.10.26/objects/?script=getFully&cmd=playVideo&url=http://192.168.10.26/cms/sounds/xxx.flv&loop=0&showControls=0&exitOnTouch=0&exitOnCompletion=0 case 'stopVideo': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; // ver. 1.42+ case 'focusTab': say('Параметр focus Tab найден', 0); $tab = $params['tab']; // echo "Ключ = $tab <br>"; $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&tab='.$tab.'&password='.$pass.'&type=json'); break; //http://192.168.10.26/objects/?script=getFully&cmd=focusTab&tab=[index] case 'closeTab': say('Параметр close Tab найден', 0); $tab = $params['tab']; // echo "Ключ = $tab <br>"; $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&tab='.$tab.'&password='.$pass.'&type=json'); break; //http://192.168.10.26/objects/?script=getFully&cmd=closeTab&tab=[index] case 'startApplication': say('Параметр start Application найден', 0); $package = $params['package']; // echo "Ключ = $package <br>"; $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&package='.$package.'&password='.$pass.'&type=json'); break; //http://192.168.10.26/objects/?script=getFully&cmd=startApplication&package=[pkg] case 'loadApkFile': say('Параметр load Apk File найден', 0); $url = $params['url']; // echo "Ключ = $url <br>"; // [url] https://youtu.be/uJMFUJ1L4Tw $forceInstall = $params['forceInstall']; // echo "Ключ = $forceInstall <br>"; // [true|false] $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&url='.$url.'&forceInstall='.$forceInstall.'&password='.$pass.'&type=json'); break; //http://192.168.10.26/objects/?script=getFully&cmd=loadApkFile&url=[url]&forceInstall=true case 'loadUrl': //say('Параметр load Url найден', 0); $url = $params['url']; // [url] http://192.168.10.26/3rdparty/kalcaddle/ // $tab = 0; // [0..n] установим по умолчанию // $newtab = false; // [true|false] установим по умолчанию // $focus = false; // [0|1] [true|false] установим по умолчанию // if($params['tab']) $tab = $params['tab']; // if($params['newtab']) $newtab = $params['newtab']; // if($params['focus']) $focus = $params['focus']; $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&url='.urlencode($url).'&password='.$pass.'&type=json'); break; //http://192.168.10.26/objects/?script=getFully&cmd=loadUrl&url=https://www.ab-log.ru/forum/viewtopic.php?f=1&t=1328&start=1880 //http://192.168.10.26/objects/?script=getFully&cmd=loadUrl&url=http://192.168.10.26/3rdparty/kalcaddle/ //http://192.168.10.26/objects/?script=getFully&cmd=loadUrl&url=[url]&tab=[0..n]&focus=[true|false] //http://192.168.10.26/objects/?script=getFully&cmd=loadUrl&url=[url]&newtab=[true|false]&focus=[true|false] case 'screenOn': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); say($cmd, 0); break; //http://192.168.10.26/objects/?script=getFully&cmd=screenOn //http://192.168.10.26/objects/?object=MobileFKB01&op=m&m=getFully&cmd=screenOff case 'screenOff': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'forceSleep': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'triggerMotion': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'loadStartUrl': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'refreshTab': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; // (ver. 1.45+) case 'clearCache': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'clearWebstorage': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'clearCookies': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; // (ver. 1.28+) case 'startScreensaver': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'stopScreensaver': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'startDaydream': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'stopDaydream': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'lockKiosk': //$cmd = $params['cmd']; say($cmd, 0); // echo "Ключ = $key <br>"; $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); $info = json_decode($getInfo, true); if($info['status'] == 'OK') { DebMes('Успешно - cmd-> '.$params['cmd'].' ->ot-> '.$ot.' ->ort-> '.$origot); } else { DebMes('Ошибка - cmd-> '.$params['cmd'].' ->ot-> '.$ot.' ->ort-> '.$origot); return; } break; case 'unlockKiosk': //$cmd = $params['cmd']; say($cmd, 0); // echo "Ключ = $key <br>"; $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); $info = json_decode($getInfo, true); if($info['status'] == 'OK') { DebMes('Успешно - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); } else { DebMes('Ошибка - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); return; } break; case 'toForeground': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'toBackground': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'restartApp': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'exitApp': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'popFragment': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'enableLockedMode': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'disableLockedMode': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'shutdownDevice': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; //root case 'rebootDevice': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; //root case 'loadStatsCSV': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; case 'getScreenshot': $getScreen = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass); break; case 'getCamshot': $getCam = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass); break; case 'listSettings': $getInfo = getURL($ipterm.'/?cmd='.$cmd.'&password='.$pass.'&type=json'); break; } $json = json_decode($getInfo, true); $i = $json['statustext']; $s = $json['status']; //$i = $state['event'].' -- '.$ot; getURL($ipterm.'/?cmd=textToSpeech&text='.urlencode($i.' - '.$s).'&locale=en_GB&password='.urlencode($pass)); getURL($ipterm.'/?cmd=setOverlayMessage&text='.urlencode($i.' - '.$s).'&password='.urlencode($pass)); //DebMes('Принято '.$ipterm.' сообщение - '.$i.' для '.$pass.' устройства '.$ot); //say('Принято сообщение - '.$i.' для устройства '.$ot,0);
//$this->result = array('status' => 'ok', 'timestamp' => time()); //$ot = $this->object_title; //$desc = $this->description; //$record_switch=$this->getProperty('record_switch'); //вкл/выкл запись на камере //$linked_room=$this->getProperty('linkedRoom'); //$status = $this->getProperty('status'); //$mqtt_st = $this->getProperty('mqtt_status'); //$telegram_st = $this->getProperty('telegram_status'); //$registerEvent_st = $this->getProperty('registerEvent_status'); $mqtt_write_to_prop = $this->getProperty('mqttWriteToProperties'); $get_write_to_prop = $this->getProperty('getWriteToProperties'); $mqtt_write_to_geoloc = $this->getProperty('getWriteToGeolocation'); // //if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; $message = $params['VALUE']; // Принимаем данные //$this->setProperty('message',$message); // Записываем сырые данные в свойство $state = json_decode($message, true); // Декодируем в массив //------------------- Раскладываем данные по переменным //$batteryLevel = $state['batteryLevel']; $isplugged = $state['isPlugged']; $ssid = $state['SSID']; $ip4 = $state['ip4']; $screenorientation = $state['screenOrientation']; $screenbrightness = $state['screenBrightness']; $screenlocked = $state['screenLocked']; $screenon = $state['screenOn']; $motiondetectorstatus = $state['motionDetectorStatus']; $intstoragefreespace = $state['internalStorageFreeSpace']; $intstoragetotalspace = $state['internalStorageTotalSpace']; $ramfreememory = $state['ramFreeMemory']; $ramtotalmemory = $state['ramTotalMemory']; $appfreememory = $state['appFreeMemory']; $apptotalmemory = $state['appTotalMemory']; $appstarttime = $state['appStartTime']; $kioskmode = $state['kioskMode']; $currentpageurl = $state['currentPageUrl']; //---------------------- Записываем данные в свойства //$this->setProperty('batteryLevel',$batteryLevel); $this->setProperty('isPlugged',$isplugged); $this->setProperty('ssid',$ssid); $this->setProperty('ip4',$ip4); $this->setProperty('screenOrientation',$screenorientation); $this->setProperty('screenBrightness',$screenbrightness); $this->setProperty('screenLocked',$screenlocked); $this->setProperty('isScreenOn',$screenon); $this->setProperty('motionDetectorState',$motiondetectorstatus); $this->setProperty('internalStorageFreeSpace',$intstoragefreespace); $this->setProperty('internalStorageTotalSpace',$intstoragetotalspace); $this->setProperty('ramFreeMemory',$ramfreememory); $this->setProperty('ramTotalMemory',$ramtotalmemory); $this->setProperty('appFreeMemory',$appfreememory); $this->setProperty('appTotalMemory',$apptotalmemory); $this->setProperty('appStartTime',$appstarttime); $this->setProperty('kioskMode', $kioskmode); $this->setProperty('currentPage',$currentpageurl); if ($mqtt_write_to_geoloc) { //$altitude = $state['altitude']; //$longitude = $state['longitude']; //$latitude = $state['latitude']; //----------------------------------------------------- $this->setProperty('altitude', $state['altitude']); $this->setProperty('longitude', $state['longitude']); $this->setProperty('latitude', $state['latitude']); } if ($mqtt_write_to_prop) { //---------------------------------------------------------------- Раскладываем доп. данные по переменным $deviceid = $state['deviceId']; $mac = $state['Mac']; $ip6 = $state['ip6']; $host = $state['host']; $foreground = $state['foreground']; $locale = $state['locale']; $serial = $state['serial']; $version = $state['version']; $versioncode = $state['versionCode']; $build = $state['build']; $model = $state['model']; $manufacturer = $state['manufacturer']; $androidversion = $state['androidVersion']; $sdk = $state['SDK']; $webviewua = $state['webviewUA']; $isdeviceowner = $state['isDeviceOwner']; $topfragmenttag = $state['topFragmentTag']; $isrooted = $state['isRooted']; $islicensed = $state['isLicensed']; $isinforcedsleep = $state['isInForcedSleep']; $maintenancemode = $state['maintenanceMode']; $indaydream = $state['inDaydream']; //---------------------------------------------------- Записываем доп. данные в свойства $this->setProperty('v',$ver); // sg($ot.'.v',$ver); //$this->setProperty('alarm',intval($alarm)); //$this->setProperty('time',date('H:i:s d-m-Y', $time)); $this->setProperty('deviceId',$deviceid); $this->setProperty('mac',$mac); $this->setProperty('ip6',$ip6); $this->setProperty('host',$host); $this->setProperty('foreground',$foreground); $this->setProperty('locale',$locale); $this->setProperty('serial',$serial); $this->setProperty('version',$version); $this->setProperty('versionCode',$versioncode); $this->setProperty('build',$build); $this->setProperty('model',$model); $this->setProperty('deviceManufacturer',$manufacturer); $this->setProperty('androidVersion',$androidversion); $this->setProperty('SDK',$sdk); $this->setProperty('webviewUA',$webviewua); $this->setProperty('isDeviceOwner',$isdeviceowner); $this->setProperty('topFragmentTag',$topfragmenttag); $this->setProperty('isRooted',$isrooted); $this->setProperty('isLicensed',$islicensed); $this->setProperty('isInForcedSleep',$isinforcedsleep); $this->setProperty('maintenanceMode',$maintenancemode); $this->setProperty('inDaydream',$indaydream); } /* -------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------- */ // -------------------------------------------------------------------------------------------------------------------- if ($get_write_to_prop) { $pass = $this->getProperty('passw'); $ipterm = 'http://'.$this->getProperty('ip4').':2323'; $getInfo = getURL($ipterm.'/?cmd=deviceInfo&password='.urlencode($pass).'&type=json'); $state = json_decode($getInfo, true); //-------------------------------------------------------------------------print_r($array); $internalStorageFreeSpace = $state['internalStorageFreeSpace']; $deviceName = $state['deviceName']; $appVersionCode = $state['appVersionCode']; $appTotalMemory = $state['appTotalMemory']; $lastAppStart = $state['lastAppStart']; $locationAltitude = $state['locationAltitude']; $locationLongitude = $state['locationLongitude']; $wifiSignalLevel = $state['wifiSignalLevel']; $isScreenOn = $state['isScreenOn']; $currentFragment = $state['currentFragment']; $ramFreeMemory = $state['ramFreeMemory']; $kioskMode = $state['kioskMode']; $displayHeightPixels = $state['displayHeightPixels']; $appVersionName = $state['appVersionName']; $maintenanceMode = $state['maintenanceMode']; $externalStorageTotalSpace = $state['externalStorageTotalSpace']; $appFreeMemory = $state['appFreeMemory']; $internalStorageTotalSpace = $state['internalStorageTotalSpace']; $ramUsedMemory = $state['ramUsedMemory']; $foregroundApp = $state['foregroundApp']; $ssid = $state['ssid']; $mac = $state['mac']; $startUrl = $state['startUrl']; $screenOrientation = $state['screenOrientation']; $externalStorageFreeSpace = $state['externalStorageFreeSpace']; $isLicensed = $state['isLicensed']; $androidSdk = $state['androidSdk']; $deviceManufacturer = $state['deviceManufacturer']; $plugged = $state['plugged']; $keyguardLocked = $state['keyguardLocked']; $currentTabIndex = $state['currentTabIndex']; $isDeviceAdmin = $state['isDeviceAdmin']; $batteryLevel = $state['batteryLevel']; $appUsedMemory = $state['appUsedMemory']; $locationProvider = $state['locationProvider']; $locationLatitude = $state['locationLatitude']; $hostname6 = $state['hostname6']; $hostname4 = $state['hostname4']; $ramTotalMemory = $state['ramTotalMemory']; $kioskLocked = $state['kioskLocked']; $ip4 = $state['ip4']; $deviceID = $state['deviceID']; $isDeviceOwner = $state['isDeviceOwner']; $ip6 = $state['ip6']; $displayWidthPixels = $state['displayWidthPixels']; $androidVersion = $state['androidVersion']; $screenBrightness = $state['screenBrightness']; $webviewUa = $state['webviewUa']; $deviceModel = $state['deviceModel']; $currentpageurl = $state['currentPageUrl']; $currentPage = $state['currentPage']; $motionDetectorState = $state['motionDetectorState']; //------------------------------------------------------------------------- $this->setProperty('internalStorageFreeSpace', $internalStorageFreeSpace); $this->setProperty('deviceName', $deviceName); $this->setProperty('appVersionCode', $appVersionCode); $this->setProperty('appTotalMemory', $appTotalMemory); $this->setProperty('lastAppStart', $lastAppStart); $this->setProperty('locationAltitude', $locationAltitude); $this->setProperty('locationLongitude', $locationLongitude); $this->setProperty('wifiSignalLevel', $wifiSignalLevel); $this->setProperty('isScreenOn', $isScreenOn); $this->setProperty('currentFragment', $currentFragment); $this->setProperty('ramFreeMemory', $ramFreeMemory); $this->setProperty('kioskMode', $kioskMode); $this->setProperty('displayHeightPixels', $displayHeightPixels); $this->setProperty('appVersionName', $appVersionName); $this->setProperty('maintenanceMode', $maintenanceMode); $this->setProperty('externalStorageTotalSpace', $externalStorageTotalSpace); $this->setProperty('appFreeMemory', $appFreeMemory); $this->setProperty('internalStorageTotalSpace', $internalStorageTotalSpace); $this->setProperty('ramUsedMemory', $ramUsedMemory); $this->setProperty('foregroundApp', $foregroundApp); $this->setProperty('ssid', $ssid); $this->setProperty('mac', $mac); $this->setProperty('startUrl', $startUrl); $this->setProperty('screenOrientation', $screenOrientation); $this->setProperty('externalStorageFreeSpace', $externalStorageFreeSpace); $this->setProperty('isLicensed', $isLicensed); $this->setProperty('androidSdk', $androidSdk); $this->setProperty('deviceManufacturer', $deviceManufacturer); $this->setProperty('isPlugged', $plugged); $this->setProperty('keyguardLocked', $keyguardLocked); $this->setProperty('currentTabIndex', $currentTabIndex); $this->setProperty('isDeviceAdmin', $isDeviceAdmin); $this->setProperty('batteryLevel', $batteryLevel); $this->setProperty('appUsedMemory', $appUsedMemory); $this->setProperty('locationProvider', $locationProvider); $this->setProperty('locationLatitude', $locationLatitude); $this->setProperty('hostname6', $hostname6); $this->setProperty('hostname4', $hostname4); $this->setProperty('ramTotalMemory', $ramTotalMemory); $this->setProperty('kioskLocked', $kioskLocked); $this->setProperty('ip4', $ip4); $this->setProperty('deviceID', $deviceID); $this->setProperty('isDeviceOwner', $isDeviceOwner); $this->setProperty('ip6', $ip6); $this->setProperty('displayWidthPixels', $displayWidthPixels); $this->setProperty('androidVersion', $androidVersion); $this->setProperty('screenBrightness', $screenBrightness); $this->setProperty('webviewUa', $webviewUa); $this->setProperty('deviceModel', $deviceModel); $this->setProperty('currentPageUrl',$currentpageurl); $this->setProperty('currentPage',$currentPage); $this->setProperty('motionDetectorState', $motionDetectorState); } //-------------------------------------------------------------------------
if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; //if (!isset($params['cmd'])) { $cmd = $params['PROPERTY']; } else { $cmd = $params['cmd']; } $prop = $params['PROPERTY']; $oldv = $params['OLD_VALUE']; $new = $params['NEW_VALUE']; $origot = $params['ORIGINAL_OBJECT_TITLE']; //$cmd = $params['cmd']; //http://192.168.10.26/objects/?object=MobileFKB01&op=m&m=getFully $ot = $this->object_title; /* //$desc = $this->description; //$mqtt_st = $this->getProperty('mqtt_status'); //$telegram_st = $this->getProperty('telegram_status'); //$registerEvent_st = $this->getProperty('registerEvent_status'); //$write_to_properties = $this->getProperty('write_to_properties'); //$ipter = 'http://192.168.8.129:2323'; //$passw = '197994'; //$passw = getProperty($params['ORIGINAL_OBJECT_TITLE'].'.passw'); //$iptermw = 'http://'.getProperty($params['ORIGINAL_OBJECT_TITLE'].'.ip4').':2323'; */ $pass = $this->getProperty('passw'); $ipterm = 'http://'.$this->getProperty('ip4').':2323'; //Логика для кастомных команд switch ($prop) { case 'customCMD': //say('Параметр set Boolean Setting найден',0);// timeToScreenOff timeToScreenOffV2 $prop = $params['NEW_VALUE']; // echo "Ключ = $key <br>"; DebMes('Принято '.$prop.' сооб '.$ipterm.' щение - '.$new.' для '.$pass.' устройства '.$origot); $getInfo = getURL($ipterm.'/?cmd='.$prop.'&password='.$pass.'&type=json',0); break; case 'screenBrightness': //say('Параметр screen Brightness найден',0); $key = $params['PROPERTY']; // echo "Ключ = $key <br>"; $value = $params['NEW_VALUE']; // echo "Параметр = $value <br>"; if($value >= '1' && $value <= '255') { $getInfo = getURL($ipterm.'/?cmd=setStringSetting&key='.$key.'&value='.$value.'&password='.$pass.'&type=json',0); } $info = json_decode($getInfo, true); if($info['status'] == 'OK') { DebMes('Успешно - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); } else { DebMes('Ошибка - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); return; } break; case 'setVolume': //say('Параметр setVolume найден',0); //$key = $params['PROPERTY']; echo "Ключ = $key <br>"; $value = $params['NEW_VALUE']; // echo "Параметр = $value <br>"; $stream = '3'; $newVal = (int) strip_tags($value); if($newVal > 100) $newVal = 100; if($newVal < 0) $newVal = 0; //if($value != $newVal) { $getInfo = getURL($ipterm.'/?cmd=setAudioVolume&level='.$newVal.'&stream='.$stream.'&password='.$pass.'&type=json',0);// } $info = json_decode($getInfo, true); if($info['status'] == 'OK') { DebMes('Успешно - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); } else { DebMes('Ошибка - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); return; } break; case 'text-to-speech': //say('Параметр text to speech найден',0); //$key = $params['PROPERTY']; // echo "Ключ = $key <br>"; $value = $params['NEW_VALUE']; // echo "Параметр = $value <br>"; $newVal = strip_tags($value); //if($value != $newVal) { $getInfo = getURL($ipterm.'/?cmd=textToSpeech&text='.urlencode($newVal).'&locale=ru&password='.$pass.'&type=json',0);//} $info = json_decode($getInfo, true); if($info['status'] == 'OK') { DebMes('Успешно - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); } else { DebMes('Ошибка - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); return; } break; case 'currentPageNew': //say('Параметр current Page найден',0); // Логика для отправки перейти на страницу ----------------------------------------------------- //$key = $params['PROPERTY']; // echo "Ключ = $key <br>"; $value = $params['NEW_VALUE']; // echo "Параметр = $value <br>"; $newVal = strip_tags($value); //if($value != $newVal) { $getInfo = getURL($ipterm.'/?cmd=loadUrl&url='.$newVal.'&password='.$pass.'&type=json',0); //} $info = json_decode($getInfo, true); if($info['status'] == 'OK') { DebMes('Успешно - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); } else { DebMes('Ошибка - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); return; } break; case 'timeToScreenOff': //say('Параметр time To Screen Off найден',0); // Логика для отправки временем работы экрана -------------------------------------------------- //$key = $params['PROPERTY']; // echo "Ключ = $key <br>"; $value = $params['NEW_VALUE']; // echo "Параметр = $value <br>"; $newVal = (int) strip_tags($value); //if($value != $newVal) { $getInfo = getURL($ipterm.'/?cmd=setStringSetting&key=timeToScreenOffV2&value='.$newVal.'&password='.$pass.'&type=json',0); //} $info = json_decode($getInfo, true); if($info['status'] == 'OK') { DebMes('Успешно - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); } else { DebMes('Ошибка - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); return; } break; case 'kioskModeNew': //say('Параметр time To Screen Off найден',0); // Логика для управлением режимом КИОСК -------------------------------------------------- //$key = $params['PROPERTY']; // echo "Ключ = $key <br>"; $value = $params['NEW_VALUE']; // echo "Параметр = $value <br>"; if($value == '1') { $getInfo = getURL($ipterm.'/?cmd=lockKiosk&password='.$pass.'&type=json',0); } else if($value == '0') { $getInfo = getURL($ipterm.'/?cmd=unlockKiosk&password='.$pass.'&type=json',0); } $info = json_decode($getInfo, true); if($info['status'] == 'OK') { DebMes('Успешно - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); } else { DebMes('Ошибка - old_val-> '.$params['OLD_VALUE'].' ->new_val-> '.$params['NEW_VALUE'].' -> '.$origot); return; } break; default: //$getInfo = getURL($ipterm.'/?cmd=deviceInfo&password='.$pass.'&type=json'); break; } $json = json_decode($getInfo, true); $i = $json['statustext']; $s = $json['status']; //$i = $state['event'].' -- '.$ot; //getURL($ipterm.'/?cmd=textToSpeech&text='.urlencode($i.' '.$s).'&locale=de&password='.urlencode($pass)); getURL($ipterm.'/?cmd=setOverlayMessage&text='.urlencode($i.' - '.$s).'&password='.urlencode($pass)); //DebMes('Принято '.$ipterm.' сообщение - '.$i.' - '.$s.' для '.$pass.' устройства '.$ot); //say('Принято сообщение - '.$i.' для устройства '.$ot,0);
//include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); // $mqtt = new mqtt(); // $path = 'fully/event/#'; // $rezult = $mqtt->processMessage($path, true); //true false //$res = array('status' => ' от', 'date' => date('Y/m/d H:i:s', time())); //DebMes('Есть сообщение - '.$rezult.' - '.$params['VALUE'] .$res['status'].' - '.$res['date']); $desc = $this->description; $msl = $this->getProperty('minMsgLevel'); //sayTo('Есть сообщение - '.$rezult.' - '.$params['VALUE'], $msl, $desc); //sayReply('Есть - сообщение - '.$rezult.' - '.$params['VALUE'], $msl); //say('Есть - сообщение - '.$rezult.' - '.$params['VALUE'], $msl, 6); //sayTo("фраза",2,несуществующий терминал); //На терминале установить в конце обработчика ?terminal=P11moon //sg('minMsgLevel','1'); //Уровень сообщений системы //if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; $state = json_decode($params['VALUE'], true); if(!isset($state['deviceId'])) { $msl = $this->getProperty('minMsgLevel'); $res = array('status' => ' от', 'date' => date('Y/m/d H:i:s', time())); say('Не понятно для кого сообщение - '.$state['deviceId'], $msl, 6); DebMes('Не понятно для кого сообщение - '.$state['deviceId'].' - '.$params['VALUE'] .$res['status'].' - '.$res['date']); } else { $ot = $this->object_title; $devid = $this->getProperty('deviceID'); if($state['deviceId'] == $devid) { //$state = $params['event']; //if($params['VALUE']) say('Принято сообщение VALUE',100); //if($params['OLD_VALUE']) say('Принято сообщение OLD_VALUE',100); //if($params['NEW_VALUE']) say('Принято сообщение NEW_VALUE',100); //if($state['deviceId']) say('Принято сообщение от - '.$state['deviceId'],100); switch ($state['event']) { case 'onMotion': $this->callmethodSafe('motionDetected'); //DebMes('Обнаружено движение '.$ot); //say('Обнаружено движение '.$ot,0); //sayTo('Есть сообщение - '.$rezult.' - '.$params['VALUE'], $msl, $desc); //sayReply('Есть - сообщение - '.$rezult.' - '.$params['VALUE'], $msl); //say('Есть - сообщение - '.$rezult.' - '.$params['VALUE'], $msl, 6); //$command='Сколько время'; //callMethod('ThisComputer.commandReceived',array('command'=>$command)); break; case 'onBatteryLevelChanged': //$this->callMethodSafe('logicAction'); $this->setProperty('batteryLevel',$state['level']); if($state['level'] < 15 && (time() - registeredEventTime('P11Fully/lowPower') > 5*60)){ say("Планшет P11 Fully почти разряжен ! ", 2); registerEvent('P11Fully/lowPower', array('level'=>$state['level'])); } if($state['level'] > 99 && (time() - registeredEventTime('P11Fully/FullCharge') > 20*60)){ say("Планшет P11 Fully заряжен ! ", 2); registerEvent('P11Fully/FullCharge', array('level'=>$state['level'])); } $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - '.$state['level'].'% - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - '.$state['level'].'% - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //registerError('P11Fully/Charge', 'Уровень заряда изменился. - '.$state['level'].'% - '.$ot); registerEvent('P11Fully/Charge', array('level'=>$state['level'])); //DebMes('Уровень заряда изменился - '.$state['level'].'% - '.$ot); //say('Уровень заряда изменился. - '.$state['level'].'% - '.$ot,0); say('Уровень заряда изменился - '.$state['level'].'%',0); break; case 'unplugged': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //registerError('Отключена зарядка', 'Внешнее питание отключено'); //DebMes('Отключена зарядка ' .$ot); say('Отключена зарядка ',0); break; case 'pluggedAC': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //DebMes('Подключена зарядка к розетке ' .$ot); say('Подключена зарядка к розетке ',0); break; case 'pluggedUSB': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //DebMes('Подключена зарядка к USB ' .$ot); say('Подключена зарядка к USB ' .$ot,0); break; case 'powerOff': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //DebMes('Подключена зарядка к розетке ' .$ot); say('Внешнее питание отключено ', 0, $desc); break; case 'powerOn': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //DebMes('Подключена зарядка к розетке ' .$ot); say('Внешнее питание подключено ', 0); break; case 'screenOff': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //DebMes('Подключена зарядка к розетке ' .$ot); sayTo('Дисплей выключен ', 0, $desc); break; case 'screenOn': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //DebMes('Подключена зарядка к розетке ' .$ot); sayTo('Дисплей включен ', 0, $desc); break; case 'volumeUp': say('Уровень звука увеличен ' .$ot, 0); break; case 'volumeDown': say('Уровень звука уменьшен ' .$ot, 0); break; case 'hideKeyboard': say('Клавиатура скрыта ', 0); break; case 'showKeyboard': say('Клавиатура открыта ', 0); break; case 'onScreensaverStart': say('Скринсейвер запущен ' .$ot, 0); break; case 'onScreensaverStop': say('Скринсейвер остановлен ' .$ot, 0); break; case 'mqttDisconnected': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //say('Брокер эм-кйу-тэ-тэ Отключён ' .$ot, 0); break; case 'mqttConnected': //$this->callMethodSafe('logicAction'); //$this->setProperty('batteryLevel',$state['level']); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); //say('Брокер эм-кйу-тэ-тэ Подключён ' .$ot,0); break; case 'internetReconnect': //say('Переподключение к интернету ' .$ot, 0); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); break; case 'internetDisconnect': say('Нет связи с интернетом ' .$ot, 0); $this->result = array('status' => 'пртнято', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); //say('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date'],100); break; default: //say('Сообщение не распознано', 0); //time() //date('m/d/Y h:i:s a', time()) $msl = $this->getProperty('minMsgLevel'); $this->result = array('status' => 'не распознано', 'date' => date('Y/m/d H:i:s', time())); DebMes('Сообщение - '.$state['event'].' - от - '.$state['deviceId'].' - '.$this->result['status'].' - '.$this->result['date']); say('Сообщение не распознано - '.$state['event'].' от - '.$state['deviceId'].' - '.$this->result['status'].' - в - '.$this->result['date'], $msl); break; } //$passw = $this->getProperty('passw'); //$ipterm = 'http://'.$this->getProperty('ip4').':2323'; //$i = $state['event'].' -- '.$ot; //getURL($ipterm.'/?cmd=textToSpeech&text='.urlencode($i).'&locale=de&password='.urlencode($passw)); //getURL($ipterm.'/?cmd=setOverlayMessage&text='.urlencode($i).'&password='.urlencode($passw)); //DebMes('Принято '.$ipterm.' сообщение - '.$state['event'].' для '.$pass.' устройства '.$ot); //say('Принято сообщение - '.$state['event'].' для устройства '.$ot,0); //$this->result = array('status' => 'принято', 'date' => date('Y/m/d H:i:s', time())); //say('Сообщение - '.$state['event'].' - '.$this->result['status'].' - '.$this->result['date'],100); } }
$message = $params['VALUE']; // Принимаем данные //echo '</br>-------------------------'.$params['VALUE']; $this->setProperty('message',$message); // Записываем сырые данные в свойство //$message = $this->getProperty('message'); // Записываем сырые данные в свойство $state = json_decode($message, true); // Декодируем в массив //echo '</br>-----------'.$state; /* // {"scheduler": { "1": {"time": "12:00","week": "1,2,3,4,5,6,7","mode": "","num": 5,"state": 255}, "2": {"time": "12:00","week": "1,3,4","mode": "","num": 5,"state": 255}, "3": {"time": "12:00","week": "2,3,4","mode": "","num": 5,"state": 255}, "4": {"time": "12:00","week": "1,2,3,4,"mode": "","num": 5,"state": 255}, } } { "main":{ "hostname":"ESP00A859F6", "admin":{"login":"admin", "passw":"197994", "security":0}, "wifi":{"apname":"dsys", "appassw":"pasha89217548469", "apmode":0,"ip":"192.168.8.98", "gw":"192.168.8.1", "staticip":1}, "ntp":{"utc":3}, "time":"13:43:57", "date":"18.07.23" } } */ //{"select": ["main","hardware","servers","gpiomode","interrupt","linesdesigner","scheduler","mcpgpio","interpreter","d2d"],"hostname": "ESP00A859F6"} //$this->setProperty('info_general_BRAND', $state['select']); //$this->setProperty('info_general_MODEL', $state['hostname']); //$this->setProperty('info_general_time', $state['general']['time']); //$this->setProperty('info_general_SDK', $state['general']['sdk']); foreach($state as $port => $server) { //$this->setProperty($port, $server); //echo '</br>-----'.$port.' - '.$server; foreach($server as $po => $se) { //$this->setProperty($po, $se); // echo '</br>'.$port.' - '.$po.' - '.$se; foreach($se as $p => $s) { $this->setProperty($p, $s); // echo '</br>'.$port.' - '.$po.' - '.$se; } } } /* //------------------- Раскладываем данные по переменным $isplugged = $state['isPlugged']; //---------------------- Записываем данные в свойства $this->setProperty('isPlugged',$isplugged); */
Class objects:
Class properties:
Class methods:
require(DIR_MODULES.'devices/processHomebridgeMQTT.inc.php');
Class objects:
Class properties:
Class methods:
if ($this->getProperty("active")) { $this->callMethod("deactivate"); } else { $this->callMethod("activate"); }
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); if ($this->getProperty('active')) { say(processTitle($this->getProperty('title'))." включен"); } else { say(processTitle($this->getProperty('title'))." выключен"); }
$this->setProperty('active',1);
$this->setProperty('active',0);
Class objects:
if (gg('DebugMode.active') == 1) { DebMes('Метод SilentMode modeChanged'); } if ($this->getProperty('active')) { setGlobal('SilentMode.title', 'Тихий режим'); setGlobal('minMsgLevel', 10); } else { setGlobal('SilentMode.title', 'Громкий режим'); setGlobal('minMsgLevel', 1); }
if (gg('DebugMode.activate') == 1) { DebMes('Метод SilentMode activate'); } setGlobal('SilentMode.title', 'Тихий режим'); setGlobal('minMsgLevel','10');
if (gg('DebugMode.activate') == 1) { DebMes('Метод SilentMode deactivate'); } setGlobal('SilentMode.title', 'Громкий режим'); setGlobal('minMsgLevel','1');
/* if (timeIs(gg('Sets.SilentModeStart'))) { cm('SilentMode.activate'); } elseif (timeIs(gg('Sets.SilentModeEnd'))) { cm('SilentMode.deactivate'); } */ if (timeBetween(gg('timeMode.SilentModeStart'),gg('timeMode.SilentModeEnd')) && gg('SilentMode.active')!="1") { cm('SilentMode.activate'); } elseif (!timeBetween(gg('timeMode.SilentModeStart'),gg('timeMode.SilentModeEnd')) && gg('SilentMode.active')=="1") { cm('SilentMode.deactivate'); }
if (gg('DebugMode.active') == 1) { DebMes('Метод OperationalModes SleepMode check'); }
if (gg('DebugMode.active') == 1) { DebMes('Метод SleepMode modeChanged'); } if($this->getProperty('active')) { setGlobal('SleepMode.title', 'Все спят'); setGlobal('minMsgLevel', 100); } else { setGlobal('SleepMode.title', 'Все проснулись'); setGlobal('minMsgLevel', 1); }
setGlobal('minMsgLevel','15'); $this->setProperty('status', 'on'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_activate.php'); /* end injection of {SDevices} */
setGlobal('minMsgLevel','1'); $this->setProperty('status', 'off'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_deactivate.php'); /* end injection of {SDevices} */
if ($this->getProperty('active')) { setGlobal('minMsgLevel', 15); } else { setGlobal('minMsgLevel', 1); }
/* if (timeIs(gg('Sets.NightModeStart'))) { cm('NightMode.activate'); } elseif (timeIs(gg('Sets.NightModeEnd'))) { cm('NightMode.deactivate'); } */ if (timeBetween(gg('timeMode.NightModeStart'), gg('timeMode.NightModeEnd')) && gg('NightMode.active') != "1") { cm('NightMode.activate'); } elseif (!timeBetween(gg('timeMode.NightModeStart'), gg('timeMode.NightModeEnd')) && gg('NightMode.active') == "1") { cm('NightMode.deactivate'); }
$this->setProperty('status', 'off'); //sg('Relay01.auto_off ',''); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_deactivate.php'); /* end injection of {SDevices} */
$this->setProperty('status', 'on'); //sg('Relay01.auto_off ',120); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_activate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_injects.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_activate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_injects.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_activate.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/STuyaRelays_injects.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_injects.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_injects.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_injects.php'); /* end injection of {SDevices} */
Class methods:
Class objects:
/* begin injection of {app_radio} */ include_once(DIR_MODULES.'app_radio/app_radio.class.php'); $app_radio = new app_radio(); if(is_array($params)) { foreach($params as $key=>$value) { switch((string)$key) { case 'sta': $app_radio->change_station($params['sta'], $app_radio); break; case 'cmd': $app_radio->control($params['cmd']); break; case 'vol': $app_radio->set_volume($params['vol'], $app_radio); break; default: if($value == 'play' || $value == 'stop') $app_radio->control($value); elseif(strpos($value, 'vol') === 0) $app_radio->set_volume((int)substr($value, 3), $app_radio); elseif(strpos($value, 'sta:') === 0) $app_radio->change_station(substr($value, 4), $app_radio); } } } /* end injection of {app_radio} */
Class properties:
Class methods:
if ($this->getProperty('status')) { $this->callmethodSafe('turnOff'); } else { $this->callmethodSafe('turnOn'); }
$this->setProperty('status', 1); $a = $this->getProperty('modeSwitch') ; if (is_numeric($a) && $a == 0) { $this->setProperty('modeSwitch', 1); }
if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; @include_once(ROOT.'languages/SXiRoborockVacuum_'.SETTINGS_SITE_LANGUAGE.'.php'); @include_once(ROOT.'languages/SXiRoborockVacuum_default'.'.php'); $state = $params['NEW_VALUE']; $desc = constant('LANG_DEVICES_VACUUM_STATE_'. $state); $this->setProperty('state_description', $desc); //say(LANG_DEVICES_VACUUM_STATE . ": " . $desc); $ot = $this->object_title; $desc = $this->description; clearTimeOut($ot.'_work'); //$s="sg('$ot.modeSwitch',0); cm('$ot.turnOff');"; switch ($state) { case 0: $this->setProperty('state_icon', 'far fa-clock'); $this->callMethod('turnOff'); break; // Off case 1: $this->setProperty('state_icon', 'far fa-clock'); $this->callMethod('turnOn'); break; // On case 2: $this->setProperty('state_icon', 'fas fa-broom'); $this->callMethod('logic'); break; // Auto case 3: $this->setProperty('state_icon', 'fas fa-angle-double-left'); $this->callMethod('turnOn'); setTimeOut($ot.'_work',"sg('$ot.modeSwitch',0); cm('$ot.turnOff');", 1*60); break; // Time case 4: $this->setProperty('state_icon', 'fas fa-charging-station'); break; default: $this->setProperty('state_icon', 'fas fa-question-circle'); break; }
$this->setProperty('status', 0); //if ($this->getProperty('modeSwitch') == 1) { // $this->setProperty('modeSwitch', 0); //}
// выключаем реле $this->callMethod('turnOff'); // прервать выполнение если modeSwitch число и оно <2 $ms=$this->getProperty('modeSwitch'); if (is_numeric($ms) && $ms<2) { return; } // Проверка свойств объектов, которые могут изменить решение $ot = $this->object_title; $f = 0; // Предполагаем, что реле будет выключено // включить при активности в комнате когда стемнело if (gg('Megad2wm_relay01.status')) { if (gg('Megad2wm_relay01.autoMode') == 1) { $f = 1; }} // включить при существовании таймера if (timeOutExists($ot.'_work')) { $f = 1; } // выполнить $s=$this->getProperty('status'); if ($f>$s) { $this->callMethod('turnOn'); } if ($f<$s) { $this->callMethod('turnOff'); } // !!! проверить логику //$ms=$this->getProperty('modeSwitch'); if (!is_numeric($ms)) { return; } elseif ($ms==0) { $this->callMethod('turnOff'); } elseif ($ms==1) { $this->callMethod('turnOn'); }
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_setColor.php'); /* end injection of {SDevices} */
$ot = $params['ORIGINAL_OBJECT_TITLE']; $action = $this->getProperty('actionRGB'); if (isset($params['color']) || isset($params['brightness'])) { if (isset($params['color'])) { $color = preg_replace('/^#/','', $params['color']); } else { $color = $this->getProperty('colorSaved'); } if (isset($params['brightness'])) { $brightnessHex = dechex($params['brightness']); if (strlen($brightnessHex) == '1') { $brightnessHex = '0' . $brightnessHex; } } else { $brightnessHex = dechex($this->getProperty('brightnessSaved')); if (strlen($brightnessHex) == '1') { $brightnessHex = '0' . $brightnessHex; } } $this->setProperty('color', $brightnessHex . $color); if (isset($params['timer'])) { setTimeout($ot . '_timerAction', 'callMethod("' . $ot . '.action");', $params['timer']); } return; } elseif (getGlobal('NobodyHomeMode.active') == 2 && $action) { //Все спят $check = 0; $color = $this->getProperty('colorSleep'); if ($color == '') { $color = 'cd00ff'; } $brightness = $this->getProperty('brightnessSleep'); if ($brightness == '') { $brightness = 5; } if ($this->getProperty('color') != $color) { $check = 1; } if ($this->getProperty('brightness') != $brightness) { $check = 1; } } elseif (getGlobal('NobodyHomeMode.active') == 0 && $action) { //Кто-то дома $check = 0; $color = $this->getProperty('colorAtHome'); if ($color == '') { $color = '00ff00'; } $redFound = 0; $systemColor = getGlobal('System.stateColor'); if ($systemColor == 'red') { $color = 'ff0000'; $redFound = 1; } if (!$redFound) { $states = array('System', 'Communication'); foreach($states as $state) { if (getGlobal($state . '.stateColor') == 'yellow') { $color = 'ffcd00'; } } } if ($this->getProperty('color') != $color) { $check = 1; } if (getGlobal('DarknessMode.active')) { $brightness = $this->getProperty('brightnessDark'); if ($brightness == '') { $brightness = 50; } } else { $brightness = $this->getProperty('brightnessNotDark'); if ($brightness == '') { $brightness = 10; } } if ($this->getProperty('brightness') != $brightness) { $check = 1; } } else { $this->callmethod('turnOff'); } if ($check) { $brightnessHex = dechex($brightness); if (strlen($brightnessHex) == '1') { $brightnessHex = '0' . $brightnessHex; } $this->setProperty('color', $brightnessHex . $color); setTimeout($ot . '_timerCheck', 'callMethod("' . $ot . '.action");', 5); }
if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return; if ($params['NEW_VALUE'] != '0' && $this->getProperty('color') != '000000') { $this->setProperty('brightnessSaved', $params['NEW_VALUE']); if ($this->getProperty('status') != 1) { $this->setProperty('status', 1); } } else { $this->setProperty('status', 0); }
$this->setProperty('brightnessSaved', $this->getProperty('brightness')); $this->setProperty('color', '00000000'); $this->setProperty('status', 0);
if ($params['NEW_VALUE'] == $params['OLD_VALUE'] || strlen($params['NEW_VALUE']) > 6) return; if ($params['NEW_VALUE'] != '000000' && $this->getProperty('brightness')) { $this->setProperty('colorSaved', $params['NEW_VALUE']); if ($this->getProperty('status') != 1) { $this->setProperty('status', 1); } } else { $this->setProperty('status', 0); }
if ($this->getProperty('brightnessSaved') == 0) { $brightness = 100; } else { $brightness = $this->getProperty('brightnessSaved'); } $brightnessHex = dechex($brightness); if (strlen($brightnessHex) == 1) { $brightnessHex = '0' . $brightnessHex; } if ($this->getProperty('colorSaved') == '') { $this->setProperty('color', $brightnessHex . 'ffffff'); } else { $this->setProperty('color', $brightnessHex . $this->getProperty('colorSaved')); }
if ($this->getProperty('status')) { $this->callMethod('turnOff'); $this->setProperty('status', 0); } else { $this->callMethod('turnOn'); $this->setProperty('status', 1); }
Class objects:
Class properties:
Class methods:
/* begin injection of {Rooms} */ require(DIR_MODULES.'devices/Rooms_IoTupdated.php'); /* end injection of {Rooms} */
//$newBr = $params['param1']; // setBrMax $newBr = $params['setBrightMax']; // setBrMax $this->setProperty('Brightness', $newBr);
/* begin injection of {Rooms} */ require(DIR_MODULES.'devices/Rooms_IoTmanager.php'); /* end injection of {Rooms} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onActivity.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onIdle.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class objects:
Class objects:
Class properties:
Class methods:
if (gg("$this->object_title.enter")==gg("$this->object_title.pass")) { sg("$this->object_title.vizibal", 0); if (gg("$this->object_title.timerpad")==1) { SetTimeOut($this->object_title."_OffTimer01","sg('$this->object_title.vizibal', 1);",60*1); } else { clearTimeOut($this->object_title."_OffTimer01"); } } else { sg("$this->object_title.vizibal", 1); }
$cmd=$this->object_title; $viz=$this->getProperty("timerpad"); if ($viz==0) { SetTimeOut("$cmd-OffTimer01","setGlobal('$cmd.vizibal', 1);",60*1); } else { clearTimeOut("$cmd-OffTimer01"); } //SetTimeOut('title','commands', $timeout); //sg("cycle_websocketsRun","");
$this->setProperty('vizibal', 1); $this->setProperty('timerpad', 1);
$this->setProperty('vizibal', 0); $this->setProperty('timerpad', 0); clearTimeOut($this->object_title."_OffTimer01");
$currentStatus=$this->getProperty('timerpad'); if ($currentStatus) { $this->callmethodSafe('turnOff'); } else { $this->callmethodSafe('turnOn'); }
Class objects:
Class properties:
Class methods:
$this->setProperty('status', 0); $this->setProperty('on', 0);
$this->setProperty('status', 1); $this->setProperty('on', 1);
$currentStatus=$this->getProperty('status'); if ($currentStatus) { $this->callmethodSafe('turnOff'); } else { $this->callmethodSafe('turnOn'); }
Class objects:
Class methods:
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOff'); } else { $this->callMethod('turnOn'); }
$this->setProperty("status",0);
$this->setProperty("status",1);
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_batteryLevelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_keepAlive.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_setUpdatedText.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_statusUpdated.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SDevices_logicAction.php');
Class properties:
Class methods:
require(DIR_MODULES.'devices/SButtons_pressed.php');
Class objects:
Class properties:
Class methods:
/* 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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_updatePreview.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_motionDetected.php'); /* end injection of {SDevices} */
Class objects:
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:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_setTargetTemperature.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_setThermostatMode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_setFanSpeedMode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_configUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_fanSpeedUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_thermostatUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_tempUp.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_tempDown.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_setLevel.php'); /* end injection of {SDevices} */
/* 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_turnOff.php');
require(DIR_MODULES.'devices/SDimmers_levelUpdated.php');
require(DIR_MODULES.'devices/SDimmers_turnOn.php');
Class objects:
Class properties:
Class methods:
/* begin injection of {SGroups} */ require(DIR_MODULES.'devices/SGroups_IoTmanager.php'); /* end injection of {SGroups} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_IoTupdated.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_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_statusUpdated.php'); /* end injection of {SDevices} */
Class objects:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_injects.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_injects.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_setSource.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_setChannel.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_setVolume.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_pause.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WmRelays_IoTmanager.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WmRelays_list.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WmRelays_turnOnAuto.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WmRelays_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WmRelays_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WmRelays_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WmRelays_turnOff.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
//Задаем массив датчиков: [матка => [номер свойства, доступность, показание]] $tempSensors = [ "0e3638000000" => [1, false, -1], "323538000000" => [2, false, -1], "7d3738000000" => [3, false, -1], "565538000000" => [4, false, -1], "7dgh38000000" => [5, false, -1], // "312538000000" => [6, false, -1], ]; //не зарегистрированный датчики на шине $notRegSensors = ""; //Получаем строку с меги и делим ее по датчикам в массив //$listTemps = "ff2790c11604:24.18;fff7b0b31603:23.81"; $listTemps = file_get_contents("http://192.168.10.101/sec/?pt=8&cmd=list"); $temps = explode( ';', $listTemps); print_r ($temps); //Сравнивая метки пишем показания, меняя доступность foreach($temps as $temp){ $temp = explode( ':', $temp); if(array_key_exists($temp[0], $tempSensors)){ $tempSensors[$temp[0]][1] = true; $tempSensors[$temp[0]][2] = $temp[1]; }else{//пишем не найденные датчики в свойство $notRegSensors = $notRegSensors."$temp[0]; "; } } //обновляем свойства foreach($tempSensors as $key => $sensor){ $this->setProperty($sensor[0], $sensor[2]); } $this->setProperty("notRegSensors", $notRegSensors); $state = file_get_contents("http://192.168.10.100/sec/?pt=7&cmd=list");// http://192.168.10.100/sec/?pt=7 $state = substr($state,13,5); if ($state != "OFF") { print_r ($state); } //$listT = file_get_contents("http://192.168.10.101/sec/?pt=8&cmd=conv"); //И если критично? опрашивать шину принудительно //$tempT = explode( ';', $listT); //print_r ($tempT); //return;
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WRelays_switchB.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WRelays_turnOffA.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WRelays_chAUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WRelays_chBUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WRelays_turnOffB.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WRelays_switchA.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WRelays_turnOnB.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaD2WRelays_turnOnA.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SMegaPCA9685Dimmers} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_IoTupdated.php'); /* end injection of {SMegaPCA9685Dimmers} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_levelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_levelWorkUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_minus.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_On.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_Off.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_plus.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_dimming.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_dimUpDown.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_IoTmanager.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_setLevel.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMegaPCA9685Dimmers_turnOn.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRazdel_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRazdel_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRazdel_taken.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRazdel_shoot.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SRelays} */ require(DIR_MODULES.'devices/SRelays_IoTmanager.php'); /* end injection of {SRelays} */
$id = $this->id; $ot = $this->object_title; $desc = $this->description; $lr = $this->getProperty('linkedRoom'); $status = $this->getProperty('status'); $pretopic = $this->getProperty('topic'); // Добавляем трансляцию в MQTT if ($this->getProperty('groupMQTT')) { //$pretopic = $this->getProperty('topic'); $topic = "/".$pretopic."/".$lr."/".$ot."/status"; mqttMob($topic, $status, 0, 0); } if ($this->getProperty('groupIoTmanager')) { if ($autoMode == 1) $timer = 'AM '; //$array = array('status' => $status, 'descr' => $timer.$desc,'color' => 'orange');// 'descr' => $desc.' - '.$countdown.$count, //$json = json_encode($array, JSON_UNESCAPED_UNICODE); $json = '{"status":"'.$status.'","descr":"'.$timer.$desc.'","color":"orange"}'; $topic = "/".$pretopic."/".$lr."/".$ot."/status";// /IoTmanager/Kabinet/Tuya_relay11/status mqttMob($topic, $json, 0, 0); // /mjd26/Kitchen/Relay02/control //$topic = "/".$pretopic."/".$lr."/".$ot."/control";// /IoTmanager/Kabinet/Tuya_relay11/status //mqttMob($topic, $status, 0, 0); if ($status) { $status = 'ON'; } else { $status = 'OFF'; } $topic = "zgwCF94/".$ot."/set/state"; mqttMob($topic, $status, 0, 0); }
$this->setProperty('autoMode',!$this->getProperty('autoMode'));
Class objects:
file_get_contents("http://192.168.10.98/gpio?st=0&pin=215");
file_get_contents("http://192.168.10.98/gpio?st=1&pin=215");
$id = $this->id; $ot = $this->object_title; $desc = $this->description; callMethod('MobilePAW01.comm', array('PROPERTY'=>'notificationAlert','NEW_VALUE'=>'{"alert":"Включить свет в '.$desc.'?","title":"'.$ot.'","negative":"Нет","positive":"Да","neutral":"Пофиг","sound":false,"id":'.$id.'}')); //callMethod('MobilePAW00.comm', array('PROPERTY'=>'customCMD','NEW_VALUE'=>'volume=2&type=alarm'));
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/SSvgDimmers_stateUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_paramsUpdated.php'); /* end injection of {SDevices} */
$this->setProperty('autoMode',!$this->getProperty('autoMode'));
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_memoryOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_memoryOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_memorySwitch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_plus.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_minus.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_On.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_Off.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_pwmCnt.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_levelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_levelWorkUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSvgDimmers_dimUpDown.php'); /* end injection of {SDevices} */
Class objects:
if (getGlobal("DarknessMode.active") == true) { $this->level(50); }
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_relay_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_setTargetTemperature.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_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_tempDown.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_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_valueUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_disable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_enable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_switchEnable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_tempDown.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_tempUp.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostatsv_statusUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_phaseCDecode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_getSQL.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_IoTmanager.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_phaseBDecode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_phaseDecode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_fault.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaBreaker_phaseADecode.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_switch_led.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_raw.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_countdown.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_switchUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_getSQL.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_turnOnAuto.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_IoTmanager.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaFaveWayCL_statusUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_getSQL.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_timers.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_IoTmanager.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_fault.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_relay_status.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_raw.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_turnOnAuto.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_injects.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_switch_1Updated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_countdown.php'); /* end injection of {SDevices} */
Class objects:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SVacuums_pause.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_colorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_stateUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_paramsUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleProc.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_delPreset.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_addPreset.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_presetUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleSwitch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_getInfo.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_action.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_brightnessUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_colorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_turnOff.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiHumidifier_modeSilent.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiHumidifier_modeAuto.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiHumidifier_modeHigh.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiHumidifier_modeMeduim.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiPetWaterer_remainCleanUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiPetWaterer_filterUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiPetWaterer_faultUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiPetWaterer_waterUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiRoborockVacuum_stop.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiRoborockVacuum_charge.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiRoborockVacuum_pause.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiRoborockVacuum_start.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiRoborockVacuum_infoUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiRoborockVacuum_errorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiRoborockVacuum_stateUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SZona_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SZona_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SZona_taken.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SZona_shoot.php'); /* end injection of {SDevices} */
$this->setProperty('autoMode',!$this->getProperty('autoMode'));
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_pulseDetected.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/SCounters_refreshStats.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadget_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadget_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadget_voiceOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadget_voiceOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadget_switch.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
//$ip_hl = getGlobal("Sets.menu_cmd2"); //$ip_hl = $this->getProperty('GA_cmd_txt'); $ip_hl = getGlobal("Sets2.GA_cmd_txt"); $hl = getGlobal("Sets2.GA_name"); $GA_ot = $this->object_title; switch ($ip_hl) { // для fa /* case 0: $str = "cmd=process"; break; case 1: $str = "cmd=mkp_e"; break; case 9: $str = "key=CTRL+ALT+DOWN"; break; case 17: $str = "chk=GetAdmin"; break; */ case 'screenOn': $str = 'screenOn'; break; case 'screenOff': $str = 'screenOff'; break; case 'forceSleep': $str = 'forceSleep'; break; case 'triggerMotion': $str = 'triggerMotion'; break; case 'loadStartUrl': $str = 'loadStartUrl'; break; case 'refreshTab': $str = 'refreshTab'; break; // (ver. 1.45+) case 'clearCache': $str = 'clearCache'; break; case 'clearWebstorage': $str = 'clearWebstorage'; break; case 'clearCookies': $str = 'clearCookies'; break; // (ver. 1.28+) case 'startScreensaver': $str = 'startScreensaver'; break; case 'stopScreensaver': $str = 'stopScreensaver'; break; case 'startDaydream': $str= 'startDaydream'; break; case 'stopDaydream': $str = 'stopDaydream'; break; case 'lockKiosk': $str = 'lockKiosk'; break; case 'unlockKiosk': $str = 'unlockKiosk'; break; case 'toForeground': $this->setProperty('customCMD', 'toForeground'); break; case 'toBackground': $this->setProperty('customCMD', 'toBackground'); break; case 'restartApp': $str = 'restartApp'; break; case 'exitApp': $str = 'exitApp'; break; case 'popFragment': $str = 'popFragment'; break; case 'enableLockedMode': $str = 'enableLockedMode'; break; // Maintenance case 'disableLockedMode': $str = 'disableLockedMode'; break; case 'shutdownDevice': $str = 'shutdownDevice'; break; //root case 'rebootDevice': $str = 'rebootDevice'; break; //root case 'loadStatsCSV': $str= 'loadStatsCSV'; break; case 'getScreenshot': $str = 'getScreenshot'; break; case 'getCamshot': $str = 'getCamshot'; break; case 'listSettings': $str = 'listSettings'; break; case 'loadUrls1': $getInfo = callMethod($hl.'.setFullyCmd', array('cmd'=>'loadUrl', 'url'=>'http://192.168.10.26/3rdparty/kalcaddle/')); break; case 'loadUrls2': $getInfo = callMethod($hl.'.setFullyCmd', array('cmd'=>'loadUrl', 'url'=>'https://youtu.be/uJMFUJ1L4Tw')); break; case 'loadUrls3': $getInfo = callMethod($hl.'.setFully', array('cmd'=>'currentPageNew', 'value'=>'https://youtu.be/uJMFUJ1L4Tw')); break; case 'loadUrls4': $getInfo = callMethod($hl.'.setFully', array('cmd'=>'currentPageNew', 'value'=>'https://mdminfo.ru/wiki/Категория:Самописные_функции')); break; case 'loadUrls5': $getInfo = callMethod($hl.'.setFully', array('cmd'=>'currentPageNew', 'value'=>'https://ab-log.ru/smart-house/ethernet/megad-2561')); break; case 'scrBri250': $getInfo = callMethod($hl.'.setFullyCmd', array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'250')); break; case 'scrBri150': $getInfo = callMethod($hl.'.setFullyCmd', array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'150')); break; case 'scrBri10': $getInfo = callMethod($hl.'.setFullyCmd', array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'10')); callMethod($hl.'.getAdmin'); break; case 'def': $str = "*"; break; default: $str = " ";// вообще, сюда попасть мы не должны https://blog.instalator.ru/archives/1275 } //$this->setProperty('currentPageNew', $setg); //$this->setProperty('customCMD', $str); $this->setProperty('GA_cmd', $getInfo); $this->setProperty('GA_cmd_txt', $str); // записываем для меню setFullyCmd //$this->setProperty('GA_cmd', $str); // записываем в свой объект setGlobal("Sets2.GA_cmd", $str); // записываем для меню setGlobal("Sets2.GA_cmd_txt", $str); // записываем для меню
$GA_ot = $this->object_title; $GA_ip = $this->getProperty("ip4"); $GA_port = $this->getProperty("port"); $GA_passw = $this->getProperty("passw"); $GA_online = $this->getProperty("online"); $GA_ol_color = $this->getProperty("online_color"); $GA_doit = gg('Sets2.GA_cmd_txt'); switch ($GA_online) { // для fa case 0: $fa1 = "question"; break; case 1: $fa1 = "info"; break; case 2: $fa1 = "times"; break; default: $fa1 = ""; // вообще, сюда попасть мы не должны } //<i class="fa-solid fa-circle-xmark"></i> //<i class="fa-solid fa-circle-question"></i> //<i class="fa-sharp fa-solid fa-circle-info"></i> aria-hidden="true" $str = '<i class="fa-sharp fa-solid fa-circle-'.$fa1.'" style="color:'.$GA_ol_color.';"></i> <b>'.$GA_ot.'</b>'; $timeGA = 'Время и дата выполнения: <span style="float: right;"><b>'.date( "H:i:s - d.m.Y", time()).'</span></b>'; echo 'str - '.$str; echo '<hr></br>'; echo 'timeGA - '.$timeGA; echo '<hr></br>'; $GA_cmd = str_ireplace("-", "=", $GA_doit); $str = $str.'<span style="float: right;"><b>'.$GA_cmd.'</b></span><br>'; $str = $str.$timeGA.'<hr>'; //$result = getURL('http://'.$GA_ip.':'.$GA_port.'/?'.$GA_cmd, 0); //$result = getURL('http://'.$GA_ip.':'.$GA_port.'/?cmd=listSettings&password='.$GA_passw.'&type=json', 0); $result = $params['status']; // данные (ответ) получаем, сформируем их $str = str_ireplace("<html>", "",$str); $str = str_ireplace("</html>", "",$str); $str = str_ireplace("<p>", "<br>",$str); $str = str_ireplace("</p>", "<br>",$str); $str = ($GA_cmd == "cmd=process") ? str_ireplace(";", "; ",$str) : $str; echo 'str - '.$str; echo '<hr></br>'; $this->setProperty('GA_result', $str); // записываем в свой объект sg("Sets2.GA_result", $str); // записываем для меню
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_onSwitch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_motionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_batteryLevelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_setFullyCmd.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_InfoFully.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_setFully.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_eventFully.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_getInfoFully.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetFKB_getListFully.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_alarmEvent.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_motionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_sensorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_alarmSet.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_alarm.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_command.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_event.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_faceDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_state.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_batteryLevelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_qrcodeDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetMAP_sensorsDetected.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_setJson.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_comm.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_getJson.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_displayTimeOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_ttsStop.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_callNumber.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_locationJson.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_displayToWake.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_ttsRequestAll.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_batteryLevelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_notiDelete.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_saySpeech.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_alertResponse.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_home.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_voiceOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_voiceOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_switchDisplayMode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_ttsRequest.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_callEnd.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_switchDisplayToWake.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGadgetPAW_switch.php'); /* end injection of {SDevices} */
Class objects:
/* //Sensor_battery01.value Sensor_battery01.valueVoltage setGlobal('Sensor_battery02.value',$this->getProperty('info_battery_level')); //передает значение из метода в метод setGlobal('Sensor_battery02.valueVoltage',$this->getProperty('info_battery_voltage')); setGlobal('Sensor_battery02.batteryLevel',$this->getProperty('info_battery_level')); $status = $this->getProperty('info_battery_level'); //Добавляем трансляцию в MQTT include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); $topic = "PAW/redmi10/item/topic/batt"; //PAW/RMX3430/item/topic/test3 $rezult = $mqtt->mqttPublish($topic, $status, 0, 0);//function mqttPublish($topic, $value, $qos = 0, $retain = 0); */
//Sensor_battery01.value Sensor_battery01.valueVoltage //setGlobal('Sensor_battery01.value', $this->getProperty('batteryLevel')); //передает значение из метода в метод //setGlobal('Sensor_battery01.valueVoltage', $this->getProperty('info_battery_voltage')); //setGlobal('Sensor_battery01.batteryLevel', $this->getProperty('info_battery_level')); /* $status = $this->getProperty('batteryLevel'); //Добавляем трансляцию в MQTT include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); $topic = "PAW/RMX3430/item/topic/batt"; //PAW/RMX3430/item/topic/test3 $rezult = $mqtt->mqttPublish($topic, $status, 0, 0);//function mqttPublish($topic, $value, $qos = 0, $retain = 0); */
Class properties:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_alert.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_stateUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_colorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_paramsUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SMotions} */ require(DIR_MODULES.'devices/SMotions_IoTupdated.php'); /* end injection of {SMotions} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions_motionDetected.php'); /* end injection of {SDevices} */
Class objects:
//Добавляем трансляцию в Telegram if ($this->getProperty('groupTelegram')) { include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $telegram_module->sendMessageToAll($ot."-".$message, null, '', !$isImportant); }
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions2_motionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions2_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions2_unblockSensor.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_setLevel.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_levelUpdated.php'); /* end injection of {SDevices} */
$this->setProperty('status', 1); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_close.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_switch.php'); /* end injection of {SDevices} */
$this->setProperty('status', 0); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_open.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_statusUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_IoTmanager.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php'); /* end injection of {SDevices} */ $ot = $this->object_title; $desc = $this->description; $lr = $this->getProperty('linkedRoom'); $status = $this->getProperty('status'); //Openclose04.batteryLevel $blocked = $this->getProperty('blocked'); $bl = $this->getProperty('batteryLevel'); $array = array('status'=>$status,'blocked'=>$blocked,'batteryLevel'=>$bl,'linkedRoom'=>$lr,'desc'=>$desc); $json = json_encode($array, JSON_UNESCAPED_UNICODE); // //Добавляем трансляцию в registerEvent if ($this->getProperty('groupRegisterEvent')) { registerEvent($ot, $json); } //Добавляем трансляцию в MQTT if ($this->getProperty('groupMQTT')) { $pretopic = $this->getProperty('topic'); include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); $topic = '/'.$pretopic.'/'.$lr.'/'.$ot; //$topic = "mjd/26/".$ot."/status";."/" $rezult = $mqtt->mqttPublish($topic,$json, 0, 0); //mqttPublish($topic, $value, $qos = 0, $retain = 0); } //Добавляем трансляцию в Telegram if ($this->getProperty('groupTelegram')) { include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $telegram_module->sendMessageToAll($ot."-".$message, null, '', !$isImportant); } /** **/ if ($this->getProperty('groupIoTmanager')) { if ($this->getProperty('status')) { $status = "Открыто"; $icon = "walk"; $color = "red"; } else { $status = "Закрыто"; $icon = "walk"; $color = "green"; } $pretopic = $this->getProperty('topic'); $array = array('status'=>$status,'icon'=>$icon,'color'=>$color,); $json = json_encode($array, JSON_UNESCAPED_UNICODE); // $topic = "/IoTmanager/dev01/anydata7/status"; $topic = '/'.$pretopic.'/'.$lr.'/'.$ot."/status";// /IoTmanager/Kabinet/Tuya_relay11/status mqttMob($topic, $json, 0, 0); }
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_alert.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SSensors_valueUpdated.php');
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SBatterySensors_valueWorkVoltageUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SBatterySensors_valueVoltageUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SBatterySensors_valueUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLightSensors_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLightSensors_periodMinValueUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_loadStatusChanged.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STempHumSensors_IoTmanager.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STempHumSensors_valueUpdated.php'); /* end injection of {SDevices} */ $ot = $this->object_title; $desc = $this->description; $lr = $this->getProperty('linkedRoom'); $status = $this->getProperty('status'); $vHum = $this->getProperty('valueHumidity'); $vTemp = $this->getProperty('value'); $bl = $this->getProperty('batteryLevel'); $pretopic = $this->getProperty('topic'); $array = array('status'=>$status,'hum'=>$vHum,'temp'=>$vTemp,'batteryLevel'=>$bl,'lr'=>$lr,'desc'=>$desc); $json = json_encode($array, JSON_UNESCAPED_UNICODE); //Добавляем трансляцию в MQTT."/" if ($this->getProperty('groupMQTT')) { include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); $topic = "/".$pretopic."/".$lr."/".$ot; $rezult = $mqtt->mqttPublish($topic,$json, 0, 0);//mqttPublish($topic, $value, $qos = 0, $retain = 0); } //Добавляем трансляцию в Telegram if ($this->getProperty('groupTelegram')) { $message = $ot." - ".$vHum.'% - '.$vTemp.'°C - Бат'.$bl.'%'; include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $telegram_module->sendMessageToAll($message, null, '', !$isImportant); } //Добавляем трансляцию в registerEvent if ($this->getProperty('groupRegisterEvent')) { registerEvent($ot, $json); } if ($this->getProperty('groupIoTmanager')) { $array = array( //'status' => (float)$vTemp, 'status'=> (float)$vTemp.'°C '. (float)$vHum.'%', /* 'vibrate' => '100', 'toast' => 'Alert!', 'beep' => '10', 'speech' => 'hello'*/ );//,'class3'=>'calm-bg light padding-left padding-right rounded'{ status: 50, speech: 'hello', rate: 0.7, locale: 'fr-FR' } $json = json_encode($array, JSON_UNESCAPED_UNICODE); // $topic = "/IoTmanager/dev01/anydata7/status"; $topic = "/".$pretopic."/".$lr."/".$ot."/status"; mqttMob($topic, $json, 0, 0); }
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STempPressSensors_valueUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
Class objects:
//Получаем строку с меги и делим ее по датчикам в массив $listTemps = "ff2790c11604:24.18;fff7b0b31603:23.81;0e3638000000:OFF/OFF;312538000000:OFF/OFF;7d3738000000:OFF/OFF;777777000000"; $temps = explode( ';', $listTemps); //Сравнивая метки пишем показания, меняя доступность foreach($temps as $temp){ $temp = explode( ':', $temp); /*echo $sensors. " - " .$temp[0]. "</br>"; //echo $temp[1]. "</br>"; //echo "---------------------------------------------------</br>"; */ $tempSensors[$temp[0]][1] = true; $tempSensors[$temp[0]][2] = $temp[1]; } //обновляем свойства foreach($tempSensors as $id => $sensor){ //$this->setProperty($sensor[0], $sensor[2]); if (preg_match('/ON|OFF/uis', $sensor[2], $sensores)) { $sensores = "relay"; $par = explode( '/', $sensor[2]); foreach($par as $ch => $pars) { //echo $id. " - " .$sensores. " - " .$ch." - ".$pars."</br>"; //array('id' => $id,'sensors' => $sensors,'ch' => $ch,'param' => $pars); } if ($this->getProperty('idTM') === $id) { $this->setProperty('allsens', $sensor[2]); if ($this->getProperty('ch') == 'A') { if ($par[0] == 'ON') { $par[0] = '1'; } else { $par[0] = '0'; } $this->setProperty('status', $par[0]); } elseif ($this->getProperty('ch') == 'B') { if ($par[1] == 'ON') { $par[1] = '1'; } else { $par[1] = '0'; } $this->setProperty('status', $par[1]); } } } else if(preg_match('/(\d{1,2}|100)/uis', $sensor[2], $sensores)) { $sensores = "temp"; if ($this->getProperty('idTM') === $id) { $this->setProperty('value', $sensor[2]); } //echo $id. " - " .$sensores. " - " .$sensor[2]. "</br>"; //array('id' => $id,'sensors' => $sensors,'param' => $sensor[2]); } else { $sensores = "key"; if ($this->getProperty('idTM') === $id) { $this->setProperty('id', $id); } //echo $id. " - " .$sensores. "</br>"; //array('id' => $id,'sensors' => $sensors); } //echo $sensor[1]. "</br>"; }
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_alert.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_statusUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_getSQL.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_motionSwitch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_onlineUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_onlineUpdate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_updatePreview.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_motionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_motionTrackingSwitch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_initiative_message_decode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_privateSwitch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaCam_switch.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_getSQL.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_motionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_pirStateUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_IoTmanager.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaMotions_switchBlocked.php'); /* end injection of {SDevices} */
Class objects:
/* $message = 'Снимок'; // текстовая часть callMethod('Camera01.takeSnapshot'); // делаем снимок с камеры (встроенный метод для ПУ типа IP-камера) $image=getGlobal('Camera01.snapshot'); // получаем путь к изображению Camera01.takeSnapshot if ($image!='') { $full_path = ROOT.'cms/images/'.$image; // формируем полный путь к файлу $message .= "\n"."image:".$full_path; // добавляем картинку к сообщению } say($message); // делаем уведомление */
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_humanMotionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_getSQL.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_presenceDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_workingMode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_switchBlocked.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_humanStateUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {STuyaPresence} */ require(DIR_MODULES.'devices/STuyaPresence_IoTmanager.php'); /* end injection of {STuyaPresence} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaPresence_illumStateUpdated.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STv_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STv_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STv_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STv_turnOn.php'); /* end injection of {SDevices} */
Class objects:
Class properties:
Class methods:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SUnlockable_lockstatusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SUnlockable_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SUnlockable_unlock.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SUnlockable_lock.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SUnlockable_statusUpdated.php'); /* end injection of {SDevices} */
Class properties:
Class methods:
$pt=gg("sayMode.sayNewsText"); if($pt=="Заголовок"){ say($params['TITLE'],5); } elseif ($pt=="Новость") { say($params['BODY'],5); }elseif ($pt=="Заголовок и новость") { // say(gg("Mainsity.forecast"),"5"); }
$msv=gg("sayMode.sayWeather"); if($msv=="при изменении") { say("Погода изменилась","5"); callMethod('sayMode.modeChange'); }
Class objects:
Class properties:
Class methods:
$ip_hl = $this->getProperty("menu_cmd2"); $hl = $this->getProperty("GA_name"); switch ($ip_hl) { // для fa /* case 0: $str = "cmd=process"; break; case 1: $str = "cmd=mkp_e"; break; case 9: $str = "key=CTRL+ALT+DOWN"; break; case 17: $str = "chk=GetAdmin"; break; */ case 'screenOn': $str = 'screenOn'; break; case 'screenOff': $str = 'screenOff'; break; case 'forceSleep': $str = 'forceSleep'; break; case 'triggerMotion': $str = 'triggerMotion'; break; case 'loadStartUrl': $str = 'loadStartUrl'; break; // setGlobal($hl.'.customCMD', $str); case 'refreshTab': $str = 'refreshTab'; break; // (ver. 1.45+) case 'clearCache': $str = 'clearCache'; break; case 'clearWebstorage': $str = 'clearWebstorage'; break; case 'clearCookies': $str = 'clearCookies'; break; // (ver. 1.28+) case 'startScreensaver': $str = 'startScreensaver'; break; case 'stopScreensaver': $str = 'stopScreensaver'; break; case 'startDaydream': $str= 'startDaydream'; break; case 'stopDaydream': $str = 'stopDaydream'; break; case 'lockKiosk': $str = 'lockKiosk'; break; case 'unlockKiosk': $str = 'unlockKiosk'; break; case 'toForeground': $str = 'toForeground'; break; case 'toBackground': $str = 'toBackground'; break; case 'restartApp': $str = 'restartApp'; break; case 'exitApp': $str = 'exitApp'; break; case 'popFragment': $str = 'popFragment'; break; case 'enableLockedMode': $str = 'enableLockedMode'; break; // Maintenance case 'disableLockedMode': $str = 'disableLockedMode'; break; case 'shutdownDevice': $str = 'shutdownDevice'; break; //root case 'rebootDevice': $str = 'rebootDevice'; break; //root case 'restApp': $str = 'restartApp'; break; case 'loadStatsCSV': $str= 'loadStatsCSV'; break; case 'getScreenshot': $str = 'getScreenshot'; break; case 'getCamshot': $str = 'getCamshot'; break; case 'listSettings': $str = 'listSettings'; break; case 'loadUrls1': $geo = array('PROPERTY'=>'currentPageNew','NEW_VALUE'=>'http://192.168.10.26/3rdparty/kalcaddle/'); break; case 'loadUrls2': $geo = array('PROPERTY'=>'currentPageNew','NEW_VALUE'=>'https://youtu.be/uJMFUJ1L4Tw'); break; case 'loadUrls3': $geo = array('PROPERTY'=>'currentPageNew','NEW_VALUE'=>'https://ab-log.ru/smart-house/ethernet/megad-2561'); break; /* //$url1 = urlencode('http://192.168.10.26/3rdparty/kalcaddle/'); case 'loadUrls3': $setg = setGlobal($hl.'.currentPageNew', 'https://ab-log.ru/smart-house/ethernet/megad-2561'); break; case 'loadUrls4': $setg = 'https://mdminfo.ru/wiki/Категория:Самописные_функции'; break; */ case 'scrBri250': callMethod($hl.'.setFullyCmd', array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'250')); break; case 'scrBri150': callMethod($hl.'.setFullyCmd', array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'150')); break; case 'scrBri10': callMethod($hl.'.setFullyCmd', array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'10')); break; case 'def': $str = "*"; break; default: $str = " ";// вообще, сюда попасть мы не должны } if (isset($str)) { callMethod($hl.'.setFullyCmd', array('cmd'=>$str)); callMethod($hl.'.getAdmin'); } if (isset($geo)) { callMethod($hl.'.setFully', $geo); } /* SGadgetFKB_setFullyCmd.php NEW_VALUE $this->callMethod('getAdmin'); *http://192.168.10.26/objects/?object=MobileFKB01&op=m&m=setFullyCmd *http://192.168.10.26/objects/?object=MobileFKB01&op=m&m=setFullyCmd&cmd=screenOff *http://192.168.10.26/objects/?object=MobileFKB01&op=m&m=setFullyCmd&cmd=setStringSetting&key=screenBrightness&value=150 * *callmethodSafe('MobileFKB01.setFullyCmd',array('cmd'=>'setBooleanSetting', 'key'=>'kioskMode', 'value'=>'true',)); *callmethodSafe('MobileFKB01.setFullyCmd',array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'150',)); * callMethod('MobileFKB01.setFullyCmd',array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'50',)); * cm('MobileFKB01.setFullyCmd',array('cmd'=>'setStringSetting', 'key'=>'screenBrightness', 'value'=>'10',)); */ // setGlobal($hl.'.currentPageNew', $geo); // setGlobal($hl.'.customCMD', $str); // setGlobal($hl.'.GA_cmd', $getInfo); // setGlobal($hl.'.GA_cmd_txt', $str); // записываем для меню setFullyCmd //$this->setProperty('GA_cmd', $str); // записываем в свой объект setGlobal("Sets2.GA_cmd", $str); // записываем для меню setGlobal("Sets2.GA_cmd_txt", $str); // записываем для меню
$ip_hl = $this->getProperty("menu_cmd"); $hl = $this->getProperty("GA_name"); //print_r($ip_hldns); //($ip_hldns) switch ($ip_hl) { // для fa case 0: $str = "cmd=process"; break; case 1: $str = "cmd=mkp_e"; break; case 2: $str = "cmd=mkp"; break; case 3: $str = "cmd=vlc"; break; case 4: $str = "cmd=shutdown"; break; case 5: $str = "cmd=poweroff"; break; case 6: $str = "cmd=reboot"; break; case 7: $str = "cmd=forceifhung"; break; case 8: $str = "cmd=logoff"; break; case 9: $str = "key=CTRL+ALT+DOWN"; break; case 10: $str = "key=VOLUP"; break; case 11: $str = "key=VOLDN"; break; case 12: $str = "key=MUTE"; break; case 13: $str = "key=NEXT"; break; case 14: $str = "key=PREV"; break; case 15: $str = "key=PLAY"; break; case 16: $str = "key=STOP"; break; case 17: $str = "chk=GetAdmin"; break; case 18: $str = "*"; break; default: $str = " ";// вообще, сюда попасть мы не должны } sg("$hl.GA_cmd", $str); sg("$hl.GA_cmd_txt", $str); // записываем для меню $this->setProperty('GA_cmd', $str); // записываем в свой объект sg("Sets.GA_cmd", $str); // записываем для меню sg("Sets.GA_cmd_txt", $str); // записываем для меню
$GA_ot = $this->object_title; $GA_ip = $this->getProperty("IPint"); $GA_port = $this->getProperty("port"); $GA_online = $this->getProperty("Online"); $GA_ol_color = $this->getProperty("online_color"); $GA_doit = gg('Sets.GA_cmd_txt'); switch ($GA_online) { // для fa case 0: $fa1 = "question"; break; case 1: $fa1 = "info"; break; case 2: $fa1 = "times"; break; default: $fa1 = "";// вообще, сюда попасть мы не должны } //<i class="fa-solid fa-circle-xmark"></i><i class="fa-solid fa-circle-question"></i><i class="fa-sharp fa-solid fa-circle-info"></i> aria-hidden="true" $str = '<i class="fa-sharp fa-solid fa-circle-'.$fa1.'" style="color:'.$GA_ol_color.';"></i> <b>'.$GA_ot.'</b>'; $timeGA = 'Время и дата выполнения: <span style="float: right;"><b>'.date( "H:i:s - d.m.Y", time()).'</span></b>'; // проверим - это специальная команда выводящая список команд из файла GetAdmin.ini или нет ? if ($GA_doit != '*') { // нет это не спец.команда, это команда из программы GetAdmin $GA_cmd = str_ireplace("-", "=", $GA_doit); $str = $str.'<span style="float: right;"><b>'.$GA_cmd.'</b></span><br>'; $str = $str.$timeGA.'<hr>'; if (preg_match("/(key=[A-Z0-9+]+$)|(cmd=[a-zA-Z0-9_]+$)|(chk=[a-zA-Z0-9+-_]+$)/", $GA_cmd)) { // через рег.выражения выявим ошибки синтаксиса $result = getURL('http://'.$GA_ip.':'.$GA_port.'/?'.$GA_cmd, 0); //echo $result; if ($result == false) { // проверим - а вообще можем получить данные? $provresult = getURL('http://'.$GA_ip.':'.$GA_port.'/?chk=GetAdmin', 0); // проверим выполив заведомо имеющейся командой switch ($GA_online) { // проверим варианты с учетом online/offline терминала case 0: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- нет доступа по сети к <b>'.$GA_ot.'</b>;<br>'; $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- команда <b>'.$GA_cmd.'</b> отсутствует на <b>'.$GA_ot.'</b>.<br>'; } break; case 1: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- команда <b>'.$GA_cmd.'</b> отсутствует на <b>'.$GA_ot.'</b>.<br>'; } break; case 2: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- нет доступа по сети к <b>'.$GA_ot.'</b>.<br>'; } else { $str = $str.'- команда <b>'.$GA_cmd.'</b> отсутствует на <b>'.$GA_ot.'</b>.<br>'; } break; default: // вообще, сюда попасть мы не должны echo "ошибка в режиме онлайн!"; } } else { // данные (ответ) получаем, сформируем их $str = $str.iconv ("CP1251", "UTF-8", $result); $str = str_ireplace("<html>", "",$str); $str = str_ireplace("</html>", "",$str); $str = str_ireplace("<p>", "<br>",$str); $str = str_ireplace("</p>", "<br>",$str); $str = ($GA_cmd == "cmd=process") ? str_ireplace(";", "; ",$str) : $str; } } else { // регулярные выражения выявили ошибку $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Причина: ошибка синтаксиса! => '.$GA_cmd; } $this->setProperty('GA_result', $str); // записываем в свой объект sg("Sets.GA_result", $str); // записываем для меню } else { // да, это спец.команда $str = $str.'<span style="float: right;"><b>из GetAdmin.ini</b></span>'; $str = $str.'<br>'.$timeGA; //if (file_exists('\\\\'.$GA_ip.'\\GetAdmin\\GetAdmin.ini')) { // проверим доступность файла GetAdmin.ini if (file_exists('./templates_alt/'.$GA_ot.'.ini')) { // проверим доступность файла GetAdmin.ini // файл доступен, формируем список команд из него //$config = parse_ini_file('file://dsys01k/GetAdmin/GetAdmin.ini',true); $config = parse_ini_file('./templates_alt/'.$GA_ot.'.ini',true); //$config = parse_ini_file('./cms/texts/'.$addGA_ot2.'.txt',true); // $config = parse_ini_file('\\\\'.$GA_ip.'\\GetAdmin\\GetAdmin.ini',true); // file://dsys01k/GetAdmin/GetAdmin.ini $count = $config[Properties][Count]; $max = $count * 4; foreach($config[Commands] as $key=>$object) { if (($object != "") && (strpos($key, "show") === false)) { if (strpos($key, "Command") !== false) { $str = $str.'<hr>'; $object = '<span style="cursor:pointer"><font size="+1" color="red" onclick = "ajaxSetGlobal(\'Sets.GA_cmd_txt\', \'cmd='.$object.'\');">'.$object.'</font></span>'; } $str = $str.'<font color="green">'.$key.'</font> = '.$object.'<br>'; } if (--$max <=0) break; } } else { // файл GetAdmin.ini не доступен, выясним причины $str = $str.'<hr>'; $provresult = getURL('http://'.$GA_ip.':'.$GA_port.'/?chk=GetAdmin', 0); // проверим выполив заведомо имеющейся командой switch ($GA_online) { // проверим варианты с учетом online/offline терминала case 0: case 2: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- нет доступа по сети к <b>'.$GA_ot.'</b>;<br>'; $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> не установлен;<br>'; $str = $str.'- на <b>'.$GA_ot.'</b> GetAdmin не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- к папке GetAdmin на <b>'.$GA_ot.'</b> нет доступа;<br>'; $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> в другой папке.<br>'; } break; case 1: $str = $str.'<font size="+1" color="red">Не выполнено!</font><br>'; $str = $str.'Возможные причины:<br>'; if ($provresult == false) { $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> не установлен;<br>'; $str = $str.'- на <b>'.$GA_ot.'</b> GetAdmin не запущен;<br>'; $str = $str.'- настройки доступа к GetAdmin ошибочны.<br>'; } else { $str = $str.'- к папке GetAdmin на <b>'.$GA_ot.'</b> нет доступа;<br>'; $str = $str.'- GetAdmin на <b>'.$GA_ot.'</b> в другой папке.<br>'; } break; default: // вообще, сюда попасть мы не должны echo "ошибка в режиме онлайн!"; } } $this->setProperty('GA_result', $str); // записываем в свой объект sg("Sets.GA_result", $str); // записываем для меню }
Class objects:
Class methods:
Class objects:
//Для Linux $play_terminal = "MAIN"; $url=BASE_URL.ROOTHTML.'popup/app_player.html?ajax=1&play_terminal='.$play_terminal.'&command=next'; getURL($url, 0);
if ($params['VALUE']){ $this->setProperty('VLCPlayer.volumeLevel',$params['VALUE']); } $url=getProperty('VLCPlayer.URL'); $volume = $this->getProperty('VLCPlayer.volumeLevel'); $data=getURL($url.'/requests/status.xml?command=volume&val=' .$params['VALUE'],0,getProperty('VLCPlayer.Username'),getProperty('VLCPlayer.Password'),0); //say("Изменилась громкость до ".$params['VALUE']." процентов"); //$this->setProperty('ThisComputer.volumeLevelVLC',$params['VALUE']); //curl_exec('http://192.168.10.28/requests/status.xml?command=volume&val='.$params['VALUE']); //safe_exec('amixer -c 0 -q set Master '.$params['VALUE'].'% unmute'); //say("Изменилась громкость до ".$params['VALUE']." процентов"); //PCM echo ($data);
$playerAddr = "http://192.168.10.26:8080"; $level=$this->getProperty('level');//Узнаём уровень яркости в процентах $this->setProperty('levelWork',$level); //say("Яркость в ".$level." единиц", 2); //curl_setopt($ch, CURLOPT_URL, $playerAddr . "/requests/status.xml?command=volume&val=$volume"); //curl_setopt('http://192.168.10.28:8080/requests/status.xml?command=volume&val=$level'); //getURL('http://192.168.10.28:8080/requests/status.xml?command=volume&val='.$level,0); //if ($params['VALUE']){ // $this->setProperty('level',$params['VALUE']); //} $volume = $this->getProperty('level'); //getURL('http://192.168.10.28:8080/requests/status.xml?command=volume&val=' .$params['VALUE'],0); getURL('http://192.168.10.26/popup/app_player.html?ajax=1&command=set_volume&play_terminal=MAIN&session_terminal=MAIN¶m=' .$volume,0,'&rnd=', 0);
getURL('http://192.168.10.26/popup/app_101ru.html?&ajax=1&op=playstation&id=313',0);
//getURL('http://192.168.10.28/popup/app_player.html?ajax=1&command=pause&play_terminal=MAIN&session_terminal=MAIN¶m=&rnd=', 0); //Для Windows //getURL('http://localhost/rc/?command=vlc_prev',0); //Для Linux $play_terminal = "MAIN"; $url=BASE_URL.ROOTHTML.'popup/app_player.html?ajax=1&play_terminal='.$play_terminal.'&command=pause'; getURL($url, 0);
getURL('http://192.168.10.26/popup/app_101ru.html?&ajax=1&op=playstation&id=310',0);
//Для Windows //getURL('http://localhost/rc/?command=vlc_prev',0); //Для Linux $play_terminal = "MAIN"; $url=BASE_URL.ROOTHTML.'popup/app_player.html?ajax=1&play_terminal='.$play_terminal.'&command=prev'; getURL($url, 0);
Class properties:
Class methods:
Class objects:
say(timeNow(),2);
// говорить время $tm=(gg("timeMode.Say_time_X")); $m=(gg("Time.timeM")); $tl=(gg("timeMode.Led")); if (($tm=='10м') && (($m=="00")||($m=="10")||($m=="20")||($m=="30")||($m=="40")||($m=="50"))){ say(timeNow(),2); } elseif (($tm=='15м') && (($m=="00")||($m=="15")||($m=="30")||($m=="45"))) { say(timeNow(),2); } elseif (($tm=='30м') && (($m=="00")||($m=="30"))) { say(timeNow(),2); } elseif (($tm=='час') && ($m=="00")) { say(timeNow(),2); } if($tm=="откл") { setGlobal("timeMode.timeLed",0); } elseif ((($tl== '1') || ($tl== '2')) && ($tm!= ('откл'))){ setGlobal("timeMode.timeLed",1); } elseif ((($tl== '0') || ($tl== '3')) && ($tm!= ('откл'))){ setGlobal("timeMode.timeLed",2); }
if (isWeekDay()) { if (timeBetween(gg("timeMode.OnTimeWeekDay"),gg("timeMode.OffTimeWeekDay")) && gg("timeMode.On")=='авто') { setGlobal("minMsgLevel",2); setGlobal("timeMode.Led",1); } elseif (!timeBetween(gg("timeMode.OnTimeWeekDay"),gg("timeMode.OffTimeWeekDay")) && gg("timeMode.On")=='авто') { // getURL('http://localhost/rc/?command=vlc_close',0); setGlobal("RadioSetting.On",0); setGlobal("minMsgLevel",5); setGlobal("timeMode.Led",3); } } if (isWeekEnd()) { if (timeBetween(gg("timeMode.OnTimeWeekEnd"),gg("timeMode.OffTimeWeekEnd")) && gg("timeMode.On")=='авто') { setGlobal("minMsgLevel",2); setGlobal("timeMode.Led",1); } elseif (!timeBetween(gg("timeMode.OnTimeWeekEnd"),gg("timeMode.OffTimeWeekEnd")) && gg("timeMode.On")=='авто') { // getURL('http://localhost/rc/?command=vlc_close',0);; setGlobal("RadioSetting.On",0); setGlobal("minMsgLevel",5); setGlobal("timeMode.Led",3); } }
$vol=gg('timeMode.Volume'); sg('ThisComputer.volumeLevel',$vol);
$sset= date("H:i", gg('Sun.SunSetTime')); $srise= date("H:i", gg('Sun.SunRiseTime')); $td= gg('timeMode.DarknessModeEnd'); $tn= gg('timeMode.DarknessModeStart'); $md=gg('timeMode.mode_dark'); if ($md=='откл'){ setGlobal('timeMode.dark_mode',0); setGlobal('timeMode.led_dark_mode',0); callMethod('DarknessMode.deactivate'); } elseif ($md=='по времени'){ setGlobal('timeMode.DarknessModeEnd',$td); setGlobal('timeMode.DarknessModeStart',$tn); callMethod("timeMode.Alisa_auto"); } elseif ($md=='по закату'){ setGlobal('timeMode.DarknessModeEnd',$srise); setGlobal('timeMode.DarknessModeStart',$sset); callMethod("timeMode.Alisa_auto"); } elseif ($md=='вкл'){ setGlobal('timeMode.dark_mode',1); setGlobal('timeMode.led_dark_mode',4); callMethod('DarknessMode.activate'); } if (timeBetween(gg("Sun.SunRiseTime"),gg("Sun.SunSetTime")) && (gg("timeMode.modeNight")=='по закату') && (gg("NightMode.active")=="1")) { setGlobal('timeMode.modeNightLed',"3"); callMethod('NightMode.deactivate'); }elseif (!timeBetween(gg("Sun.SunRiseTime"),gg("Sun.SunSetTime")) && (gg("timeMode.modeNight")=='по закату') && (gg("NightMode.active")=="0")) { setGlobal('timeMode.modeNightLed',"1"); callMethod('NightMode.activate'); } if ((timeBetween(gg("timeMode.DarknessModeEnd"),gg("timeMode.DarknessModeStart")) && gg('timeMode.dark_mode')=='1') && ((gg("timeMode.mode_dark")=='по времени') || (gg("timeMode.mode_dark")=='по закату'))) { setGlobal('timeMode.dark_mode',0); callMethod('DarknessMode.deactivate'); }elseif ((!timeBetween(gg("timeMode.DarknessModeEnd"),gg("timeMode.DarknessModeStart")) && gg('timeMode.dark_mode')=='0') && ((gg("timeMode.mode_dark")=='по времени') || (gg("timeMode.mode_dark")=='по закату'))) { setGlobal('timeMode.dark_mode',1); callMethod('DarknessMode.activate'); }
//включить Алису $stm=(gg("timeMode.On")); if ($stm=='откл'){ say('Я отключаюсь.',2); // getURL('http://localhost/rc/?command=vlc_close',0);; setGlobal("RadioSetting.On",0); setGlobal("minMsgLevel",5); setGlobal("timeMode.Led",0); callMethod("timeMode.Alisa_time_X"); } elseif ($stm=='авто'){ setGlobal("minMsgLevel",2); setGlobal("timeMode.Led",1); say('Включен автоматический режим сообщений.',2); callMethod("timeMode.Alisa_time_X"); } elseif ($stm=='вкл'){ setGlobal("minMsgLevel",0); setGlobal("timeMode.Led",2); say('Я опять с Вами.',2); callMethod("timeMode.Alisa_time_X"); }
if (timeBetween(gg("timeMode.NightModeStart"),gg("timeMode.NightModeEnd")) && (gg("timeMode.modeNight")=='по времени') && (gg("NightMode.active")=="1")) { setGlobal('timeMode.modeNightLed',"3"); callMethod('NightMode.deactivate'); }elseif (!timeBetween(gg("timeMode.NightModeStart"),gg("timeMode.NightModeEnd")) && (gg("timeMode.modeNight")=='по времени') && (gg("NightMode.active")=="0")) { setGlobal('timeMode.modeNightLed',"1"); callMethod('NightMode.activate'); }
Class methods:
Class objects:
$data=SQLSelectOne("SELECT * FROM rss_items ORDER BY ADDED DESC LIMIT 1"); //вариант с фильтром по каналу: $data=SQLSelectOne("SELECT * FROM rss_items WHERE CHANNEL_ID=5 ORDER BY ADDED DESC LIMIT 1"); //вместо 5 нужный ID канала $news_text=$data['BODY']; // текст новости $news_header=$data['TITLE']; // заголовок setGlobal('Mainsity.eventsTitle',$news_header); setGlobal('Mainsity.eventsNews',$news_text); $status=""; $tm=(gg("sayMode.sayNewsText")); if ($tm=='Заголовок') { $status.=(''.$news_header.' '); } elseif ($tm=='Новость') { $status.=(''.$news_text.' '); } else{ $status.=(''.$news_header.'. '.$news_text.'. '); } say($status,5);
if (timeBetween(gg("sayAlise.Alisa_auto_on"),gg("sayAlise.Alisa_auto_off")) && (gg("sayAlise.Alise")=='авто')) { setGlobal("ThisComputer.minMsgLevel","15"); if (gg("sayMode.Say_time")!="откл"){ setGlobal('sayMode.sayTimeLed',"1"); } if (gg("sayMode.sayNews")!="откл"){ setGlobal('sayMode.sayNewsLed',"1"); } if (gg("sayAlise.Alise")!="откл"){ setGlobal("sayAlise.Alise_Led","1"); } if (gg("sayMode.sayWeather")!="откл"){ setGlobal('sayMode.sayWeatherLed',"1"); } }elseif (!timeBetween(gg("sayAlise.Alisa_auto_on"),gg("sayAlise.Alisa_auto_off")) && (gg("sayAlise.Alise")=='авто')) { setGlobal("ThisComputer.minMsgLevel","1"); setGlobal("sayAlise.Alise_Led","3"); if (gg("sayMode.Say_time")!="откл"){ setGlobal('sayMode.sayTimeLed',"2"); } if (gg("sayMode.sayNews")!="откл"){ setGlobal('sayMode.sayNewsLed',"3"); } if (gg("sayMode.sayWeather")!="откл"){ setGlobal('sayMode.sayWeatherLed',"3"); } }
Class properties:
Class methods:
Class objects:
$url=gg('mainVLC.adr'); $file=getURL($url.'/requests/status.xml',0,'',1111,0); $xml = simplexml_load_string($file); var_dump($xml); $vlc_state=$xml->state; $vlc_vol=$xml->volume; sg('mainVLC.status',$vlc_state); sg('mainVLC.volume',$vlc_vol);
$url=getGlobal('mainVLC.adr'); getURL($url.'/requests/status.xml?command=pl_play',0,'',1111,0); rs('CheckVLCstatus');
$f=$params['SOURCE']; if(isset($f) && !$f){ return; } $fil=getGlobal('mainVLC.adr')."/requests/status.xml?command=in_enqueue&input=".$f; $data=getURL($fil,0,'',1111,0); cm('mainVLC.GetStatus');
$url=getGlobal('mainVLC.adr'); $data=getURL($url.'/requests/status.xml?command=pl_pause',0,'',1111,0); cm('mainVLC.GetStatus');
$url=getGlobal('mainVLC.adr'); $data=getURL($url.'/requests/status.xml?command=pl_empty',0,'',1111,0); cm('mainVLC.GetStatus');
$v = $params['volume']; if(!isset($v)){ $v=getGlobal('mainVLC.volume'); } $url = getGlobal('mainVLC.adr'); $data = getURL($url.'/requests/status.xml?command=volume&val='.$v,0,'',1111,0); cm('mainVLC.GetStatus');
Class properties:
Class methods:
//$ot = $this->object_title; $des = $this->description; // Проверяет состояние обьектов в заданном классе сообщает о состоянии обьекта. $objects=getObjectsByClass("Sheduler"); foreach($objects as $obj) { $Obj_Title = $obj['TITLE']; $shedulerOn = gg($obj['TITLE'].'.shedulerOn'); if ($shedulerOn == 1) { // setGlobal("AlarmGlobal.status",1); // setGlobal('AlarmGlobal.alarm_led',1); $this->setProperty('alarm_led',1); $this->setProperty('status',1); $this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); // say(" Будильник".$des."включен ", 1); //$this->setProperty('AlarmOn',0); status // callMethod($obj['TITLE'].".turnOff"); } else { //// setGlobal("AlarmGlobal.status",0); // setGlobal('AlarmGlobal.alarm_led',0); $this->setProperty('alarm_led',0); $this->setProperty('status',0); $this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); // say(" Будильник".$des."выключен ", 1); // callMethod($obj['TITLE'].".turnOff"); } } //echo array($objects);
$this->setProperty('status', 1); $this->setProperty('shedulerOn', 1);
$this->setProperty('status', 0); $this->setProperty('shedulerOn', 0);
$currentStatus=$this->getProperty('status'); if ($currentStatus) { $this->callmethodSafe('turnOff'); } else { $this->callmethodSafe('turnOn'); }
Class objects:
Class properties:
Class methods:
Class objects:
$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','mqtt'=>'mqtt'); foreach($cycles as $k => $v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm > 10*60) { $yellow_state = 1; $details[] = $v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } if ((int)gg('ThisComputer.SpaceProblems')>0) { $red_state = 1; $details[] = LANG_GENERAL_RUNNING_OUT_SPACE." (".gg('ThisComputer.SpaceProblems_Details').').'; } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/system_checkstate.php'); /* end injection of {SDevices} */ 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/STuyaRelays_injects.php'); /* end injection of {SDevices} */ //Добавляем трансляцию в MQTT //if ($this->getProperty('groupMQTT'))message //{ //$ot = $this->object_title; //$pretopic = $this->getProperty('topic'); $stateColor = $this->getProperty('stateColor'); include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); //$topic = '/'.$pretopic.'/'.$ot."/lwt"; $topic = '/mjd26/Home/system'; //$message = $params['state']; $rezult = $mqtt->mqttPublish($topic, $stateColor, 0, 0); //}
$details=array(); $red_state=0; $yellow_state=0; if (!isOnline('Internet')) { $yellow_state=1; $details[]=LANG_GENERAL_NO_INTERNET_ACCESS; } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STuyaRelays_injects.php'); /* end injection of {SDevices} */
$details=array(); $red_state=0; $yellow_state=0; if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
//Добавляем трансляцию в MQTT //if ($this->getProperty('groupMQTT'))message //{ //$ot = $this->object_title; $pretopic = $this->getProperty('topic'); include_once(DIR_MODULES . 'mqtt/mqtt.class.php'); $mqtt = new mqtt(); //$topic = '/'.$pretopic.'/'.$ot."/lwt"; $topic = '/'.$pretopic.'/Home/lwt'; //$message = $params['state']; $rezult = $mqtt->mqttPublish($topic, 'online', 0, 0); //}
/* * этот сценарий можно использовать для проверки любого открытого порта * С механизмом штатной автопривязки https://mjdm.ru/forum/viewtopic.php?f=7&t=4941#p67745 * * запускается из ClockChime -> onNewHour callMethodSafe("Mosquitto.checkState"); * или ClockChime -> onNewMinute * или ClockChime -> onNewDay if (!function_exists('fsockopen')) { //Проверка на работоспособность функции fsockopen $this->setProperty('stateDetails','fsockopen не работает!'); $this->setProperty('stateColor','red'); $this->setProperty('state',-1); $this->setProperty('error',1); $this->callMethod('stateChanged', array('state'=>'-1','error'=>'1')); return; } else { $tests = array(1883 => '127.0.0.1') ;//Используем определённые сервера на которых точно открыты нужные порты foreach($tests as $port => $server){//По циклу тестируем $fp = @fsockopen($server,$port,$errno,$errstr,5); //Соединяемся if($fp){ $this->setProperty('stateColor','green');//Если удачное соединение $this->setProperty('state',1); $this->setProperty('error',0); $this->setProperty('stateDetails','fsockopen работает!'); //say ( 'fsockopen работает!'); $this->callMethod('stateChanged', array('state'=>'1','error'=>'0')); } else {//Если неудачное соединение $this->setProperty('stateColor','orange'); $this->setProperty('state',0); $this->setProperty('error',1); $this->setProperty('stateDetails','fsockopen неудачное соединение!'); $this->callMethod('stateChanged', array('state'=>'0','error'=>'1')); } } } */
Class properties:
Class methods:
Class objects:
if (gg('DebugMode.active') == 1) { DebMes('Метод Timer ClockChime onNewMinute'); } //$h=(int)date('G',time()); //$m=date('i',time()); if (isWeekDay()) { } if (timeBetween(getGlobal('timeMode.NightModeEnd'), getGlobal('timeMode.NightModeStart')) && getGlobal('clockChimeEnabled')) { if ($m=="00") { say(timeNow(), 1); } } // ================== Записываем текущее время ======================================================== //setGlobal('timeNow',date('H:i')); sg("ThisComputer.timeNow",date( "H:i", time())); // ================== получем ЧАСЫ и МИНУТЫ отдельно ================================================== //$H = date("H", time()); //$M = date("i", time()); //sg("Time.timeH", $H); //sg("Time.timeM", $M); // выделяем десятки и единицы часов и минут //sg("Time.timeH1",$H[0]); //sg("Time.timeH2",$H[1]); //sg("Time.timeM1",$M[0]); //sg("Time.timeM2",$M[1]); $homeStatus=date('H:i'); if (getGlobal('NobodyHomeMode.active')) { $homeStatus.=' '.LANG_DEVICES_ROOMS_NOBODYHOME; } else { $homeStatus.=' '.LANG_DEVICES_ROOMS_SOMEBODYHOME; } $homeStatus.=' '.getGlobal('Security.stateDetails'); $homeStatus.=' '.getGlobal('System.stateDetails'); $homeStatus.=' '.getGlobal('Communication.stateDetails'); setGlobal('HomeStatus',$homeStatus); // ================== готовим минимальный уровень проговаривания в соответствии с настройками ======== $saytime = gg('Sets.saytime'); // ================== сообщение о восходе и закате и установка режима темного времени суток ========== if (timeBetween(getGlobal('Sun.SunRiseTime'), getGlobal('Sun.SunSetTime')) && getGlobal('isDark')=="1") { setGlobal("isDark",0); callMethod('DarknessMode.deactivate'); say('Всходит солнце',2); } elseif (!timeBetween(getGlobal('Sun.SunRiseTime'), getGlobal('Sun.SunSetTime')) && getGlobal('isDark')!="1") { setGlobal("isDark",1); callMethod('DarknessMode.activate'); say('Солнце заходит',2); } // ================== установка режима эконом ======================================================= //if (timeIs("23:30") && (gg("EconomMode.active")!="1") && (gg("NobodyHomeMode.active")=="1")) { // callMethod('EconomMode.activate'); //} // ================== установка ночного режима ======================================================= if (timeIs(gg('timeMode.NightModeStart'))) { callMethod('NightMode.activate'); } elseif (timeIs(gg('timeMode.NightModeEnd'))) { callMethod('NightMode.deactivate'); } //callMethodSafe("Mosquitto.checkState");
if (gg('DebugMode.active') == 1) { DebMes('Метод Timer ClockChime onNewHour'); } $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'); if (timeIs("03:00")) { runScript("systemMaintenance"); } //callMethodSafe("Mosquitto.checkState"); // озвучивание времени раз в час, если не ночь и разрешено //if (timeBetween(gg('timeMode.NightModeEnd'), gg('timeMode.NightModeStart')) && gg('sayMode.sayTime')) { // say(timeNow(),1); //} // озвучивание времени раз в час, если не отдых и разрешено //if (timeBetween(gg('timeMode.SilentModeEnd'), gg('timeMode.SilentModeStart')) && gg('sayMode.sayTime')) { // say(timeNow(),1); //}
// https://mdminfo.ru/wiki/OnNewDay if (gg('DebugMode.active') == 1) { DebMes('Метод Timer ClockChime onNewDay'); } $d=date('m.d',time()); if ($d=="10.15") { // тут явно заданна дата выполнения кода say('начался зимний период'); } if ($d=="04.27") { // тут явно заданна дата выполнения кода say('начался летний период'); }
Class properties:
Class methods:
$log = date("Y-m-d H:i:s") .' '; $log .= 'Открыли паролем'; say('Добро пожаловать домой!', 3); $this->setProperty('log', $log);
$user = TuyaDoorUser($this->getProperty('DevID'),'5-'.$params['NEW_VALUE']); $log = date("Y-m-d H:i:s") .' '; if ($user != 'Неизвестный') { $log .= $user.', карточкой'; say($user.', добро пожаловать домой!', 3); } else { $log .= 'неизвестный открыл карточкой'; } $this->setProperty('log', $log);
$user = TuyaDoorUser($this->getProperty('DevID'),'1-'.$params['NEW_VALUE']); $log = date("Y-m-d H:i:s") .' '; if ($user != 'Неизвестный') { $log .= $user.', отпечатком'; say($user.', добро пожаловать домой!', 3); } else { $log .= 'неизвестный открыл карточкой'; } $this->setProperty('log', $log);
Class objects:
Class properties:
Class methods:
runScript('CheckYaExport'); $level=$this->getProperty("level"); if ($level !=="NA"){ $this->setProperty('level_for_img',$level); }
Class objects:
, Россия
На форуме: odinvolk
© 2024 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Public agreement
SmartLiving