Свойства класса:
Методы класса:
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>'); }
Объекты класса:
if (isWeekEnd()){ // сегодня выходной день // все проснулись setGlobal("SleepAllMode.active",0); say('Пора вставать!'); // включим радио cm("RadioSetting.Control", array("play")); // запланируем выключить радио SetTimeOut("AlarmWeekEnd_RadioStop",'cm("RadioSetting.Control", array("stop"));', 60*60); }
if (isWeekDay()){ // сегодня рабочий день // все проснулись setGlobal("SleepAllMode.active",0); say('Пора вставать!'); // включим радио cm("RadioSetting.Control", array("play")); // запланируем выключить радио SetTimeOut("AlarmWeekEnd_RadioStop",'cm("RadioSetting.Control", array("stop"));', 60*60); }
// это однократный будильник, выключаем его sg("AlarmOne.AlarmOn",0); // все проснулись setGlobal("SleepAllMode.active",0); say('Пора вставать!'); // включим радио cm("RadioSetting.Control", array("play")); // запланируем выключить радио через 1 час SetTimeOut("AlarmOne_RadioStop",'cm("RadioSetting.Control", array("stop"));', 3600);
Свойства класса:
Методы класса:
$user = $this->getproperty('object_description'); if ($this->getproperty('online') == "ON") { sg('Kitchen.User', $user); } if ($this->getproperty('online') == "OFF") { sg('Kitchen.User', ""); }
//sg('Kitchen.User', "");
$user = $this->getproperty('object_description'); if ($this->getproperty('online') == "ON") { sg('Bedroom.User', $user); } if ($this->getproperty('online') == "OFF") { sg('Bedroom.User', ""); }
Объекты класса:
Свойства класса:
Методы класса:
$volume=round(65535*$params['VALUE']/100); $this->setProperty('volumeLevel',$params['VALUE']); safe_exec('amixer -c 0 set Master '.$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."'");
Объекты класса:
rs('проверка бокса');
rs('Выпить таблетки');
runscript('Проверка маршрута до работы');
getURL('http://localhost/modules/app_PostTracker/check_track.php',0);
runScript('Статусы автомобиля');
cm('System.checkState');
Свойства класса:
Методы класса:
//$params["USER_OBJECT"]
//$params["USER_OBJECT"]
Объекты класса:
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty('active',1);
$this->setProperty('active',0);
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); if ($this->getProperty('active')) { if ($this->getProperty('VoiceHistory') == 0) { say("Режим ".$this->getProperty('title')." активирован.",1); $this->setproperty('VoiceHistory',1); }} else { if ($this->getProperty('VoiceHistory') == 1) { say("Режим ".$this->getProperty('title')." выключен.",1); $this->setproperty('VoiceHistory',0); }}
Объекты класса:
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_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/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} */
If (gg('EconomMode.active') == 1) { /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_deactivate.php'); /* end injection of {SDevices} */ }
Методы класса:
Объекты класса:
/* 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} */
Свойства класса:
Методы класса:
$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} */
$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} */
$objectsRooms=getObjectsByClass("Rooms"); $time=date('H:i'); foreach($objectsRooms as $obj) { $user = getGlobal($obj['TITLE'].".User"); $location = getGlobal($obj['TITLE'].".Title"); if ($user == "Богдан"){ sg("Neverend.Location",$location); sg("Neverend.LocateUpdated",$time); cm($obj['TITLE'].".onActivity"); sg($obj['TITLE'].".User",""); SetTimeOut("ClearAdminLocation","sg('Neverend.Location','');", 10*60); SetTimeOut("ClearAdminLocateUpdated","sg('neverend.LocateUpdated','');", 10*60); } else if ($user == "Наташа"){ sg("Nata.Location",$location); sg("Nata.LocateUpdated",$time); cm($obj['TITLE'].".onActivity"); sg($obj['TITLE'].".User",""); SetTimeOut("ClearNataLocation","sg('Nata.Location','');", 10*60); SetTimeOut("ClearNataLocateUpdated","sg('Nata.LocateUpdated','');", 10*60); } }
Объекты класса:
Свойства класса:
Методы класса:
/* 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/SDevices_keepAlive.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_batteryLevelUpdated.php'); /* end injection of {SDevices} */ $title = $this->getproperty('object_description'); if ($this->getproperty('batterywarning') == 1) { say(' низкий уровень заряда батареи ' .$title, 1);}
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SButtons_pressed.php'); /* end injection of {SDevices} */
Объекты класса:
sg('Button01.status',1); settimeout('timer','sg("Button01.status",0);',6000);
Свойства класса:
Методы класса:
/* 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_switch.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_turnOn.php'); /* end injection of {SDevices} */
if ($this->getProperty('PowerYandexAlice') == 1 && $this->getProperty('Status') == '1') { say('Не могу сделать, потому что устройство активно', 1); } if ($this->getProperty('PowerYandexAlice') == 1 && $this->getProperty('Status') == '0') { $this->callMethod('turnOn'); } if ($this->getProperty('PowerYandexAlice') == 0 && $this->getProperty('Status') == '0') { say('Устройство уже закрыто или выключено', 1); } if ($this->getProperty('PowerYandexAlice') == 0 && $this->getProperty('Status') == '1') { $this->callMethod('turnOff'); }
if ($this->getproperty('WindowsPowerYandexAlice') == 1) { $this->setproperty('PowerYandexAlice',0); } if ($this->getproperty('WindowsPowerYandexAlice') == 0) { $this->setproperty('PowerYandexAlice',1); }
Свойства класса:
Методы класса:
/* 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} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_valueUpdated.php'); /* end injection of {SDevices} */
Объекты класса:
$a = getURLBackground('192.168.3.26/ajax/xiaomimiio.html?op=test_api_cmd&dip=192.168.3.93&dtoken=0ec48c5dbc4607887f99051735ad30ae&dcmd=get_properties&dopt=[{"did":"X","siid":2,"piid":6,"value":true}],"id":123'); $pieces = explode(" ", $a); say($pieces,0);
getURLBackground('192.168.3.26/ajax/xiaomimiio.html?op=test_api_cmd&dip=192.168.3.93&dtoken=0ec48c5dbc4607887f99051735ad30ae&dcmd=set_properties&dopt=[{"did":"X","siid":2,"piid":2,"value":true}],"id":123');
getURLBackground('192.168.3.26/ajax/xiaomimiio.html?op=test_api_cmd&dip=192.168.3.93&dtoken=0ec48c5dbc4607887f99051735ad30ae&dcmd=set_properties&dopt=[{"did":"X","siid":2,"piid":2,"value":false}],"id":123');
Свойства класса:
Методы класса:
/* 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/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_setLevel.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_statusUpdated.php'); /* end injection of {SDevices} */
if ($this->getproperty('backlight') == 0) { $this->setproperty('status',0); }
Объекты класса:
Свойства класса:
Методы класса:
/* 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_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_setSource.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_pause.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
if ($this->getproperty('mOpenClose') == 1) { $this->setproperty('OpenClose', 'open') ; //$this->setproperty('status', 1) ; } if ($this->getproperty('mOpenClose') == 0) { $this->setproperty('OpenClose', 'close'); //$this->setproperty('status', 0) ; }
say('Звонят', 2); sg('XiRgb01.ringtone','10');
$ot = $this->object_title; // название объекта $message = $this->getProperty('initiative_message'); // берём из свойства объекта, который привязан к модулю tuya $dop = '"]]}'; // дописываем недостающие символы иначе json получается битый sg($ot.'.initiative_message_d',base64_decode($message).$dop); // вставляем в свойство декодированное сообщение // дальше если нужно. декодируем и разбираем сообщение по параметрам и вставляем в свойства $base = base64_decode($message).$dop; // декодируем из base64 и добавляем недостающие символы // должны получить такую строку //{"v":"4.0","bucket":"ty-eu-storage30","cmd":"ipc_motion","type":"image","with":"resource","alarm":true,"time":1682386398,"files":[["/052910-12289210-szjs5ad413616ba205b3/unify/1682386398.jpeg"]]} должны получить такую строку //----------------------- Вытягиваем данные $json = json_decode($base, true); $ver = $json['v']; //$bucket = $json['bucket']; $cmd = $json['cmd']; $type = $json['type']; $with = $json['with']; //$alarm = $json['alarm']; //$time = $json['time']; $files = $json['files'][0]['0']; //----------------------- Записываем данные в свойства объекта sg($ot.'.v',$ver); //sg($ot.'.bucket',$bucket); sg($ot.'.cmd',$cmd); sg($ot.'.type',$type); //sg($ot.'.alarm',intval($alarm)); //sg($ot.'.time',date('H:i:s d-m-Y', $time)); sg($ot.'.file',$files); // ----------------------------------запускаем аларм метод if ($cmd == "ipc_doorbell") { $this->callMethod('activedorbell'); }
Объекты класса:
$this->setProperty('mode','large'); $this->setProperty('countdown','cancel'); $this->setProperty('switchled',1); $this->setProperty('colormode','colour'); $this->setProperty('color','f000f0012cfff0');
if (gg("Day.isWeekDay") == 1) { if (timeBetween('02:00', '6:59')) { SetTimeOut("openclose", 'sg("TuRelay09.openclose", "open");', strtotime("07:00")-time()); } else { sg("TuRelay09.openclose", "open");} }
if (gg("Day.isWeekDay") == 1) { sg('TuRelay09.openclose', "close"); }
$shutdown = shell_exec("/usr/bin/net rpc shutdown -t 10 -f -C shutdown -U grifi%Pincher26081992 -I 192.168.3.5 ");
sg('xirelay11.status',0); Settimeout('xirelay', "sg('xirelay11.status',1);", 3);
$shutdown = shell_exec("sudo -S shutdown -r now");
Свойства класса:
Методы класса:
/* 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} */
Объекты класса:
if (timeBetween("06:00", "22:00")) { $this->setproperty('color','ffffff'); } if (timeBetween("22:00", "06:00")) { $this->setproperty('color','ff00ea'); }
$this->setProperty('status',1); $this->setProperty('ct',6500); $this->setProperty('bright',100); //$this->setProperty('flow','0,2,"50,2,6500,100,50,2,6500,100"');
Свойства класса:
Методы класса:
$this->setproperty('CheckState','light'); $this->setproperty('Nightlight',0);
if ($this->getproperty('nightlight') == 1) { $this->setproperty('CheckState','Nightlight'); } if ($this->getproperty('CheckState') == 'Nightlight') { if ($this->getproperty('Nightlight') == 0) { $this->setproperty('status',0); }}
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOff.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_setTargetTemperature.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/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/STVs_setVolume.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_setChannel.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
$id = $this->getProperty('id'); if ($this->getProperty('mWakefulness') == 'Awake') { $this->setProperty('status', 1); if ($id == 13) { Stvpoweron('192.168.3.15'); } if ($id == 12) { TuyaIR('bfcfefe95d8d8e50cfciaa', 'power'); } } if (($this->getProperty('mWakefulness') == 'Asleep') || ($this->getProperty('mWakefulness') == 'Dreaming')) { $this->setProperty('status', 0); if ($id == 13) { Stvpoweroff('192.168.3.15'); } if ($id == 12) { TuyaIR('bfcfefe95d8d8e50cfciaa', 'power'); } }
if ($this->getproperty('APP') == 'com.netflix.ninja/.MainActivity') { $this->callmethod('turnOff'); }
$id = $this->getProperty('id'); if ($this->getProperty('status') == "1"){ callAPI('/api/module/adbcontrol','GET',array('id'=>$id, 'op'=>'shell','data'=>'am start -n "com.android.systemui/.Somnambulator"')); }
$ip = $this->getProperty('ip'); $id = $this->getProperty('id'); if ($this->getProperty('status') == "0"){ rs('ADBconnect', array('ip'=>$ip)); rs ('ADBkeyevent', array('keyevent'=>20,'ip'=>$ip)); // enter //$this->setProperty('channel_num',2); settimeout('tventer', "rs ('ADBkeyevent', array('keyevent'=>20,'ip'=>$ip));",6); // enter }
Объекты класса:
say('тв ключился умным домом',1);
$ip = $this->getProperty('ip'); $app = $this->getProperty('channel_num'); if ($app == 1) { $app = "com.liskovsoft.videomanager"; } if ($app == 2) { $app = "com.readyforsky.gateway"; } $command = 'adb -s '.$ip.':5555 shell monkey -p '.$app.' -c android.intent.category.LAUNCHER 1 2> /var/www/readings.txt'; exec($command);
$ip = $this->getProperty('ip'); $vol = $this->getProperty ('volume'); $command = 'adb -s '.$ip.':5555 shell service call audio 7 i32 3 i32 '.$vol.' i32 1> /var/www/readings.txt'; exec($command);
$vol = $this->getProperty ('volume'); $volfact = $this->getProperty ('volfact'); if ($volfact !=$vol) {setGlobal("androidtv.vol",$volfact);}
$gsource = $this->getProperty('source_num'); if ($gsource == "one") { $source = 1; } if ($gsource == "two") { $source = 2; } if ($gsource == "three") { $source = 3; } if ($gsource == "four") { $source = 4; } if ($gsource == "five") { $source = 5; } TuyaIR('bfcfefe95d8d8e50cfciaa', 'hdmi'.$source);
sg('TuRelay14.status',0);
sg('TuRelay14.status',1);
$ip = $this->getProperty('ip'); $app = $this->getProperty('channel_num'); rs('ADBapp', array('app'=>$app,'ip'=>$ip));
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SVacuums_pause.php'); /* end injection of {SDevices} */
sg('Vacuum01.boxtype',0);
Объекты класса:
Свойства класса:
Методы класса:
/* 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/SCounters_pulseDetected.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/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/SMotions_motionDetected.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_unblockSensor.php'); /* end injection of {SDevices} */
if ($this->getProperty('pir') == 'pir') { $this->setproperty('status',1); } elseif ($this->getProperty('pir') == 'none') { $this->setproperty('status',0); }
Объекты класса:
Свойства класса:
Методы класса:
/* 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/SOpenable_levelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_setLevel.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} */
Свойства класса:
Методы класса:
/* 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/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} */
Свойства класса:
Методы класса:
// $params["NAME"]; - Имя Терминала // $params["MESSAGE"]; - сообщение // $params["ERROR"]; - тип ошибки // $params["IMPORTANCE"]; - важность сообщения // $params["ORIGINAL_OBJECT_TITLE"]; - привязанный обьект // $this->username; - Привязанный Пользователь // $this->linkedRoom; - привязанное помещение
$terminal_name=gg($this->object_title.".name"); setMessageVolume($terminal_name, $params["volume"]);
Объекты класса:
Свойства класса:
Методы класса:
$this->setproperty('armyandex',0);
SQLUpdate("objects", array("ID"=>$this->id, "DESCRIPTION"=>gg("sysdate")." ".gg("timenow")));
$this->setproperty('armyandex',1);
If ($this->getproperty('armyandex') == 1) { include_once(DIR_MODULES.'starline/starline.class.php'); $starline_module = new starline(''); $starline_module->startarm2('869310065660469'); } If ($this->getproperty('armyandex') == 0) { include_once(DIR_MODULES.'starline/starline.class.php'); $starline_module = new starline(''); $starline_module->stoparm2('869310065660469'); }
If ($this->getproperty('ignyandex') == 1) { include_once(DIR_MODULES.'starline/starline.class.php'); $starline_module = new starline(''); $starline_module->startign2('869310065660469'); } If ($this->getproperty('ignyandex') == 0) { include_once(DIR_MODULES.'starline/starline.class.php'); $starline_module = new starline(''); $starline_module->stopign2('869310065660469'); }
Объекты класса:
Свойства класса:
Методы класса:
Объекты класса:
$details=array(); $red_state=0; $yellow_state=0; $cycles=array('states'=>'states','main'=>'main','execs'=>'exec','scheduler'=>'scheduler','tuya_iot'=>'туя'); 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."."; // setGlobal('ThisComputer.cycle_tuya_iotControl','start'); } } $cycles=array('ping'=>'ping'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>10*60) { $yellow_state=1; } } /* $cycles=array('tuya_iot'=>'туя'); foreach($cycles as $k=>$v) { a: $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>10*60) { $yellow_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; setGlobal('ThisComputer.cycle_tuya_iotControl','start'); goto a; } } */ 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 (!isOnline('Internet')) { $yellow_state=1; $details[]=LANG_GENERAL_NO_INTERNET_ACCESS; } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
$details=array(); $red_state=0; $yellow_state=0; if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
Свойства класса:
Методы класса:
// раскидываем дату и время если изменилось в 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")]); }
Объекты класса:
$h=(int)date('G',time()); $m=date('i',time()); if (isWeekDay()) { } if (($h>=8) && getGlobal('clockChimeEnabled')) { if ($m=="00") { say(timeNow(),1); } } setGlobal('timeNow',date('H:i')); $homeStatus=date('H:i'); if (getGlobal('NobodyHomeMode.active')) { $homeStatus.=' Дома никого'; } else { $homeStatus.=' Дома кто-то есть'; } $homeStatus.=' '.getGlobal('Security.stateDetails'); $homeStatus.=' '.getGlobal('System.stateDetails'); $homeStatus.=' '.getGlobal('Communication.stateDetails'); setGlobal('HomeStatus',$homeStatus); if (timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')=="1") { setGlobal("isDark",0); callMethod('DarknessMode.deactivate'); } elseif (!timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')!="1") { setGlobal("isDark",1); callMethod('DarknessMode.activate'); } if (timeIs(getGlobal('SunRiseTime'))) { say('Всходит солнце',1); } if (timeIs(getGlobal('SunSetTime'))) { say('Солнце заходит',1); } if (timeIs("23:30") && (gg("EconomMode.active")!="1") && (gg("NobodyHomeMode.active")=="1")) { say("Похоже никого нет сегодня, можно сэкономить немного."); callMethod('EconomMode.activate'); } if (timeIs('23:00') && gg('Day.isWeekDay') == 0) { //выходные callMethod('NightMode.activate'); } elseif (timeIs('09:00') && gg('Day.isWeekDay') == 0) { callMethod('NightMode.deactivate'); } if (timeIs('22:00') && gg('Day.isWeekDay') == 1) { //будние callMethod('NightMode.activate'); } elseif (timeIs('07:00') && gg('Day.isWeekDay') == 1) { callMethod('NightMode.deactivate'); } if (timeIs("03:00")) { runScript("systemMaintenance"); } if (gg('ThisComputer.AlarmStatus') && timeIs(gg('ThisComputer.AlarmTime'))) { runScript('MorningAlarm'); } // получем ЧАСЫ и МИНУТЫ отдельно $timeH=date("H", time()); $timeM=date("i", time()); sg("ThisComputer.timenowH",$timeH); sg("ThisComputer.timenowM",$timeM); //будильник $objects=getObjectsByClass("AlarmClock"); foreach($objects as $obj) { // переберем все будильники в системе if (getGlobal($obj['TITLE'].".AlarmOn") && timeIs(getGlobal($obj['TITLE'].".AlarmTime"))){ //если будильник включен и время совпало callMethod($obj['TITLE'].".AlarmRun"); // выполним метод будильника } }
// раскидываем дату и время если изменилось в 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")]); }
Свойства класса:
Методы класса:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
$this->setproperty('amazfitsleep',1);
if (gg('Neverend.atWiFi') == 1 || gg('Nata.atWiFi') == 1 ) { sg('статусвыходаиздома.status', 1) ; } if (gg('Neverend.atWiFi') == 2 && gg('Nata.atWiFi') == 2 ) { // Если Богдана и Наты нет дома //say('Богдан с Наташей вышли из дома',1); if (gg('статусвыходаиздома.status') == 1) { callMethod('EconomMode.activate'); $last_register = registeredEventTime('vacuum'); //узнаем время регистрации евента if ($last_register == '-1' || (time() - $last_register) >= 82800) { say('запускаю пылесос',1); sg('Vacuum01.mode','vacuum'); callMethod('Vacuum01.turnOn'); callMethod('Vacuum01.turnOn'); registerEvent('vacuum', $this->description, 1); $i = gg('vacuum01.turnupdate'); $i = $i + 1; sg('Vacuum01.turnupdate', $i); sg('статусвыходаиздома.status', 2) ; } } } if (gg('Neverend.atWiFi') == 2 && gg('Nata.atWiFi') == 2 && gg('ydaw.atWiFi') == 2) { // Вообще никого нет дома say('Похоже никого нет дома',1); /* callMethod('EconomMode.activate'); $last_register = registeredEventTime('vacuum'); //узнаем время регистрации евента if ($last_register == '-1' || (time() - $last_register) >= 82800) { say('запускаю пылесос',1); callMethod('Vacuum01.turnOn'); registerEvent('vacuum', $this->description, 1); $i = gg('vacuum01.turnupdate'); $i = $i + 1; sg('Vacuum01.turnupdate', $i); } */ }
$title = $this->getproperty('object_description'); if (($this->getproperty('BattLevel') == 100) && ($this->getproperty('VoiceHistory')) == 0) { $this->setproperty('VoiceHistory', 1); say("Батарея " .$title. " заряжена",1); } if ($this->getproperty('BattLevel') != 100) { $this->setproperty('VoiceHistory', 0); }
$sleep = $this->getproperty('amazfitsleep'); $room = $this->getproperty('Location'); $home = $this->getproperty('seenAt'); if ($home == "Дом") { // делаем только, если дома if ($sleep == 1) { //если человек спит if ($room == 'Кухня') { //если это кухня $volume=exec("amixer -c 0 set Master 0"); sg('XiMotion02.blocked', 1); sg('Rgb04.status',0); sg('androidtv.volume',3); } if ($room == 'Bedroom') { callAPI('/api/module/yadevices','GET',array('station'=>4,'command'=>'setVolume','volume'=>0.0)); sg('samsung.volume',3); } } if ($sleep == 0) { if ($room == 'Кухня') { $volume=exec("amixer -c 0 set Master 20"); sg('XiMotion02.blocked', 0); sg('Rgb04.status',1); sg('androidtv.volume.status',7); } if ($room == 'Bedroom') { sg('samsung.volume',7); } if ($home != "Дом") { // если уже дома $volume=exec("amixer -c 0 set Master 20"); sg('XiMotion02.blocked', 0); sg('Rgb04.status',1); } } }
$this->setproperty('amazfitsleep',0);
Объекты класса:
Методы класса:
/* include_once(DIR_MODULES."app_yatraffic/app_yatraffic.class.php"); $app_yatraffic=new app_yatraffic(); $app_yatraffic->get_traffic(gg("yt_settings.reg_id")); */ //Регион $myRegion = '10761'; // пишем свой регион //Получаем данные от Яндекса $getYandex = simplexml_load_string(file_get_contents('https://export.yandex.ru/bar/reginfo.xml?region='.$myRegion)); $getYandex = json_decode(json_encode($getYandex), TRUE); //Уровень пробок от 1 до 9 $trafficBall = $getYandex["traffic"]["region"]["level"]; sg("yt_info.level",$trafficBall); //Текстовый статус, зеленый, желтый, красный (На инглише) $trafficColor = $getYandex["traffic"]["region"]["icon"]; sg("yt_info.icon",$trafficColor); sg('yt_info.color_level','<font color='.$trafficColor.'>'.gg('yt_info.level').'</font>'); //Текстовое оповещение - Дороги почти свободны $trafficText = $getYandex["traffic"]["region"]["hint"][0]; sg("yt_info.val",$trafficText); //Время последнего обновления $trafficTime = $getYandex["traffic"]["region"]["time"]; sg("yt_info.time",$trafficTime); // $trafficTend = $getYandex["traffic"]["region"]["tend"]; sg("yt_info.tend",$trafficTend); //Название города $trafficSity = $getYandex["region"]["title"]; sg("yt_info.city_title",$trafficSity);
//$content = file_get_contents(DIR_MODULES."app_yatraffic/time_to_job.php"); ob_start(); require(DIR_MODULES."app_yatraffic/time_to_job.php"); $content = ob_get_contents(); ob_end_clean(); sg("to_job.time",$content);
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_statusUpdated.php'); /* end injection of {SDevices} */
Объекты класса:
Свойства класса:
Методы класса:
if ($this->getProperty('NightlightYandexAlice') == 1) { $this->setProperty('Nightlight', 'ON'); } else if ($this->getProperty('NightlightYandexAlice') == 0) { $this->setProperty('Nightlight', 'OFF'); }
if ($this->getProperty('Status') == '0') { $this->setProperty('updated', time()); $this->setProperty("updatedTime",date('H:i')); $this->callMethodSafe('mUpdatedText'); $this->setProperty('Power', '0'); $this->setProperty('Mode', '1'); }
$KettleSetTemperature; $KettleSetTemperature = $this->getProperty('setTemperature'); if ($this->getProperty('Power') == 1) { if ($this->getProperty('Mode') == 1) { $this->setProperty('BoilHeat', 'ON'); } else if ($this->getProperty('Mode') == 2) { $this->setProperty('BoilHeat', $KettleSetTemperature); } else if ($this->getProperty('Mode') == 3) { $this->setProperty('Heat', $KettleSetTemperature); } } else if ($this->getProperty('Power') == 0 && $this->getProperty('Status') != '0') { $this->setProperty('BoilHeat', 'OFF'); }
if ($this->getProperty('ProgramStatus') == 2 && $this->getProperty('Program') == 0) { $this->setProperty('TextStatus', 'Boil'); $this->setProperty('ProgramStatusHistory', 'Boil'); } else if ($this->getProperty('ProgramStatus') == 2 && $this->getProperty('Program') == 2) { $this->setProperty('TextStatus', 'BoilHeat'); $this->setProperty('ProgramStatusHistory', 'BoilHeat'); } else if ($this->getProperty('ProgramStatus') == 2 && $this->getProperty('Program') == 1) { $this->setProperty('TextStatus', 'Heat'); $this->setProperty('ProgramStatusHistory', 'Heat'); } else if ($this->getProperty('ProgramStatus') != 0 && $this->getProperty('Program') == 3) { $this->setProperty('TextStatus', 'Nightlight'); $this->setProperty('ProgramStatusHistory', 'Nightlight'); } else if ($this->getProperty('ProgramStatus') == 0) { $this->setProperty('TextStatus', 'Off'); }
$valueTemperature; $valueTemperature = $this->getProperty('valueTemperature'); if ($valueTemperature >= 0 && $valueTemperature <= 30) { setGlobal('Button06.Icon03', 'KettleTemperature_0-30'); $this->setProperty('Images', 'KettleTemperature_CP_0-30'); } else if ($valueTemperature >= 31 && $valueTemperature <= 50) { setGlobal('Button06.Icon03', 'KettleTemperature_30-50'); $this->setProperty('Images', 'KettleTemperature_CP_30-50'); } else if ($valueTemperature >= 51 && $valueTemperature <= 65) { setGlobal('Button06.Icon03', 'KettleTemperature_50-65'); $this->setProperty('Images', 'KettleTemperature_CP_50-65'); } else if ($valueTemperature >= 66 && $valueTemperature <= 80) { setGlobal('Button06.Icon03', 'KettleTemperature_65-80'); $this->setProperty('Images', 'KettleTemperature_CP_65-80'); } else if ($valueTemperature >= 81 && $valueTemperature <= 90) { setGlobal('Button06.Icon03', 'KettleTemperature_80-90'); $this->setProperty('Images', 'KettleTemperature_CP_80-90'); } else if ($valueTemperature >= 91 && $valueTemperature <= 100) { setGlobal('Button06.Icon03', 'KettleTemperature_90-100'); $this->setProperty('Images', 'KettleTemperature_CP_90-100'); } if ($valueTemperature >= 90 && $valueTemperature <= 100 && /* $this->getProperty('ProgramStatusHistory') == 'Boil' && */ $this->getProperty('VoiceHistory') == '1') { say('Чайник вскипел', 1); $this->setProperty('VoiceHistory', '0'); } /* if ($valueTemperature >= 90) { registerEvent('water90', $this->description, 1); $water90 = registeredEventTime('water90'); $this->setproperty('watertime90',$water90); } if ($valueTemperature == 80) { registerEvent('water80', $this->description, 1); $water80 = registeredEventTime('water80'); $water90 = registeredEventTime('water90'); $water = $water80 - $water90; $this->setproperty('watertime80',$water80); $this->setproperty('watertime',$water); if ($water <= 819 && $water < 825 ) { $this->setproperty('waterproc', 25); } if ($water >= 825 && $water < 832 ) { $this->setproperty('waterproc', 50); } if ($water >= 832 && $water < 838) { $this->setproperty('waterproc', 75); } if ($water >= 838) { $this->setproperty('waterproc', 100); } } */
if ($this->getProperty('Online') == 'offline') { $this->setProperty('OnlineColor', 'FF4500'); } else if ($this->getProperty('Online') == 'online') { $this->setProperty('OnlineColor', '00FF00'); }
if ($this->getProperty('PowerYandexAlice') == 1) { $this->setProperty('Mode', '1'); $this->setProperty('Power', '1'); $this->setProperty('VoiceHistory', '1'); } else if ($this->getProperty('PowerYandexAlice') == 0) { $this->setProperty('Power', '0'); $this->setProperty('VoiceHistory', '0'); } if ($this->getProperty('PowerYandexAlice') == 1 && $this->getProperty('Status') == '2') { say('Не могу включить чайник, потому что чайник на данный момент включен', 1); } else if ($this->getProperty('PowerYandexAlice') == 0 && $this->getProperty('Status') == '0') { say('Не могу выключить чайник, потому что чайник на данный момент выключен', 1); }
$ot = $this->object_title; $updatedTime = $this->getProperty('updated'); $passed = time() - $updatedTime; $newTimeout = 0; $passedText = getPassedText($updatedTime); $this->setProperty('updatedText', $passedText); $this->setProperty('updatedNumber', $passed); if ($passed < 10) { $newTimeout = 10; } elseif ($passed < 60) { $newTimeout = 10; } elseif ($passed < 60*60) { $newTimeout = 60; } elseif ($passed < 20*60*60) { $newTimeout = 60 * 60; } if ($newTimeout > 0) { setTimeOut($ot . '_updateTime', 'callMethod("' . $ot . '.mUpdatedText");', $newTimeout); }
$color=hexdec($this->getproperty('NightlightColor')); $Red = $color >> 16 & 0xFF; $Green = $color >> 8 & 0xFF; $Blue = $color & 0xFF; $CmdRed=''.$Red.''; $CmdGreen=''.$Green.''; $CmdBlue=''.$Blue.''; $this->setproperty('Red',$CmdRed); $this->setproperty('Green',$CmdGreen); $this->setproperty('Blue',$CmdBlue);
$KettleSayTemp; $KettleSetTemperatureYandexAlice; $KettleSayTemp = implode('', array('На чайнике установлена температура подогрева на ',$this->getProperty('setTemperatureYandexAlice'),' градусов')); $KettleSetTemperatureYandexAlice = $this->getProperty('setTemperatureYandexAlice'); if ($KettleSetTemperatureYandexAlice >= 40) { $this->setProperty('setTemperature', $KettleSetTemperatureYandexAlice); $this->setProperty('Mode', '3'); $this->setProperty('Power', '1'); say($KettleSayTemp, 3); }
Объекты класса:
if ($this->getProperty('updatedNumber') >= 120) { $this->setProperty('VoiceHistory', '1'); } if ($this->getProperty('updatedNumber') >= 120 && $this->getProperty('Power') == 0 && $this->getProperty('NightlightLockOut') == 0) { if (gg("DarknessMode.active") == 0 && gg("NightMode.active") == 0 && $this->getProperty('Nightlight') == 'ON') { $this->setProperty('Nightlight', 'OFF'); } else if (gg("DarknessMode.active") == 0 && gg("NightMode.active") == 1 && $this->getProperty('Nightlight') == 'ON') { $this->setProperty('Nightlight', 'ON'); } else if (gg("DarknessMode.active") == 1 && gg("NightMode.active") == 1 && $this->getProperty('Nightlight') == 'OFF' && $this->getProperty('Status') == 0) { $this->setProperty('Nightlight', 'ON'); } }
, Россия
© 2025 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Публичный договор
SmartLiving