Свойства класса:
Методы класса:
if (getGlobal('AlarmOne.AlarmOn') || getGlobal('AlarmWeekDay.AlarmOn') || getGlobal('AlarmWeekEnd.AlarmOn') == 1) {
sg('AlarmGlobal.AlarmOn',1);
sg('AlarmGlobal.AlarmValue','<font color=lime>Вкл</font>');
} else {
sg('AlarmGlobal.AlarmOn',0);
sg('AlarmGlobal.AlarmValue','<font color=red>Выкл</font>');
}
Объекты класса:
CallMethod('AlarmGlobal.AlarmRun');
//playSound('slipknot');CallMethod('AlarmGlobal.AlarmRun');CallMethod('AlarmGlobal.AlarmRun');
say(gg('AlarmOne.AlarmNote'));say('Пора вставать! ',1);
if (gg('AlarmGlobal.weather') == 'Да') {
say('Температура в доме '.round(gg('Sensor_temp01.value')).'.');
say('Температура за окном '.round(gg('Sensor_temp02.value')).', влажность '.round(gg('Sensor_humidity01.value')).'. '.gg('ow_fact.weather_type'),1);
say('Прогноз на сегодня '.gg('ow_day0.roundtemp').'. '.gg('ow_day0.weather_type'),1);
}
Свойства класса:
Методы класса:
$this->setProperty('volumeLevel',$params['NEW_VALUE']);
if (IsWindowsOs()) {
$volume=round(65535*$params['NEW_VALUE']/100);
safe_exec('..\\apps\\nircmd\\nircmdc setsysvolume '.$volume);
} else {
safe_exec('amixer sset PCM,0 '.$params['NEW_VALUE'].'%');
}
Объекты класса:
$command=$params['command']; $short_command='';
say("Отключено питание");$filename = ROOT . '/database_backup/db.sql';
$mysqlDumpPath = "/usr/bin/mysqldump";
$mysqlDumpParam = " --user=" . DB_USER . " --password=" . DB_PASSWORD;
$mysqlDumpParam .= " --no-create-db --add-drop-table --databases " . DB_NAME;
if (file_exists($filename)) rename($filename, $filename . '.prev');
exec($mysqlDumpPath . $mysqlDumpParam . " > " . $filename);
say("Подготовка к перезагрузке",2);
setTimeout("shutdownTimer","safe_exec('shutdown -r now');",15);
$filename = ROOT . '/database_backup/db.sql';
$mysqlDumpPath = "/usr/bin/mysqldump";
$mysqlDumpParam = " --user=" . DB_USER . " --password=" . DB_PASSWORD;
$mysqlDumpParam .= " --no-create-db --add-drop-table --databases " . DB_NAME;
if (file_exists($filename)) rename($filename, $filename . '.prev');
exec($mysqlDumpPath . $mysqlDumpParam . " > " . $filename);
say("Подготовка к выключению",2);
setTimeout("shutdownTimer","safe_exec('shutdown -h now');",15);
say('Система загружена', 2);
$data=trim(exec("cat /proc/cpuinfo | grep Serial | cut -d ':' -f 2"));
$data=ltrim($data,'0');
echo $data;
if ($data) {
setGlobal("ThisComputer.Serial",$data);
}
$res=exec('hostname -I');
//say("Ай-пи адрес ".$res,2);
exec('sudo mount /mnt/mywd');Методы класса:
Объекты класса:
sg('Gmail.checked',timenow());
$user = getGlobal('Gmail.login'); // имя пользователя
$pass = getGlobal('Gmail.pass'); // пароль
$data_file="https://$user:$pass@mail.google.com/mail/feed/atom";
$xml = simplexml_load_file($data_file); // раскладываем xml на массив
$unread=$xml->fullcount;
sg('Gmail.unread',$unread);
Свойства класса:
Методы класса:
$objects=getObjectsByClass("Devices");
foreach($objects as $obj) {
$obj->setProperty('updatedTime', date('Y-m-d H:i', time()));
$online = $obj->getProperty('online');
$User = $obj->getProperty('linkedUser');
if ($online == 1) {
$this->setProperty('status', 'Включен');
$this->setProperty('statusColor', 'green');
} else {
$this->setProperty('status', 'Выключен');
$this->setProperty('statusColor', 'red');
}
//Описываем присутствие
if ($User) {
if ($online == 1) {
$UserPresence = gg($User . '.online') + 1;
sg($User . '.online', $UserPresence);
} else {
$UserPresence = gg($User . '.online') - 1;
if ($UserPresence < 0) {
sg($User . '.online', 0);
} else {
sg($User . '.online', $UserPresence);
}
}
}
}
//Статистика
if ($this->getProperty('statistic') == 1) {
$this->callMethodSafe('statistic');
}
//Озвучка
if ($this->getProperty('voice') == 1) {
$this->callMethodSafe('voice');
}Свойства класса:
Методы класса:
//$params["USER_OBJECT"]
//$params["USER_OBJECT"]
Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty('roundtemp', round($this->getProperty('temperature'),0));Объекты класса:
Методы класса:
$updateTime = gg("yt_settings.updateTime");
if($updateTime > 0){
$count = gg("yt_settings.countTime");
if($count >= $updateTime){
include_once(DIR_MODULES."app_yatraffic/app_yatraffic.class.php");
$app_yatraffic=new app_yatraffic();
$app_yatraffic->get_traffic(gg("yt_settings.reg_id"));
sg("yt_settings.countTime",1);
} else {
$count++;
sg("yt_settings.countTime",$count);
}
}include_once(DIR_MODULES."app_yatraffic/app_yatraffic.class.php");
$app_yatraffic=new app_yatraffic();
$app_yatraffic->get_traffic(gg("yt_settings.reg_id"));Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty('updated',time());
$this->setProperty('updatedTime',date('H:i'));
if ($this->getProperty('active')) {
$this->callMethod("activate");
say($this->getProperty('title').' активирован.', -1);
} else {
$this->callMethod("deactivate");
say($this->getProperty('title').' деактивирован.', -1);
}Объекты класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/darknessmode_activate.php');
/* end injection of {SDevices} */
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/darknessmode_deactivate.php');
/* end injection of {SDevices} */
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/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/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/Rooms_onActivity.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/Rooms_onIdle.php');
/* end injection of {SDevices} */Объекты класса:
$val='';
$val .='<div style="font-size: 19px; border-radius: 5px; padding:2px; padding-top:3px; padding-bottom:3px; border: 1px solid #444;
display:inline-block;vertical-align:top;"><i class="fa fa-tachometer" aria-hidden="true" style="font-size: 21px"></i> '.gg('Sensor_pressure01.value').'</div>';
$val .='<div style="font-size: 19px; border-radius: 5px; padding:2px; padding-top:3px; padding-bottom:3px; border: 1px solid #444;
display:inline-block;"><i class="fa fa-sun-o" aria-hidden="true" style="font-size: 21px"></i> '.gg('Sensor_light01.value').'</div>';
$this->setProperty('deviceString', $val);
$val='';
if(gg('Relay12.status')){
$val .='<img src="/cms/icons/fan.png" class="spiner" style="width:32px; height:32px;">';
}
if(gg('Relay11.status')){
$val .='<i class="fa fa-lightbulb-o" aria-hidden="true"></i>';
}
$this->setProperty('deviceString', $val);$val='';
if(gg('Openclose01.status')){
$val .='<img src="/cms/scenes/styles/common/i_door_on.png" class="blinker" style="width:32px; height:32px;">';
}
$this->setProperty('deviceString', $val);$val='';
if(gg('Relay08.status')){
$val .='<i class="fa fa-lightbulb-o" aria-hidden="true"></i>';
}
if(gg('Relay09.status')){
$val .='<i class="fa fa-lightbulb-o" aria-hidden="true"></i>';
}
$this->setProperty('deviceString', $val);$val='';
if(gg('Relay10.status')){
$val .='<i class="fa fa-lightbulb-o" aria-hidden="true"></i>';
}
$this->setProperty('deviceString', $val);Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SDevices_statusUpdated.php');
require(DIR_MODULES.'devices/SDevices_logicAction.php');
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SDevices_setUpdatedText.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SButtons_pressed.php');
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SCameras_motionDetected.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SCameras_updatePreview.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SCameras_takeSnapshot.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SCameras_takeSeries.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SControllers_turnOn.php');
require(DIR_MODULES.'devices/SControllers_turnOff.php');
require(DIR_MODULES.'devices/SControllers_switch.php');
Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SDimmers_levelUpdated.php');
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_levelUpdated.php');
/* end injection of {SDevices} */require(DIR_MODULES.'devices/SDimmers_turnOn.php');
require(DIR_MODULES.'devices/SDimmers_turnOff.php');
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_levelWorkUpdated.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/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} */Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
/* 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} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SThermostats_valueUpdated.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SThermostats_statusUpdated.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SThermostats_tempUp.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SThermostats_tempDown.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/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_turnOn.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SThermostats_turnOff.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SCounters_valueUpdated.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SCounters_valueWorkUpdated.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SCounters_refreshStats.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SLeak_statusUpdated.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SMotions_motionDetected.php');
Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php');
Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SSensors_valueUpdated.php');
$data = getHistoryAvg($this->object_title.'.value', strtotime("-5 hours"));
if($params['NEW_VALUE']>$data) {
$dynamic=2;
} elseif ($params['NEW_VALUE']<$data) {
$dynamic=1;
} else {
$dynamic=0;
}
sg($this->object_title.'.dynamic', $dynamic);
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SSensors_valueUpdated.php');
/* end injection of {SDevices} */Свойства класса:
Объекты класса:
sg('ow_ws.humidity', $params['NEW_VALUE']);
sg('ow_ws.dt', time());Свойства класса:
Объекты класса:
Объекты класса:
Свойства класса:
Методы класса:
/* 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} */Объекты класса:
sg('ow_ws.pressure', $params['NEW_VALUE']);runscript('pressure');
cm('Ulica.deviceStringRef');Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/STempHumSensors_valueUpdated.php');
/* end injection of {SDevices} */Объекты класса:
sg('ow_ws.temperature', $params['NEW_VALUE']);//debmes('prop updated '.gg('Sensor_temp01.value'));
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SSmoke_statusUpdated.php');
/* end injection of {SDevices} */Свойства класса:
Свойства класса:
Свойства класса:
Свойства класса:
Свойства класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_mute-unmute.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_volume.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_pause-unpause.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_next.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_previous.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_seeknext.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_seekprevious.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_stop.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_playUrl.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaRenderer_playNextUrl.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMediaServer_getFileList.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
require(DIR_MODULES.'sys_states/sys_states.inc.php');
Объекты класса:
$details=array();
$red_state=0;
$yellow_state=0;
$cycles=array('states'=>'Цикл проверки статусов','main'=>'Основной цикл','execs'=>'Цикл приложений', 'scheduler'=>'Цикл планировщика');
/*foreach($cycles as $k=>$v) {
$tm=getGlobal('ThisComputer.cycle_'.$k.'Run');
if (time()-$tm>5*60) {
$red_state=1;
$details[]=$v." ".LANG_GENERAL_STOPPED.".";
}
}
$cycles=array('ping'=>'Цикл пинга','webvars'=>'Цикл веб-переменных','rss'=>'Новостной цикл');
foreach($cycles as $k=>$v) {
$tm=getGlobal('ThisComputer.cycle_'.$k.'Run');
if (time()-$tm>10*60) {
$yellow_state=1;
$details[]=$v." ".LANG_GENERAL_STOPPED.".";
}
}
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.".",1);
say(implode(". ",$details),1);
} else {
say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title,1);
}
$this->callMethod('stateChanged');
}*/
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/system_checkstate.php');
/* end injection of {SDevices} *//*$details=array();
$red_state=0;
$yellow_state=0;
if (!isOnline('nas')) {
$yellow_state=1;
$details[]="Недоступно сетевое хранилище";
}
if (!isOnline('network')) {
$yellow_state=1;
$details[]="Нет доступа в интернет";
}
if (!isOnline('router')) {
$red_state=1;
$details[]="Не доступно сетевое подключение";
}
if ($red_state) {
$state='red';
$state_title=LANG_GENERAL_RED;
} elseif ($yellow_state) {
$state='yellow';
$state_title=LANG_GENERAL_YELLOW;
} else {
$state='green';
$state_title=LANG_GENERAL_GREEN;
}
$new_details=implode(". ",$details);
if ($this->getProperty("stateDetails")!=$new_details) {
$this->setProperty('stateDetails',$new_details);
}
if ($this->getProperty('stateColor')!=$state) {
$this->setProperty('stateColor',$state);
$this->setProperty('stateTitle',$state_title);
if ($state!='green') {
say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title.".",1);
say(implode(". ",$details),1);
} else {
say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title,1);
}
$this->callMethod('stateChanged');
}*/$details=array();
$red_state=0;
$yellow_state=0;
if ($red_state) {
$state='red';
$state_title=LANG_GENERAL_RED;
} elseif ($yellow_state) {
$state='yellow';
$state_title=LANG_GENERAL_YELLOW;
} else {
$state='green';
$state_title=LANG_GENERAL_GREEN;
}
$new_details=implode(". ",$details);
if ($this->getProperty("stateDetails")!=$new_details) {
$this->setProperty('stateDetails',$new_details);
}
if ($this->getProperty('stateColor')!=$state) {
$this->setProperty('stateColor',$state);
$this->setProperty('stateTitle',$state_title);
if ($state!='green') {
say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title.".",1);
say(implode(". ",$details),1);
} else {
say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title,1);
}
$this->callMethod('stateChanged');
}Свойства класса:
Методы класса:
//$m=date('i',time());
//if (substr($m, -1)=='0') {
// setTimeOut('torr','callMethod(\'torrent.check\');',5);
//}
//setTimeOut('srv','callMethod(\'server.check\');',10);
if(substr(date('i',time()), -1)==0) {
if(timeBetween(date('H:i', gg('ow_fact.sunset')), date('H:i', gg('ow_fact.sunrise'))) && gg('DarknessMode.active')!=1) {
sg('DarknessMode.active', 1);
} elseif(timeBetween(date('H:i', gg('ow_fact.sunrise')), date('H:i', gg('ow_fact.sunset'))) && gg('DarknessMode.active')==1) {
sg('DarknessMode.active', 0);
}
}if(timeIs('03:00')) {rs('maintenance');}Объекты класса:
Свойства класса:
Методы класса:
if($this->getProperty('seenAt')=='Дом') {
If($params['NEW_VALUE']<$this->getProperty('BattMin')) {
say($this->description.', у вашего смартфона низкий уровень заряда. Рекомендую поставить на зарядку.',1);
}
If($params['NEW_VALUE']==100) {
If($this->getProperty('RemCount')==1) say('Ваш телефон полностью заряжен.',1); $this->setProperty('RemCount', 2);
} else {
$this->getProperty('RemCount', 1);
}
}
if ($this->getProperty('Charging')==1) {$bpic='plug'; $bcol='rgb(0, 255, 0)';}
elseif ($params['NEW_VALUE']==100) {$bpic='battery-full'; $bcol='rgb(0, 255, 0)';}
elseif ($params['NEW_VALUE']>=75) {$bpic='battery-three-quarters'; $bcol='rgb(0, 255, 0)';}
elseif ($params['NEW_VALUE']>=50) {$bpic='battery-half'; $bcol='rgb(0, 255, 0)';}
elseif ($params['NEW_VALUE']>=25) {$bpic='battery-quarter'; $bcol='yellow';}
else {$bpic='battery-empty'; $bcol='red';}
$this->setProperty('BattPic', $bpic);
$this->setProperty('BattColor', $bcol);//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
Объекты класса:
© 2026 SJLab | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Публичный договор
SmartLiving