Свойства класса:
Методы класса:
$status = $this->getProperty('AlarmOn');
if ($status == 1)
$this->setProperty('AlarmOn', 0);
else
$this->setProperty('AlarmOn', 1);# include_once(DIR_MODULES . 'telegram/telegram.class.php');
#$telegram_module = new telegram();
#$telegram_module->sendMessageToUser(127671419, "Позвонить в карандаш!");
cm("Relay01.turnOff");Свойства класса:
Методы класса:
$volume=round(65535*$params['VALUE']/100);
$this->setProperty('volumeLevel',$params['VALUE']);
safe_exec('..\\apps\\nircmd\\nircmdc setsysvolume '.$volume);
say("Изменилась громкость до ".$params['VALUE']." процентов");Свойства класса:
Методы класса:
$this->setProperty('LastRun',date('Y-m-d H:i:s'));$name='Cron_'.$this->object_title;
SQLExec("DELETE FROM jobs WHERE title='".$name."'");Свойства класса:
Методы класса:
say("111");
$d = date('j');
$energy = getProperty('Pzem-004.energy');
$hist = getHistoryValue('Pzem-004.energyDay', strtotime('yesterday'));
if($hist) {
$energyDaily = $energy - $hist;
setProperty('Pzem-004.energyDaily', round($energyDaily, 3));
}
setProperty('Pzem-004.energyDay', $energy);
Свойства класса:
Методы класса:
//$params["USER_OBJECT"]
//$params["USER_OBJECT"]
Свойства класса:
Методы класса:
//$params['t']
$this->setProperty("updated",time());
$this->setProperty("updatedTime",date("H:i",time()));
$this->setProperty("alive",1);
$ot=$this->object_title;
$alive_timeout=(int)$this->getProperty("aliveTimeOut");
if (!$alive_timeout) {
$alive_timeout=30*60;
}
clearTimeOut($ot."_alive");
setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);
if (!isset($params['h'])) {
return;
}
$old_temp=$this->getProperty('humidity');
$t=round($params['h'],1);
if ($t>100) return;
$this->setProperty('humidity',$t);
if ($params['uptime']) {
$this->setProperty('uptime',$params['uptime']);
}
if ($t>$old_temp) {
$d=1;
} elseif ($t<$old_temp) {
$d=-1;
} else {
$d=0;
}
$this->setProperty('direction',$d);
$linked_room=$this->getProperty("LinkedRoom");
if ($linked_room) {
setGlobal($linked_room.'.Humidity',$t);
}Свойства класса:
Методы класса:
if ($params['status']) {
$this->setProperty('status',$params['status']);
}
$this->setProperty('updatedTimestamp',time());
$this->setProperty("alive",1);
$ot=$this->object_title;
$alive_timeout=(int)$this->getProperty("aliveTimeOut");
if (!$alive_timeout) {
$alive_timeout=12*60*60;
}
clearTimeOut($ot."_alive");
setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);Свойства класса:
Методы класса:
$this->setProperty('status',$params['status']); // выставляем статус сенсора
$this->setProperty('updatedTimestamp',time()); // выставляем время срабатывания сенсора
$this->setProperty('alive',1);
$ot=$this->object_title;
$alive_timeout=(int)$this->getProperty("aliveTimeOut");
if (!$alive_timeout) {
$alive_timeout=24*60*60;
}
clearTimeOut($ot."_alive");
setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);
if ($params['status']) {
$this->setProperty('motionDetected',1);
clearTimeOut($this->object_title.'_detected');
setTimeOut($this->object_title.'_detected',"setGlobal('".$this->object_title.".motionDetected',0);",30);
$linked_room=$this->getProperty('LinkedRoom');
if ($linked_room!='') {
callMethod($linked_room.'.onActivity');
}
if ($this->object_title=='sensorMovement3' || $this->object_title=='sensorMovementRemote1' || $this->object_title=='sensorMovementRemote2') {
//|| $this->object_title=='sensorMovement5'
return; // не реагируем на движение в спальне, по ip-сенсорам и по сенсору на втром этаже
}
ClearTimeOut("nobodyHome");
SetTimeOut("nobodyHome","callMethod('NobodyHomeMode.activate');", 1*60*60); // выполняем если целый час никого не было
if (getGlobal('NobodyHomeMode.active')) {
callMethod('NobodyHomeMode.deactivate');
}
$last_register=registeredEventTime('inhouseMovement'); // проверяем когда в последний раз срабатывало событие "движение внутри дома"
registerEvent('inhouseMovement',$this->name,2); // регистрируем событие "движение внутри дома"
if (timeBetween('05:00', '12:00') && ((time()-$last_register)>2*60*60)) {
runScript('Greeting'); // запускаем скрипт "доброе утро"
}
}Свойства класса:
Методы класса:
$this->setProperty("updated", time());
$this->setProperty("updatedTime", date('H:i'));
if ($this->getProperty('active')) {
//say("Режим " . $this->getProperty('title') . " активирован.");
} else {
//say("Режим " . $this->getProperty('title') . " выключен.");
}$this->setProperty('active', 1);$this->setProperty('active' ,0);Свойства класса:
Методы класса:
$status=$this->getProperty("status");
if ($status) {
$this->callMethod('turnOn');
} else {
$this->callMethod('turnOff');
}$status=$this->getProperty("status");
if ($status) {
$this->callMethod('turnOff');
} else {
$this->callMethod('turnOn');
}$this->setProperty("status",0);$this->setProperty("status",1);Свойства класса:
Методы класса:
$cmdline='"c:\Program Files\nooLite\nooLite.exe" -api '.$params['command'];
$last_called=gg('NoolightCommandSend');
$min_delay=3;
$now=time();
if (($now-$last_called)>$min_delay) {
//safe_exec($cmdline);
$last_callled=$now;
sg('NoolightCommandSend',$last_called);
DebMes("Noolite instant exec: ".$cmdline);
system($cmdline);
//exec($cmdline);
} else {
if ($last_callled<$now) {
$last_callled=$now;
}
$last_called+=$min_delay;
sg('NoolightCommandSend',$last_called);
DebMes("Noolite scheduled job for ".date('H:i:s',$last_called));
AddScheduledJob("noolight".md5($cmdline),"safe_exec('".$cmdline."');",$last_called);
}
$this->setProperty("status",0);
//safe_exec('"c:\Program Files\nooLite\noolite.exe" -api -off_ch'.$this->getProperty("channel"));
$this->callMethod("sendCommand",array('command'=>'-off_ch'.$this->getProperty("channel")));$this->setProperty("status",1);
$this->callMethod("sendCommand",array('command'=>'-on_ch'.$this->getProperty("channel")));Свойства класса:
Методы класса:
$code1=$this->getProperty('Code1');
$code2=$this->getProperty('Code2');
safe_exec("c:\_majordomo\apps\arduino_gw\arduino_gw.exe rcon$code1:$code2;");
$this->setProperty("status",1);$code1=$this->getProperty('Code1');
$code2=$this->getProperty('Code2');
safe_exec("c:\_majordomo\apps\arduino_gw\arduino_gw.exe rcoff$code1:$code2;");
$this->setProperty("status",0);Свойства класса:
Методы класса:
$install = $this->getProperty('install');
$esp_ip = $this->getProperty('ip');
if ($install == 'left') {
#$data = getURL("http://" . $esp_ip . "/gpio?pin=197&st=0", 0);
$this->setProperty("step1", -70000);
}
else {
#$data = getURL("http://" . $esp_ip . "/gpio?pin=197&st=1", 0);
$this->setProperty("step1", 70000);
}
$this->setProperty('position', 70000);$esp = $this->getProperty('esp');
$esp_ip = gg($esp . '.wanip');
$auto = $this->getProperty('auto');
if ($auto == 1) {
$data = getURL("http://" . $esp_ip . "/gpio?pin=6&st=0");
$this->setProperty('auto', 0);
}
else {
$data = getURL("http://" . $esp_ip . "/gpio?pin=6&st=1");
$this->setProperty('auto', 1);
$this->callMethod("automatic");
}$esp = $this->getProperty('esp');
$esp_ip = gg($esp . '.wanip');
$data = getURL("http://" . $esp_ip . "/gpio?pin=196", 0);$install = $this->getProperty('install');
$esp_ip = $this->getProperty('ip');
if ($install == 'left') {
#$data = getURL("http://" . $esp_ip . "/gpio?pin=197&st=1", 0);
$this->setProperty("step", 70000);
}
else {
#$data = getURL("http://" . $esp_ip . "/gpio?pin=197&st=0", 0);
$this->setProperty("step", -70000);
}
$this->setProperty('position', 0);$light_open = $this->getProperty('light_open');
$light_close = $this->getProperty('light_close');
$light = "Sensor_light" . $this->getProperty('sensor_light') . ".value";
$light_north = round(getHistoryAvg($light, time()-10*60, time()));
$light_south = round(getHistoryAvg($light, time()-10*60, time()));
#say($light_south);
$time_open = $this->getProperty('time_open');
$time_close = $this->getProperty('time_close');
$auto = $this->getProperty('auto');
if ($auto == 0) {
if (time() >= $this->getProperty('auto_time_off')) {
$this->setProperty('auto', 1);
}
}
if (timeBetween($time_close, $time_open)) {
if ($auto == 1) {
$this->callMethod("close");
}
}
else {
if ($light_south >= $light_close) {
if ($auto == 1) {
$this->callMethod("close");
}
}
elseif ($light_south < $light_open) {
if ($auto == 1) {
$this->callMethod("open");
}
}
}$this->setProperty('position', 70000);$this->setProperty('position', 0);$auto = $this->getProperty('auto');
if ($auto == 1) {
$this->setProperty('auto_time_off', '');
}
else {
$this->setProperty('auto_time_off', time() + 4*60*60);
}
Свойства класса:
Методы класса:
$latestActivity=$this->getProperty('LatestActivity');
$this->setProperty('LatestActivity',time());
$this->setProperty('LatestActivityTime',date('H:i'));
$this->setProperty('SomebodyHere',1);
$ot=$this->object_title;
if ($this->getProperty("IdleDelay")) {
$activity_timeout=(int)$this->getProperty("IdleDelay");
} else {
$activity_timeout=10*60;
}
clearTimeOut($ot."_activity_timeout");
setTimeOut($ot."_activity_timeout","callMethod('".$ot.".onIdle');",$activity_timeout);
$this->callMethod("updateActivityStatus");
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/Rooms_onActivity.php');
/* end injection of {SDevices} */$this->setProperty('SomebodyHere',0);
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/Rooms_onIdle.php');
/* end injection of {SDevices} */$rooms=getObjectsByClass("Rooms");
$total=count($rooms);
for($i=0;$i<$total;$i++) {
$rooms[$i]['room']=getGlobal($rooms[$i]['TITLE'].'.Title');
if (!$rooms[$i]['room']) {
$rooms[$i]['room']=$rooms[$i]['TITLE'];
}
$rooms[$i]['active']=getGlobal($rooms[$i]['TITLE'].'.SomebodyHere');
$rooms[$i]['time']=getGlobal($rooms[$i]['TITLE'].'.LatestActivity');
$rooms[$i]['diff']=time()-$rooms[$i]['time'];
}
function rooms_cmp($a, $b)
{
if ($a['diff'] == $b['diff']) {
return 0;
}
return ($a['diff'] < $b['diff']) ? -1 : 1;
}
usort($rooms,"rooms_cmp");
if (!$rooms[0]['active']) {
$somebodyHomeText="Никого нет дома. Были в ".date('H:i',$rooms[0]['time'])." (".$rooms[0]['room'].")";
if (gg("NobodyHomeMode.active") != 1)
sg("NobodyHomeMode.active", 1);
} else {
$res_rooms=array();
for($i=0;$i<$total;$i++) {
if ($rooms[$i]['active']) {
$res_rooms[]=$rooms[$i]['room'];
}
}
$somebodyHomeText="Кто-то дома: ".implode(", ",$res_rooms);
if (gg("NobodyHomeMode.active") != 0)
sg("NobodyHomeMode.active", 0);
}
setGlobal('somebodyHomeText',$somebodyHomeText);
//echo "Updated";
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SDevices_statusUpdated.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_logicAction.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SButtons_pressed.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* 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} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SControllers_turnOn.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SControllers_turnOff.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SControllers_switch.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_levelUpdated.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_levelWorkUpdated.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_turnOn.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_turnOff.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/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} */Свойства класса:
Методы класса:
if ($params['VALUE'] == 'ON') {
$this->setProperty('status', 1);
}
elseif ($params['VALUE'] == 'OFF') {
$this->setProperty('status', 0);
}
else {
$this->setProperty('status', $params['VALUE']);
}/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SMotions_motionDetected.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SSensors_valueUpdated.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SBatterySensors_valueUpdated.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_valueVoltageUpdated.php');
/* end injection of {SDevices} *//* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SBatterySensors_valueUpdated.php');
/* end injection of {SDevices} */Свойства класса:
Свойства класса:
Свойства класса:
Методы класса:
/* 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} */Методы класса:
/* begin injection of {SDevices} */
require(DIR_MODULES.'devices/SSmoke_statusUpdated.php');
/* end injection of {SDevices} */Свойства класса:
Методы класса:
Свойства класса:
Методы класса:
//$params['t']
$this->setProperty("updated",time());
$this->setProperty("updatedTime",date("H:i",time()));
$this->setProperty("alive",1);
$ot=$this->object_title;
$alive_timeout=(int)$this->getProperty("aliveTimeOut");
if (!$alive_timeout) {
$alive_timeout=30*60;
}
clearTimeOut($ot."_alive");
setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);
if (!isset($params['t'])) {
return;
}
$old_temp=$this->getProperty('temp');
$t=round($params['t'],1);
if ($t>110) return;
$this->setProperty('temp',$t);
if ($params['uptime']) {
$this->setProperty('uptime',$params['uptime']);
}
if ($t>$old_temp) {
$d=1;
} elseif ($t<$old_temp) {
$d=-1;
} else {
$d=0;
}
$this->setProperty('direction',$d);
$linked_room=$this->getProperty("LinkedRoom");
if ($linked_room) {
setGlobal($linked_room.'.Temperature',$t);
}Свойства класса:
Методы класса:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
Свойства класса:
, Россия
© 2026 SJLab | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Публичный договор
SmartLiving