Свойства класса:
Методы класса:
$volume=round(65535*$params['VALUE']/100); $this->setProperty('volumeLevel',$params['VALUE']); safe_exec('..\\apps\\nircmd\\nircmdc setsysvolume '.$volume); say("Изменилась громкость до ".$params['VALUE']." процентов");
Объекты класса:
say("Отключено питание");
Свойства класса:
Методы класса:
$this->setProperty('LastRun',date('Y-m-d H:i:s'));
$name='Cron_'.$this->object_title; SQLExec("DELETE FROM jobs WHERE title='".$name."'");
Объекты класса:
include(DIR_MODULES . 'backup/backup.class.php'); $backup_module = new backup(); $backup_module->create_backup();
Свойства класса:
Методы класса:
Объекты класса:
//Код для счетчика с импульсным выходом //Единица измерения: м3 $LitrValue = $this->getProperty('Value'); //Записываем текущее потребление в свойство с историей $this->setProperty('CurrentConsumption',$LitrValue/100); //Записываем новое значение в свойство "виртуального счетчика" (нарастающий итог) $this->setProperty('МeterReading',$this->getProperty('МeterReading')+$LitrValue/100); //Передаем значение в счетчик ХВС для отображение на сайте setGlobal('ColdWaterCounter.value',$this->getProperty('МeterReading')); //Обнуляем значение счетчика на порту file_get_contents("http://10.24.1.51/sec/?pt=15?&cnt=0");
Свойства класса:
Методы класса:
$this->setProperty("uptime", $params["UPTIME"]); $this->setProperty("rxbytes", $params["RXBYTES"]); $this->setProperty("txbytes", $params["TXBYTES"]); $this->setProperty("router", $params["ROUTER"]); $this->setProperty("net", $params["NET"]); $this->setProperty("frequency", $params["FREQ"]); $this->setProperty("mode", $params["WIFI_MODE"]); $this->setProperty("rssi", $params["RSSI"]);
Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty('active',0);
$this->setProperty('active',1);
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); if ($this->getProperty('active')) { say("Режим ".$this->getProperty('title')." активирован."); } else { say("Режим ".$this->getProperty('title')." выключен."); }
Объекты класса:
setGlobal('minMsgLevel','2'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_activate.php'); /* end injection of {SDevices} */
setGlobal('minMsgLevel','1');
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_activate.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/econommode_activate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_deactivate.php'); /* end injection of {SDevices} */
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
$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'].")"; } else { $res_rooms=array(); for($i=0;$i<$total;$i++) { if ($rooms[$i]['active']) { $res_rooms[]=$rooms[$i]['room']; } } $somebodyHomeText="Кто-то дома: ".implode(", ",$res_rooms); } setGlobal('somebodyHomeText',$somebodyHomeText); //echo "Updated"; /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php'); /* end injection of {SDevices} */
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_batteryLevelUpdated.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_logicAction.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_keepAlive.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_takeSeries.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_updatePreview.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/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/SAirConditioners_valueUpdated.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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_setFanSpeedMode.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_setTargetTemperature.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_stopLevelMove.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_startLevelDown.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_startLevelUp.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/SDimmers_turnOn.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_levelUpdated.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_setLevel.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_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_turnOn.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_pause.php'); /* end injection of {SDevices} */
/* 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} */
Методы класса:
Объекты класса:
//Меняем статус управления системой на "ручной" setGlobal('GeneralHall_LightingSystemControl.Status',2); say('Меняем статус управления системой на "ручной');
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOff'); say('Свет в прихожей выключен switch'); } else { $this->callMethod('turnOn'); say('Свет в прихожей включен switch'); }
$this->setProperty(«status»,0); say('Свет в прихожей выключен');
//$this->setProperty("status",1); setGlobal('GeneralHall.Light'.'.'.'status', '1'); say('Свет в прихожей включен');
Свойства класса:
Методы класса:
/* 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/SRGB_setColor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_colorUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_checkWindows.php'); /* end injection of {SDevices} */
/* 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_modeTargetValueUpdated.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_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_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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_setTargetTemperature.php'); /* end injection of {SDevices} */
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_setChannel.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_setVolume.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_setSource.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_pause.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* 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} */
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroupStates_restore.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroupStates_save.php'); /* end injection of {SDevices} */
Свойства класса:
Свойства класса:
Методы класса:
/* 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} */
Свойства класса:
Методы класса:
/* 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} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions2_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions2_motionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions2_unblockSensor.php'); /* end injection of {SDevices} */
Объекты класса:
//$stat=$this->getProperty("status"); //if ($stat) { // callMethod('GeneralHall.Light.turnOff'); //setGlobal('GeneralHall.Light'.'.'.'status', '0'); //say ('status updated off'); //} else { //callMethod('GeneralHall.Light.turnOn'); //setGlobal('GeneralHall.Light'.'.'.'status', '1'); //say ('status updated on'); //}
//Узнаем статус управления системой освещения в общей прихожей $LSCStatus = getGlobal('GeneralHall_LightingSystemControl'.'.'.'status'); if ($LSCStatus == '0') { //say('Освещение отключено, свет не включаем!'); } else { if (getGlobal('GeneralHall_LightingSystemControl'.'.'.'status') == '1') { //say('Включен автоматический режим управления светом'); if (timeBetween(getGlobal('ow_fact'.'.'.'sunset'), getGlobal('ow_fact'.'.'.'sunrise'))) { $stat=$this->getProperty("status"); if ($stat) { //say('Время ночь, есть движение, включаем свет'); setGlobal('GeneralHall.Light'.'.'.'status', '1'); //say('Обновляем время последнего движения'); $this->setProperty("LastMotionTime",time()); //Запустим таймер (1 мин), по истечении которого свет будет выключен ClearTimeOut("LightOffTimer"); SetTimeOut ("LightOffTimer","setGlobal('GeneralHall.Light'.'.'.'status', '0');",60*1); } else { //say('Время ночь, нет движения, выключаем свет'); //setGlobal('GeneralHall.Light'.'.'.'status', '0'); } } else { $stat=$this->getProperty("status"); if ($stat) { //Время день, есть движение //Обновляем время последнего движения $this->setProperty("LastMotionTime",time()); } else { //Время день, нет движения } } } else { //Включен ручной режим управления светом //say('Включен ручной режим управления светом'); //Обновляем время последнего движения $this->setProperty("LastMotionTime",time()); } }
Свойства класса:
Методы класса:
/* 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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_open.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_close.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_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php'); /* end injection of {SDevices} */
Объекты класса:
//Узнаем статус управления системой освещения в общей прихожей $LSCStatus = getGlobal('GeneralHall_LightingSystemControl'.'.'.'status'); if ($LSCStatus == '0') { //say('Освещение отключено, свет не включаем!'); } else { if (getGlobal('GeneralHall_LightingSystemControl'.'.'.'status') == '1') { //say('Включен автоматический режим управления светом'); if (timeBetween(getGlobal('ow_fact'.'.'.'sunset'), getGlobal('ow_fact'.'.'.'sunrise'))) { $stat=$this->getProperty("status"); if ($stat) { //say('Время ночь, есть движение, включаем свет'); setGlobal('GeneralHall.Light'.'.'.'status', '1'); //say('Обновляем время последнего движения'); $this->setProperty("LastMotionTime",time()); //Запустим таймер (1 мин), по истечении которого свет будет выключен ClearTimeOut("LightOffTimer"); SetTimeOut ("LightOffTimer","setGlobal('GeneralHall.Light'.'.'.'status', '0');",60*1); } else { //say('Время ночь, нет движения, выключаем свет'); //setGlobal('GeneralHall.Light'.'.'.'status', '0'); } } else { $stat=$this->getProperty("status"); if ($stat) { //Время день, есть движение //Обновляем время последнего движения $this->setProperty("LastMotionTime",time()); } else { //Время день, нет движения } } } else { //Включен ручной режим управления светом //say('Включен ручной режим управления светом'); //Обновляем время последнего движения $this->setProperty("LastMotionTime",time()); } }
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_alert.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_unblockSensor.php'); /* end injection of {SDevices} */
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
/* 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} */
Свойства класса:
Методы класса:
/* 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/STempHumSensors_valueUpdated.php'); /* end injection of {SDevices} */
Объекты класса:
sg('Bedroom_Thermostat.value',($this->getProperty('Value')));
Объекты класса:
$boilertempvalue = $this->getProperty("value"); if ($boilertempvalue != 'CRC-error') { $boilerpumpstatus = getGlobal('BoilerRoom_HotWaterPump'.'.'.'status'); if ($boilertempvalue < '35') { if ($boilerpumpstatus == '0') { say('Температура воды в бойлере меньше 35, начинаю греть воду'); setGlobal('BoilerRoom_HotWaterPump'.'.'.'status', '1'); } } if ($boilertempvalue > '40') { if ($boilerpumpstatus == '1') { say('Температура воды в бойлере достигла 40, отключаю нагрев воды'); setGlobal('BoilerRoom_HotWaterPump'.'.'.'status', '0'); } } }
Объекты класса:
setGlobal('ElectricInput220.status',$this->getProperty('normalValue')); $this->setProperty('Status',$this->getProperty('normalValue'));
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_statusUpdated.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_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_unblockSensor.php'); /* end injection of {SDevices} */
Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty('Status',0);
$this->setProperty('Status',1);
$this->setProperty('Status',2);
Объекты класса:
Свойства класса:
Методы класса:
Объекты класса:
$details=array(); $red_state=0; $yellow_state=0; if (!isOnline('Internet')) { $yellow_state=1; $details[]=LANG_GENERAL_NO_INTERNET_ACCESS; } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
$details=array(); $red_state=0; $yellow_state=0; $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'); 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 ($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)); } else { say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $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 ($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'); }
Свойства класса:
Методы класса:
Объекты класса:
// раскидываем дату и время если изменилось в Windows $h=(int)date('G',time()); if (gg('ThisComputer.DateD')!=date("d", time())) { $day[0]="воскресенье"; $day[1]="понедельник"; $day[2]="вторник"; $day[3]="среда"; $day[4]="четверг"; $day[5]="пятница"; $day[6]="суббота"; $month[1]="января"; $monthAlt[1]="ЯНВАРЬ"; $month[2]="февраля"; $monthAlt[2]="ФЕВРАЛЬ"; $month[3]="марта"; $monthAlt[3]="МАРТ"; $month[4]="апреля"; $monthAlt[4]="АПРЕЛЬ"; $month[5]="мая"; $monthAlt[5]="МАЙ"; $month[6]="июня"; $monthAlt[6]="ИЮНЬ"; $month[7]="июля"; $monthAlt[7]="ИЮЛЬ"; $month[8]="августа"; $monthAlt[8]="АВГУСТ"; $month[9]="сентября"; $monthAlt[9]="СЕНТЯБРЬ"; $month[10]="октября"; $monthAlt[10]="ОКТЯБРЬ"; $month[11]="ноября"; $monthAlt[11]="НОЯБРЬ"; $month[12]="декабря"; $monthAlt[12]="ДЕКАБРЬ"; sg("ThisComputer.DateD",date( "d", time())); sg("ThisComputer.DateM",date( "m", time())); sg("ThisComputer.DateY",date( "Y", time())); sg("ThisComputer.DateNow",date( "d.m.Y", time())); sg("ThisComputer.DayOfWeek",$day[date("w")]); sg("ThisComputer.Month",$month[date("n")]); sg("ThisComputer.MonthAlt",$monthAlt[date("n")]); }
####################################################################### # Проверка времени выполнения кода # # для проверки раскоментируйте строки в начале и в конце # ####################################################################### //debmes('Запускаю onNewMinute'); //Timer::start(); ####################################################################### # Заполняем свойство ThisComputer.timeNow текущим временем # ####################################################################### sg('timeNow',date('H:i')); ####################################################################### # В переменную $h ставим текущий час, в $m - минуту # # разнесем отдельно часы от минут и заполним ThisComputer.timeH и M # ####################################################################### //Получаем переменную час $h=(int)date('G',time()); //Получаем переменную минута $m=date('i',time()); //Заполним свойство часы отдельно sg("ThisComputer.timeH", $h); //Заполним свойство минуты отдельно sg("ThisComputer.timeM", $m); //Выделим и заполним десятки и единицы часов и минут sg("ThisComputer.timeH1",$H[0]); sg("ThisComputer.timeH2",$H[1]); sg("ThisComputer.timeM1",$M[0]); sg("ThisComputer.timeM2",$M[1]); ####################################################################### # Заготовка под какое-либо действие с выходным днем # ####################################################################### # if (isWeekDay()) {// Если рабочий день # } # # Или например если в рабочие дни, время 17:00, и включен эко режим # if (isWeekDay() && timeIs("17:00") && (gg("EconomMode.active")=="1")) { # say("Скоро пользователи с работы прийдут, отключаю эко режим"); # callMethod('EconomMode.deactivate'); #} ####################################################################### ####################################################################### # Если время ровно 00 и после 7 утра, и дома кто-то есть, глобальная # # настройка clockChimeEnabled разрешена, тогда проговариваем время # ####################################################################### // Если время =00минут if ($m=="00") { // Если больше или равно 7 часам и говорить время можно if (($h>=7) && gg('clockChimeEnabled')) { // Если режим никого нет дома выключен if (gg('NobodyHomeMode.active') == '0'){ //Сказать время с параметром важности сообщения =1(днем говорит, ночью - только в лог) say(timeNow(),1); // rs('NoScript');//Заготовка запуска скрипта NoScript // rs('NoScript');//Заготовка запуска скрипта NoScript // rs('NoScript');//Заготовка запуска скрипта NoScript // rs('NoScript');//Заготовка запуска скрипта NoScript } } } ####################################################################### # Заполняем свойство ThisComputer.HomeStatus # # текущим временем и текстом Дома никого или Дома кто-то есть # # также показания системных статусов безопасность, система, интернет # # (эта надпись показывается на главной страничке в меню) # ####################################################################### $homeStatus=date('H:i');// Присваиваем переменной $homeStatus текущее время if (gg('NobodyHomeMode.active')) {//Если активен режим NobodyHomeMode $homeStatus.=' Дома никого';//Добавляем к переменной Дома никого // rs('NoScript');//Заготовка запуска скрипта NoScript } else { $homeStatus.=' Дома кто-то есть';//Иначе добавляем Дома кто-то есть // rs('NoScript');//Заготовка запуска скрипта NoScript } $homeStatus.=' '.gg('Security.stateDetails');//свойство статуса безопасности $homeStatus.=' '.gg('System.stateDetails');//свойство статуса системы $homeStatus.=' '.gg('Communication.stateDetails');//свойство статуса сети sg('HomeStatus',$homeStatus);//Сцепляем свойство с переменной и заполняем в ThisComputer.HomeStatus ####################################################################### # Включаем и выключаем режим темного времени суток DarknessMode # # в зависимости от времени суток и данных восхода/заката # ####################################################################### //Проверим Если время между рассветом и закатом и свойство темно равно 1 if (timeBetween(gg('SunRiseTime'),gg('SunSetTime')) && gg('isDark')=="1") { //Изменим свойство на светло sg("isDark",0); //Запустим метод деактивации режима Темное время суток cm('DarknessMode.deactivate'); // rs('NoScript');//Заготовка запуска скрипта NoScript //Иначе Проверим время между рассветом и закатом и свойство темно не равно 1 } elseif (!timeBetween(gg('SunRiseTime'),gg('SunSetTime')) && gg('isDark')!="1") { //Изменим свойство на темно sg("isDark",1); //Запустим метод активации режима Темное время суток cm('DarknessMode.activate'); // rs('NoScript');//Заготовка запуска скрипта NoScript } //Если время совпало со свойством рассвет if (timeIs(gg('SunRiseTime'))) { //Произнести фразу Восходит солнце say('Восходит солнце'); // rs('NoScript');//Заготовка запуска скрипта NoScript } //Если время совпало со свойством закат if (timeIs(gg('SunSetTime'))) { //Произнести фразу Солнце заходит с параметром важности сообщения =2(днем и ночью произносит) say('Солнце заходит',2); // rs('NoScript');//Заготовка запуска скрипта NoScript } ####################################################################### # Активация режима экономии EconomMode # ####################################################################### //Если никого нет дома, экономный режим выключен и время 23:30 if (timeIs("23:30") && (gg("EconomMode.active")!="1") && (gg("NobodyHomeMode.active")=="1")) { //Произнести Похоже никого нет сегодня, можно сэкономить немного. say("Похоже никого нет сегодня, можно сэкономить немного."); //Запустить метод активации эконом режима cm('EconomMode.activate'); // rs('NoScript');//Заготовка запуска скрипта NoScript } ####################################################################### # Активация деактивация ночного режима NightMode # ####################################################################### //Если время NightModeStart if (timeIs(getGlobal('NightModeStart'))) { //Запустить метод активации ночного режима cm('NightMode.activate'); // rs('NoScript');//Заготовка запуска скрипта NoScript //Иначе если время NightModeEnd } elseif (timeIs(getGlobal('NightModeEnd'))) { //Запустить метод деактивации режима cm('NightMode.deactivate'); // rs('NoScript');//Заготовка запуска скрипта NoScript } ####################################################################### # Запуск обслуживания системы # ####################################################################### //Если время 03:33 if (timeIs("03:33")) { //Запустить скрипт оптимизации rs("systemMaintenance"); // rs('NoScript');//Заготовка запуска скрипта NoScript } ####################################################################### # Проверка времени выполнения кода # ####################################################################### //debmes ("Время выполнения onNewMinute: ".Timer::finish()." сек.\n\r"); ####################################################################### # Подсчет оплаты электроэнергии # ####################################################################### if (getGlobal('EnergyCounter'.'.'.'valueMonth') > 700) { setGlobal('ElectricityPrice'.'.'.'NowMonthPrice', round(getGlobal('EnergyCounter'.'.'.'valueMonth') * getGlobal('ElectricityPrice'.'.'.'AboveSocialNorms'),2)); setGlobal('ElectricityPrice'.'.'.'NowDayPrice', round(getGlobal('EnergyCounter'.'.'.'valueDay') * getGlobal('ElectricityPrice'.'.'.'AboveSocialNorms'),2)); } else { setGlobal('ElectricityPrice'.'.'.'NowMonthPrice', round(getGlobal('EnergyCounter'.'.'.'valueMonth') * getGlobal('ElectricityPrice'.'.'.'SocialNorms'),2)); setGlobal('ElectricityPrice'.'.'.'NowDayPrice', round(getGlobal('EnergyCounter'.'.'.'valueDay') * getGlobal('ElectricityPrice'.'.'.'SocialNorms'),2)); } ####################################################################### # Подсчет оплаты воды # ####################################################################### setGlobal('WaterPrice'.'.'.'NowMonthPrice', round(getGlobal('ColdWaterCounter'.'.'.'valueMonth') * getGlobal('WaterPrice'.'.'.'CarrentTariff'),2)); setGlobal('WaterPrice'.'.'.'NowDayPrice', round(getGlobal('ColdWaterCounter'.'.'.'valueDay') * getGlobal('WaterPrice'.'.'.'CarrentTariff'),2)); ####################################################################### # Заполняем восход и заход солнца # ####################################################################### sg("ThisComputer.SunSetTime", gg('ow_fact.sunset')); sg("ThisComputer.SunRiseTime", gg('ow_fact.sunrise'));
Свойства класса:
Методы класса:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
Объекты класса:
, Россия
© 2025 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Публичный договор
SmartLiving