Свойства класса:
Методы класса:
Объекты класса:
if (getGlobal('Boiler.Fault') == "fault") { setGlobal('RGBKiderroom.status', 1); setGlobal('Mi_open_close_00'.'.'.'text', 'Котел не работает'); // say("Котел перестал работать",2); //setGlobal('Lumi_say_volume.State','60'); // setGlobal('Lumi_audio_play.state','"http://192.168.100.4/cms/sounds/airport-bell.mp3"'); sleep (4); //setGlobal('Lumi_audio_play.state','"STOP"'); sleep (3); //setGlobal('Lumi_say.say_state','{"text": "Что то с котлом, он перестал работать", "volume":80}'); } else if (getGlobal('Boiler.Fault') == "no fault") { setGlobal('Mi_open_close_00'.'.'.'text', 'Котел (работает)'); }
$Ht.= getGlobal('Boiler.HWlast_temp'); setGlobal('Boiler.HW_temp', $Ht); //
if (gg("Boiler.CentralHeatingmode") == 'heat'){ setGlobal('Boiler.CentralHeatingmode', 'off'); } else if (gg("Boiler.CentralHeatingmode") == 'off'){ setGlobal('Boiler.CentralHeatingmode', 'heat'); }
$Ct.= getGlobal('Boiler.Last_temp'); setGlobal('Boiler.Target_temperature', $Ct);
$Status_now_1.='греет'; $Status_now_2.='не греет'; $off = json_decode('"'.''.'"'); //D83C DF15 $on = json_decode('"'.'\u2668\ufe0f'.'"'); if (getGlobal('Boiler.CentralHeatingmode') == 'heat'){ setGlobal('Boiler.Status_now',$on); } else {setGlobal('Boiler.Status_now',$off);}
if (gg("Boiler.by_sensor") == '1'){ setGlobal('Boiler.by_sensor', '0'); } else if (gg("Boiler.by_sensor") == '0'){ setGlobal('Boiler.by_sensor', '1'); }
if (gg("Boiler.Auto") == '1'){ setGlobal('Boiler.Auto', '0'); } else if (gg("Boiler.Auto") == '0'){ setGlobal('Boiler.Auto', '1'); }
Свойства класса:
Методы класса:
$command=$params['command']; $short_command=''; $dt=recognizeTime($command,$short_command); if (preg_match('/скажи сколько врем/uis',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say('Сейчас '.timeNow(),2); } elseif (preg_match('/сколько время/uis',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята'); echo $short_command; return; } say('Сейчас '.timeNow()); } elseif (preg_match('/повтори (.+)/uis',$command,$m) || preg_match('/скажи (.+)/uis',$command,$m)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say($m[1],2); } else { say('Неизвестная команда...',2); }
Объекты класса:
$command=$params['command']; $short_command=''; $dt=recognizeTime($command,$short_command); if (preg_match('/скажи сколько врем/uis',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say('Сейчас '.timeNow(),2); } elseif (preg_match('/сколько время/uis',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята'); echo $short_command; return; } say('Сейчас '.timeNow()); } elseif (preg_match('/повтори (.+)/uis',$command,$m) || preg_match('/скажи (.+)/uis',$command,$m)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say($m[1],2); } else { say('Неизвестная команда...',2); }
Свойства класса:
Методы класса:
Объекты класса:
$all.=' '.getGlobal('All_livingroom.brightness'); setGlobal('RGBlivingroom_a.brightness',$all); setGlobal('RGBlivingroom_b.brightness',$all); setGlobal('RGBlivingroom_c.brightness',$all); //
if (gg('All_livingroom.status') == 1) { setGlobal("All_livingroom.status", 0); } else if (gg('All_livingroom.status') == 0) { setGlobal("All_livingroom.status", 1); }
if (gg('All_livingroom.status') == 1) { setGlobal("RGBlivingroom_a.status", 1); setGlobal("RGBlivingroom_b.status", 1); setGlobal("RGBlivingroom_c.status", 1); //say('Вас поняла,включаю свет в гостинной',2); //setGlobal('Lumi_say.say_state','{"text": "Вас поняла,включаю свет в гостинной"}'); } else if (gg('All_livingroom.status') == 0){ setGlobal("RGBlivingroom_a.status", 0); setGlobal("RGBlivingroom_b.status", 0); setGlobal("RGBlivingroom_c.status", 0); //say('Вас поняла,выключаю свет в гостинной',2); //setGlobal('Lumi_say.say_state','{"text": "Вас поняла,выключаю свет в гостинной"}'); }
$ct.=' '.getGlobal('All_livingroom.ct'); setGlobal('RGBLivingroom_a.ct',$ct); setGlobal('RGBLivingroom_b.ct',$ct); setGlobal('RGBLivingroom_c.ct',$ct);
if (getGlobal('All_livingroom.brightness') <> 100){ setGlobal('All_livingroom.brightness',100); setGlobal("All_livingroom.ct", 4000); } else if (getGlobal('All_livingroom.brightness') == 100){ setGlobal('All_livingroom.brightness',70); setGlobal("All_livingroom.ct",3500 ); }
if (gg('RGBKiderroom.status') == 1) { setGlobal("RGBKiderroom.status", 0); } else if (gg('RGBKiderroom.status') == 0) { setGlobal("RGBKiderroom.status", 1); }
if (gg('All_Kiderroom.status') == 1) { setGlobal("All_Kiderroom.status", 0); } else if (gg('All_Kiderroom.status') == 0) { setGlobal("All_Kiderroom.status", 1); }
$alk.=' '.getGlobal('All_Kiderroom.brightness'); setGlobal('philipsbulb_d0.brightness',$alk); setGlobal('philipsbulb_d1.brightness',$alk); setGlobal('philipsbulb_d2.brightness',$alk); //
if (gg('All_Kiderroom.status') == 1) { setGlobal("philipsbulb_d0.status", 1); setGlobal("philipsbulb_d1.status", 1); setGlobal("philipsbulb_d2.status", 1); //setGlobal("philips_bedroom.status", 1); //say('Вас поняла,включаю свет в гостинной',2); //setGlobal('Lumi_say.say_state','{"text": "Вас поняла,включаю свет в гостинной"}'); } else if (gg('All_Kiderroom.status') == 0){ setGlobal("philipsbulb_d0.status", 0); setGlobal("philipsbulb_d1.status", 0); setGlobal("philipsbulb_d2.status", 0); //setGlobal("philips_bedroom.status", 0); //say('Вас поняла,выключаю свет в гостинной',2); //setGlobal('Lumi_say.say_state','{"text": "Вас поняла,выключаю свет в гостинной"}'); }
$ct.=' '.getGlobal('All_Kiderroom.ct'); setGlobal('philipsbulb_d0.ct',$ct); setGlobal('philipsbulb_d1.ct',$ct); setGlobal('philipsbulb_d2.ct',$ct);
if (gg('All_ladder.status') == 1) { setGlobal("philips_light.bulb_ladder_n.status", 1); setGlobal("philips_light.bulb_ladder_v.status", 1); //say('Вас поняла,включаю свет в гостинной',2); //setGlobal('Lumi_say.say_state','{"text": "Вас поняла,включаю свет в гостинной"}'); } else if (gg('All_ladder.status') == 0){ setGlobal("philips_light.bulb_ladder_n.status", 0); setGlobal("philips_light.bulb_ladder_v.status", 0); //say('Вас поняла,выключаю свет в гостинной',2); //setGlobal('Lumi_say.say_state','{"text": "Вас поняла,выключаю свет в гостинной"}'); }
$snl.=' '.getGlobal('All_ladder.brightness'); setGlobal('philips_light.bulb_ladder_n.brightness',$snl); setGlobal('philips_light.bulb_ladder_v.brightness',$snl);
if (gg('All_ladder.status') == 1) { setGlobal("All_ladder.status", 0); } else if (gg('All_ladder.status') == 0) { setGlobal("All_ladder.status", 1); }
Свойства класса:
Методы класса:
$color=hexdec(gg('Lumi_light.light_color')); $red = $color >> 16 & 0xFF; $green = $color >> 8 & 0xFF; $blue = $color & 0xFF; $cmd=''.$red.','.$green.','.$blue.''; $cmd1='{"color":{"r":'.$red.',"g":'.$green.',"b":'.$blue.'},"brightness":100,"state":"ON"}'; sg('Lumi_light.light_state',$cmd1);
Объекты класса:
if (getGlobal("Lumi_audio_play.status") == '1') { setGlobal('Lumi_audio_play.State','{"url": "https://rusradio.hostingradio.ru/rusradio128.mp3", "volume": 40}');} else if (getGlobal("Lumi_audio_play.status") == '0'){setGlobal('Lumi_audio_play.state','"STOP"');}
$this->setProperty('say_state','{"text": "Вас поняла,включаю свет на лестнице", "volume": 100}');
$color=hexdec(gg('Lumi_light.light_color')); $red = $color >> 16 & 0xFF; $green = $color >> 8 & 0xFF; $blue = $color & 0xFF; $cmd=''.$red.','.$green.','.$blue.''; $brightness = gg('Lumi_light.brightness'); $set='{"color":{"r":'.$red.',"g":'.$green.',"b":'.$blue.'},"brightness":'.$brightness.',"state":"ON"}'; sg('Lumi_light.light_state',$set);
if (getGlobal("Lumi_light.status") == '0') {setGlobal('Lumi_light.light_state','{"state":"OFF"}');} else if (getGlobal("Lumi_light.status") == '1') {setGlobal('Lumi_light.light_state','{"state":"ON"}');}
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty('active',0);
$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);
Объекты класса:
if (gg('DarknessMode.active')) { $objects=getObjectsByProperty('greetingOnGroup','=','1'); if (is_array($objects)) { foreach($objects as $obj) { callMethod($obj.'.turnOn'); } } } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_deactivate.php'); /* end injection of {SDevices} */
$objects=getObjectsByProperty('groupEco','=','1'); if (is_array($objects)) { foreach($objects as $obj) { callMethod($obj.'.turnOff'); } } $objects=getObjectsByProperty('allOffGroup','=','1'); if (is_array($objects)) { foreach($objects as $obj) { callMethod($obj.'.turnOff'); } } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_activate.php'); /* end injection of {SDevices} */
setGlobal('minMsgLevel','3');
setGlobal('minMsgLevel','3'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_activate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_injects.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/darknessmode_activate.php'); /* end injection of {SDevices} */
if (getGlobal('NobodyHomeMode.status') == '0') { say('Выключила режим никого нет дома',2); } else if (getGlobal('NobodyHomeMode.status') == '1') { setGlobal("Lumi_audio_play.status", 0); setGlobal('Lumi_audio_play.state','"STOP"'); setGlobal("All_livingroom.status",0); setGlobal("Sonoff_relay_05.status", 0); setGlobal("Mi_relay_01.status", 0); //setGlobal("Tuya_switch.status", 0); say('Включила режим никого нет дома',2); say('Выключила все приборы которые вы просили',2); }
/* 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} */
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
$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} */
$this->setProperty('SomebodyHere',0); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onIdle.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} */
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_batteryLevelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_keepAlive.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_logicAction.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/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_switch.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/SAirConditioners_valueUpdated.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_configUpdated.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_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_thermostatUpdated.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_tempUp.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOff.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_stateUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_paramsUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_colorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLedLamp_statusUpdated.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} */
Свойства класса:
Методы класса:
Объекты класса:
$timer_on.=' Включен'; $timer_off.=' Выключен'; if (gg('Tuya_switch.Timer') == 1) { setGlobal("Tuya_switch.Timer", 0); setGlobal('Tuya_switch.Timer_title', $timer_off); say("Выключила таймер",2); } else if (gg('Tuya_switch.Timer') == 0) { setGlobal("Tuya_switch.Timer", 1); setGlobal('Tuya_switch.Timer_title', $timer_on); say("Включила таймер",2); }
$Ton.='Включен'; $Toff.='Выключен'; if (getGlobal('Tuya_switch.Timer') == '1'){ setGlobal('Tuya_switch.Timer_title',$Ton); } else if (getGlobal('Tuya_switch.Timer') == '0'){ setGlobal('Tuya_switch.Timer_title',$Toff); }
if (getGlobal('Tuya_switch.Timer') == '1'){ setGlobal('Tuya_switch.Timer', 0); } else if (getGlobal('Tuya_switch.Timer') == '0'){ setGlobal('Tuya_switch.Timer', 1); }
if (getGlobal('Sonoff'.'.'.'status') == 1) { setGlobal('Sonoff'.'.'.'Status_now', 'греет'); } else { setGlobal('Sonoff'.'.'.'Status_now', 'не греет'); }
Свойства класса:
Методы класса:
/* 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/SRGB_colorUpdated.php'); /* end injection of {SDevices} */
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_setTargetTemperature.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_disable.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_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/STVs_pause.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_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/SVacuums_pause.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_presetUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_addPreset.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_delPreset.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleProc.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_colorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_getInfo.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleSwitch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_cycleUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_stateUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SWLED_paramsUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_brightnessUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_colorUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_action.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_turnOff.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_pulseDetected.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/SDimmers_setLevel.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/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_alert.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_statusUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
if (gg('Svet-vgostinnoy.status') == 1) { setGlobal("philips_light.bulb_livingroom.status", 1); setGlobal("philips_light.bulb_livingroom_1.status", 1); setGlobal("philips_light.bulb_livingroom_2.status", 1); //say('Вас поняла,включаю свет в гостинной',2); //setGlobal('Lumi_say.say_state','{"text": "Вас поняла,включаю свет в гостинной"}'); } if (gg('Svet-vgostinnoy.status') == 0){ setGlobal("philips_light.bulb_livingroom.status", 0); setGlobal("philips_light.bulb_livingroom_1.status", 0); setGlobal("philips_light.bulb_livingroom_2.status", 0); //say('Вас поняла,выключаю свет в гостинной',2); //setGlobal('Lumi_say.say_state','{"text": "Вас поняла,выключаю свет в гостинной"}'); }
/* 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 (gg('XiMotion04.Time_on_off') == 1) { setGlobal("XiMotion04.Time_on_off", 0); } else if (gg('XiMotion04.Time_on_off') == 0) { setGlobal("XiMotion04.Time_on_off", 1); }
//определим время, на которое будет видоизменяться элементы интерфейса «датчик движения» после срабатывания if ((getGlobal('NobodyHomeMode.status')==1)) { say('Обнаружено движение(коридор),дома кто-то есть',2); } //sg('XiMotion04.status', 1); //SetTimeOut("MS2ActTimer","sg('XiMotion04.status', 0);",5); //запишем время срабатывания датчика в формате «HH:MM» setGlobal('XiMotion04.updatedTimeHHMM', gg('ThisComputer.timeNow')); //если стоит статус 1 в обьекте (управления светом при движении ) то включим свет в спальне //if ((gg('Motion.active')==1) && (gg('XiMotion04.Time_on_off')==1)){ //} //запустим таймер (1 мин), по истечении которого свет будет выключен //if ((gg('Motion.active ')==1) && (gg('XiMotion04.Time_on_off')==1)) { //clearTimeOut("aliveTimeout"); //SetTimeOut("aliveTimeout","setGlobal('Svetnalestnice1.status',0);setGlobal('XiDimmer01.level',0); ",30*2);}
if (gg('XiMotion03.Time_on_off') == 1) { setGlobal("XiMotion03.Time_on_off", 0); } else if (gg('XiMotion03.Time_on_off') == 0) { setGlobal("XiMotion03.Time_on_off", 1); }
if ((getGlobal('NobodyHomeMode.status')==1)) { say('Обнаружено движение(гостинная),дома кто-то есть',2); } setGlobal('XiMotion03.updatedTimeHHMM', gg('ThisComputer.timeNow')); if (getGlobal("DarkTime.active") == 1 && gg('XiMotion03.Time_on_off') == 1 && gg("All_livingroom.status") == 0 ){ setGlobal("All_livingroom.status",1); //say('Включила свет в гостинной',2); } if (gg('XiMotion01.Time_on_off') == 1 ){ clearTimeOut("LivTimeout"); SetTimeOut("LivTimeout","setGlobal('All_livingroom.status',0);",1800);}
if (gg('XiMotion01.Time_on_off') == 1) { setGlobal("XiMotion01.Time_on_off", 0); } else if (gg('XiMotion01.Time_on_off') == 0) { setGlobal("XiMotion01.Time_on_off", 1); }
//определим время, на которое будет видоизменяться элементы интерфейса «датчик движения» после срабатывания if (getGlobal('NobodyHomeMode.status') == 1) { say('Обнаружено движение(кухня),дома кто-то есть',2); } //SetTimeOut("MS2ActTimer","sg('XiMotion01.status', 0);",5); //запишем время срабатывания датчика в формате «HH:MM» setGlobal('XiMotion01.updatedTimeHHMM', gg('ThisComputer.timeNow')); if (gg('Tuya_switch.Online') ==1){ setGlobal("Tuya_switch.status", 1); } if ((gg('Tuya_switch.Timer') ==1) && (gg('Tuya_switch.status') ==1) && (gg('Tuya_switch.Online') ==1) ){ SetTimeOut("Tuyaswitchoff","setGlobal('Tuya_switch.status', 0);",90*2); } //если стоит статус 1 в обьекте (управления светом при движении ) то включим свет на кухне if (gg('XiMotion01.Time_on_off') == 1){ setGlobal("philips_light.bulb_ladder_n.status", 1); setGlobal("philips_light.bulb_ladder_v.status", 1); //setGlobal('Svetnalestnice.status',1); } //запустим таймер (1 мин), по истечении которого свет будет выключен if (gg('XiMotion01.Time_on_off') ==1){ clearTimeOut("lestnicaTimeout"); SetTimeOut("kitchenTimeout","setGlobal('philips_light.bulb_ladder_v.status',0); setGlobal('philips_light.bulb_ladder_n.status',0); setGlobal('Svetnalestnice.status',0);",180);} //Svetnalestnice.status
if (gg('XiMotion02.Time_on_off') == 1) { setGlobal("XiMotion02.Time_on_off", 0); } else if (gg('XiMotion02.Time_on_off') == 0) { setGlobal("XiMotion02.Time_on_off", 1); }
//SetTimeOut("MS2ActTimer","sg('XiMotion02.status', 0);",5); if ((gg('Motion.active')==1) && (gg('XiMotion02.Time_on_off')==1) ) { setGlobal("philips_light.bulb_ladder_n.status", 1); setGlobal("philips_light.bulb_ladder_v.status", 1); setGlobal("Svetnalestnice.status",1); } //запустим таймер (1 мин), по истечении которого свет будет выключен if ((gg('Motion.active')==1) && (gg('XiMotion02.Time_on_off')==1)) { clearTimeOut("kitchenTimeout"); SetTimeOut("lestnicaTimeout","setGlobal('philips_light.bulb_ladder_v.status',0); setGlobal('philips_light.bulb_ladder_n.status',0); setGlobal('Svetnalestnice.status',0);",180); } //определим время, на которое будет видоизменяться элементы интерфейса «датчик движения» после срабатывания if ((getGlobal('NobodyHomeMode.status')==1)) { say('Обнаружено движение(второй этаж),дома кто-то есть',2); } //sg('XiMotion02.status', 1); //запишем время срабатывания датчика в формате «HH:MM» setGlobal('XiMotion02.updatedTimeHHMM', gg('ThisComputer.timeNow')); //если стоит статус 1 в обьекте (управления светом при движении ) то включим свет в спальне
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions2_unblockSensor.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/SOpenable_statusUpdated.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/SOpenable_levelUpdated.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_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} */
Объекты класса:
if ((getGlobal('NobodyHomeMode.status')==1)) { say('Обнаружено открытие окна в детской,но дома никого нету',2); } if ((getGlobal("temp_d.alive") < '23.5') && (gg('XiOpenclose04.status')=="0")){ //say('В детской открыто окно,температура упала ниже желаемой.',2); } if (gg('XiOpenclose04.status')=="0"){ say('В детской открыли окно.',2); //setGlobal('Lumi_say.say_state','{"text": "В детской открыли окно"}'); } elseif (gg('XiOpenclose04.status')=="1"){ say('В детской закрыли окно.',2); //setGlobal('Lumi_say.say_state','{"text": "В детской закрыли окно"}'); }
if ((getGlobal('NobodyHomeMode.status')==1)) { say('Обнаружено открытие окна в гостинной,но дома никого нету',2); } if ((getGlobal("temp_g.alive") < '23.5') && (gg('XiOpenclose03.status')=="0")){ //say('В гостинной открыто окно,температура упала ниже желаемой.',2); } if (gg('XiOpenclose03.status')=="0"){ say('В гостинной открыли окно.',2); //setGlobal('Lumi_say.say_state','{"text": "В гостинной открыли окно"}'); } elseif (gg('XiOpenclose03.status')=="1"){ say('В гостинной закрыли окно.',2); //setGlobal('Lumi_say.say_state','{"text": "В гостинной закрыли окно"}'); }
//runScript('Error_boler'); if (getGlobal('Mi_open_close_00.status') == '0') { setGlobal('RGBKiderroom.status', 1); setGlobal('Mi_open_close_00'.'.'.'text', '(не работает)'); say("Котел перестал работать",2); setGlobal('Lumi_say_volume.State','60'); setGlobal('Lumi_audio_play.state','"http://192.168.100.4/cms/sounds/airport-bell.mp3"'); sleep (4); setGlobal('Lumi_audio_play.state','"STOP"'); sleep (3); setGlobal('Lumi_say.say_state','{"text": "Что то с котлом, он перестал работать", "volume":80}'); } else if (getGlobal('Mi_open_close_00.status') == '1') { setGlobal('Mi_open_close_00'.'.'.'text', '(работает)'); }
//runScript('door_open_close'); if (getGlobal('Mi_open_close_01.status') == '0') { setGlobal('Mi_open_close_01'.'.'.'text', 'Открыта'); } else if (getGlobal('Mi_open_close_01.status') == '1') { setGlobal('Mi_open_close_01'.'.'.'text', 'Закрыта'); } if (getGlobal('Mi_open_close_01.status') == '0' && ((getGlobal('NobodyHomeMode.status')==1))) { say("Обнаружено открытие входной двери",2); } //if (getGlobal('Mi_open_close_01.status') == '0' && getGlobal('NightMode.active') == '1') //{ // say("Обнаружено открытие входной двери",2); //setGlobal('Lumi_say.say_state','{"text": "Обнаружено открытие входной двери"}'); //} if (getGlobal("DarkTime.active") == '1' && getGlobal("Sonoff_relay_05.status") == '0' && getGlobal("Sonoff_relay_07.status") == '0' ) { setGlobal("Sonoff_relay_05.status", 1); say('Включила свет на улице',2); setGlobal('Lumi_say.say_state','{"text": "Включила свет на улице"}'); } //if (getGlobal("DarkTime.active") == '1' && getGlobal("philips_light.bulb_koridor.status") == '0') { //setGlobal("philips_light.bulb_koridor.status", 1); //say('Включила свет на улице',2); //setGlobal('Lumi_say.say_state','{"text": "Включила свет на улице"}'); //}
Свойства класса:
Методы класса:
/* 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} */
Свойства класса:
Методы класса:
/* Параметры передаваемые с вызовом uptime: Аптайм терминала на момент регистрации вызова в секундах. Присутствует всегда. username: Если username задан то будет присылать его всегда. terminal: Если terminal задан то будет присылать его всегда. volume: Системная громкость терминала, -1 если не настроено или при ошибке чтения. mpd_volume: Громкость mpd, -1 при ошибке подключения или если громкость не регулируется. status: Причина вызова. Отсутствует при изменении громкости или если вызов произошел по таймеру. Возможные значения status: start_record: Начало записи голоса (обычно после распознавания ключевого слова). stop_record: Окончание записи голоса. voice_activated: Терминал распознал ключевое слово. Только в chrome_mode = 0, в chrome_mode > 0 ему эквивалентен start_record. speech_recognized_success: Голосовая команда успешно распознана и обрабатывается. start_talking: Терминал начал говорить. stop_talking: Терминал закончил говорить. mpd_play, mpd_stop, mpd_pause: Статус mpd изменился на play, stop, pause. mpd_error: Ошибка получения статуса mpd. Пример метода который сохраняет все параметры в свойства: foreach ($params as $param => $value) { $this->setProperty($param, $value); }; */
$terminal_name=gg($this->object_title.".name"); setMessageVolume($terminal_name, $params["volume"]);
// $params["NAME"]; - Имя Терминала // $params["MESSAGE"]; - сообщение // $params["ERROR"]; - тип ошибки // $params["IMPORTANCE"]; - важность сообщения // $params["ORIGINAL_OBJECT_TITLE"]; - привязанный обьект // $this->username; - Привязанный Пользователь // $this->linkedRoom; - привязанное помещение
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STempHumSensors_valueUpdated.php'); /* end injection of {SDevices} */
Объекты класса:
//if (gg('Kinderroom_Sensor.Temp_value') >= 25.5) { //setGlobal('Lumi_say.say_state','{"text": "Температура в детской поднялась выше допустимой"}'); //say('Температура в детской поднялась выше допустимой',2); //setGlobal('RGBKiderroom.status', 1); //} //else if (gg('Kinderroom_Sensor.Temp_value') <= 23) { //setGlobal('Lumi_say.say_state','{"text": "Темеература в детской упала ниже допустимой"}'); //say('Температура в детской упала ниже допустимой',2); //setGlobal("RGBKiderroom.status", 1); //}
Свойства класса:
Методы класса:
Объекты класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SXiGatewayRGB_injects.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; $cycles=array('states'=>'states','main'=>'main','execs'=>'exec','scheduler'=>'scheduler'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>2*60 && !empty($tm)) { setGlobal('ThisComputer.cycle_'.$k.'Run',''); setGlobal('ThisComputer.cycle_'.$k.'Control','restart'); $red_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } $cycles=array('xiaomihome'=>'xiaomihome','zigbee2mqtt'=>'zigbee2mqtt','dev_sonoff_lan'=>'dev_sonoff_lan'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>5*60 && !empty($tm) ) { setGlobal('ThisComputer.cycle_'.$k.'Run',''); setGlobal('ThisComputer.cycle_'.$k.'Control','restart'); $red_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } $cycles=array('mqtt'=>'mqtt'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>3*60 && !empty($tm)) { setGlobal('ThisComputer.cycle_'.$k.'Run',''); setGlobal('ThisComputer.cycle_'.$k.'Control','restart'); $red_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } $cycles=array('xiaomimiio'=>'xiaomimiio'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>5*60 && !empty($tm)) { setGlobal('ThisComputer.cycle_'.$k.'Run',''); setGlobal('ThisComputer.cycle_'.$k.'Control','restart'); $red_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } //New stroke $cycles=array('dev_sonoff'=>'dev_sonoff','cycle_local_tuya'=>'cycle_local_tuya'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>1*60 && !empty($tm)) { setGlobal('ThisComputer.cycle_'.$k.'Run',''); setGlobal('ThisComputer.cycle_'.$k.'Control','restart'); $red_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } //New stroke end $cycles=array('ping'=>'ping','webvars'=>'webvars'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>5*60 && !empty($tm)) { // setGlobal('ThisComputer.cycle_'.$k.'Run',''); // setGlobal('ThisComputer.cycle_'.$k.'Control','restart'); $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'); }
Свойства класса:
Методы класса:
say('Новый день настал');
Объекты класса:
// Управление температурой котла в зависимости от температуры на улице $et.='65'; $ed.='70'; $ar.='73'; $ma.='75'; $ba.='75'; $ga.='78'; $tf.=' '.getGlobal('rambler_weather.temp_feels'); $blt.=' '.getGlobal('Boiler.Last_temp'); //$tf.=' '.getGlobal('rambler_weather.Test') ;getGlobal('NightMode.active', 0); if (($tf <= 0 && $tf >= -3) && ($blt <> $et) && (getGlobal('Boiler.Auto') == 1)){ setGlobal('Boiler.Last_temp', $et); say("Температура на улице:".getGlobal('rambler_weather.temperature').("°C"),2); say("Установила температуру котла ".$et."°",2); } if (($tf < -3 && $tf >= -5) && ($blt <> $ed) && (getGlobal('Boiler.Auto') == 1)){ setGlobal('Boiler.Last_temp', $ed); say("Температура на улице:".getGlobal('rambler_weather.temperature').("°C"),2); say("Установила температуру котла ".$ed."°",2); } if (($tf < -5 && $tf >= -8) && ($blt <> $ar) && (getGlobal('Boiler.Auto') == 1)){ setGlobal('Boiler.Last_temp', $ar); say("Температура на улице:".getGlobal('rambler_weather.temperature').("°C"),2); say("Установила температуру котла ".$ar."°",2); } if (($tf < -8 && $tf >= -10) && ($blt <> $ma) && (getGlobal('Boiler.Auto') == 1)) { setGlobal('Boiler.Last_temp', $ma); say("Температура на улице:".getGlobal('rambler_weather.temp_feels').("°C"),2); say("Установила температуру котла ".$ma."°",2); } if (($tf < -10 && $tf > -18) && ($blt <> $ba) && (getGlobal('Boiler.Auto') == 1)) { setGlobal('Boiler.Last_temp', $ba); say("Температура на улице:".getGlobal('rambler_weather.temp_feels').("°C"),2); say("Установила температуру котла ".$ba."°",2); } if (($tf < -18) && ($blt <> $ga) && (getGlobal('Boiler.Auto') == 1)) { setGlobal('Boiler.Last_temp', $ga); say("Температура на улице:".getGlobal('rambler_weather.temp_feels').("°C"),2); say("Установила температуру котла ".$ga."°",2); } $paths=array('/var/log/*.1','/var/log/*.2', '/var/log/*.1.*', '/var/log/*.2.*', '/var/log/*.3.*', '/var/log/*.4.*', '/var/log/*.5.*', '/var/log/*.6.*', '/var/log/*.7.*' ); foreach($paths as $p) { safe_exec('rm '.$p); } runScript('Hourly'); runScript('filesClearOld');
$h=(int)date('G',time()); $m=date('i',time()); $today = date("D M j G:i:s T Y"); setGlobal('DayOfWeek',date('D')); setGlobal('dateNow',date('M j')); setGlobal('timenowH',date('G')); setGlobal('timenowM',date('i')); //Включение режима никого не дома,когда все ушли if ( getGlobal("Mariya.atHome") == '1' && getGlobal("Arina.atHome") == '1' && getGlobal("Eduard.atHome") == '1' && getGlobal("NobodyHomeMode.auto") == '1' && getGlobal("NobodyHomeMode.status") == '0' && getGlobal("NightMode.active") == '0') { setGlobal("NobodyHomeMode.status", 1); say('Так как все ушли', 2); } //Включение режима никого не дома,когда все ушли setGlobal('timeNow',date('H:i')); $homeStatus=date('H:i'); if (getGlobal('NobodyHomeMode.status')==1) { $homeStatus.=' Дома никого'; } else { $homeStatus.=' Дома кто-то есть'; } $now_at_home.=' Дома сейчас:'; $now_at_home.=' '.getGlobal('Eduard.attHome'); $now_at_home.=' '.getGlobal('Arina.attHome'); $now_at_home.=' '.getGlobal('Mariya.attHome'); setGlobal('ThisComputer.Who_is_now_at_home',$now_at_home); $homeStatus.=' '.getGlobal('Security.stateDetails'); $homeStatus.=' '.getGlobal('System.stateDetails'); $homeStatus.=' '.getGlobal('Communication.stateDetails'); setGlobal('HomeStatus',$homeStatus); if (getGlobal('Boiler.Target_temperature') <> getGlobal('Boiler.Last_temp') ){ $Lt.=' '.getGlobal('Boiler.Last_temp'); setGlobal('Boiler.Target_temperature', $Lt); } if (getGlobal('Boiler.HW_temp') <> getGlobal('Boiler.HWlast_temp') ){ $Hw.=' '. getGlobal('Boiler.HWlast_temp'); setGlobal('Boiler.HW_temp', $Hw); } // Boiler.HWlast_temp $Sp.=' '. getGlobal('Livingroom_Sensor.Temp_value'); setGlobal('Boiler.Current_temp', $Sp); // С 22:00 по 06:00 включаем ночной режим NightMode $nt.='55'; if (timeIs('23:00')) { setGlobal('NightMode.active', 1); say("Включила ночной режим",2); //setGlobal('Boiler.Last_temp', $nt); //say("Установила температуру котла ".$nt."°",2); } elseif (timeIs('06:00')) { setGlobal('NightMode.active', 0); say("Выключила ночной режим",2); } //Выключение света на террасе //ThisComputer.SunRiseTime // С 22:00 по 06:00 включаем режим Темное время DarkTime if (timeIs(getGlobal('ThisComputer.SunSetTime')) ) { callMethod('DarkTime.activate'); //setGlobal("Sonoff callMethod('DarknessMode.activate'); } elseif (timeIs(getGlobal('ThisComputer.SunRiseTime'))) { callMethod('DarkTime.deactivate'); callMethod('DarknessMode.deactivate'); } if (timeIs('20:30')){ setGlobal("Sonoff_relay_05.status", 1); } //DarknessMode // С 21:30 по 06:15 вкл/выкл срабатывание датчика движения в коридорe if (timeIs(getGlobal('ThisComputer.SunSetTime'))) { setGlobal("XiMotion03.Time_on_off", 1); setGlobal("XiMotion04.Time_on_off", 1); say('Включила дачтик движения в коридоре',2); } elseif (timeIs('06:30')) { setGlobal("XiMotion03.Time_on_off", 0); setGlobal("XiMotion04.Time_on_off", 0); } // С 21:30 по 06:15 вкл/выкл срабатывание датчиа движения на кухне if (timeIs('22:00')) { setGlobal("XiMotion01.Time_on_off", 1); setGlobal("Sonoff_relay_05.status", 0); //setGlobal("XiMotion04.Time_on_off", 1); say('Включила датчик движения на кухне',2); } elseif (timeIs('06:00')) { setGlobal("XiMotion01.Time_on_off", 0); //setGlobal("XiMotion04.Time_on_off", 0); } // С 18:45 по 08:30 вкл/выкл режим Motion детектор if (timeIs(getGlobal('ThisComputer.SunSetTime'))) { callMethod('Motion.activate'); } elseif (timeIs('07:30')) { callMethod('Motion.deactivate'); } // Обслуживание системы if (timeIs("03:00")) { runScript("systemMaintenance"); } //-------------------------------------Температура в доме--------------------------------------------------------------- // Температура в дневное время if (getGlobal("Livingroom_Sensor.Temp_value") > getGlobal("Boiler.setpoint_day") && getGlobal("Boiler.by_sensor") == '1' && getGlobal("NightMode.active") == '0' && getGlobal('Boiler.CentralHeatingmode') == 'heat') { setGlobal('Boiler.CentralHeatingmode', 'off'); setGlobal('Boiler.Last_off_time', gg('ThisComputer.timeNow')); say('Температура в гостинной выше желаемой, выключаю котел ', 2); }elseif (getGlobal("Livingroom_Sensor.Temp_value") < getGlobal("Boiler.setpoint_day") && getGlobal("NightMode.active") == '0' && getGlobal("Boiler.by_sensor") == '1' && getGlobal('Boiler.CentralHeatingmode') == 'off') { setGlobal('Boiler.CentralHeatingmode', 'heat'); setGlobal('Boiler.Last_on_time', gg('ThisComputer.timeNow')); say('Температура в гостинной ниже желаемой, включаю котел', 2); } //Температура в ночное время(Ночной режим включен) if (getGlobal("Kinderroom_Sensor.Temp_value") > getGlobal("Boiler.setpoint_night") && getGlobal("Boiler.by_sensor") == '1' && getGlobal("NightMode.active") == '1' && getGlobal('Boiler.CentralHeatingmode') == 'heat') { setGlobal('Boiler.CentralHeatingmode', 'off'); setGlobal('Boiler.Last_off_time', gg('ThisComputer.timeNow')); say('Температура в детской выше желаемой, выключаю котел ', 2); }elseif (getGlobal("Kinderroom_Sensor.Temp_value") < getGlobal("Boiler.setpoint_night") && getGlobal("NightMode.active") == '1' && getGlobal("Boiler.by_sensor") == '1' && getGlobal('Boiler.CentralHeatingmode') == 'off') { setGlobal('Boiler.CentralHeatingmode', 'heat'); setGlobal('Boiler.Last_on_time', gg('ThisComputer.timeNow')); say('Температура в детской ниже желаемой, включаю котел', 2); } //---------------------------------------------------------------------------------------------------------------------- //Выставление времени для приборов // Время для включения if (timeIs(getGlobal('Mi_relay_02.On_Time')) && (gg('Mi_relay_02.On/Off')=="1")) { //say('Включила зарядку телефона',2); callMethod('Mi_relay_02.turnOn'); } if (timeIs(getGlobal('Mi_relay_01.On_Time')) && (gg('Mi_relay_01.On/Off')=="1")){ callMethod('Mi_relay_01.turnOn'); // say('Включила удлинитель',2); } if (timeIs(getGlobal('Mi_relay_10.On_Time')) && (gg('Mi_relay_10.On/Off')=="1")){ callMethod('Mi_relay_10.turnOn'); // say('Включила зарядку телефона',2); } // Время для выключения if (timeIs(getGlobal('Mi_relay_02.Off_Time')) && (gg('Mi_relay_02.status')=="1") ) { // say('Выключила зарядку телефона',2); callMethod('Mi_relay_02.turnOff'); } if (timeIs(getGlobal('Mi_relay_01.Off_Time')) && (gg('Mi_relay_01.status')=="1") ) { // say('Выключила удлинитель',2); callMethod('Mi_relay_01.turnOff'); } if (timeIs(getGlobal('Mi_relay_10.Off_Time')) && (gg('Mi_relay_10.status')=="1") ) { //say('Выключила умную розетку',2); callMethod('Mi_relay_10.turnOff'); } //CPU usage $cpu_usage=exec("top -bn 1 | awk '{print $9}' | tail -n +8 | awk '{s+=$1} END {print s}'"); setGlobal("ThisComputer.CPU_usage",$cpu_usage); // -------------------- Температура процессора -------------------------------------------------------- $cpu_temp=shell_exec('cat /sys/class/thermal/thermal_zone0/temp') / 1000; $cpu_temp=round($cpu_temp,0); sg("ThisComputer.CPU_temp",$cpu_temp); $maxtemp = 75; $mintemp = 25; if (isWeekDay()) { } if ($h>=8 && $h<=21) { if ($m=="00") { } }
Свойства класса:
Методы класса:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
Объекты класса:
$enh="Эдуарда нет,"; $eah="Эдуард,"; if (getGlobal("Eduard.Online") == '2' && getGlobal("NightMode.active") == '0') { setGlobal('Eduard.attHome', $enh) ; say("Эдуард оффлайн",2); SetTimeOut("NobodyHomeEd","setGlobal('Eduard.atHome',1);",900); } if (getGlobal("Eduard.Online") == '1' && getGlobal("NobodyHomeMode.status") == '1') { setGlobal("NobodyHomeMode.status", 0); say('Эдуард с возвращением,я скучала!',2); } if (getGlobal("Eduard.Online") == '1') { setGlobal('Eduard.attHome', $enh); setGlobal('Eduard.atHome',0); } if (getGlobal("DarkTime.active") == '1' && getGlobal("NobodyHomeMode.status") == '1' ) { setGlobal("Sonoff_relay_05.status", 1); say('Включила свет на улице',2); }
$aah="Арина,"; $anh="Арины нет,"; if (getGlobal("Arina.Online") == '2' && getGlobal("NightMode.active") == '0') { setGlobal('Arina.attHome', $anh) ; say("Арина оффлайн",2); SetTimeOut("NobodyHome","setGlobal('Arina.atHome', 1);",900); } if (getGlobal("Arina.Online") == '1' && getGlobal("NobodyHomeMode.status") == '1') { setGlobal("Arina.atHome", 0); setGlobal("NobodyHomeMode.status", 0); say('Арина с возвращением,я скучала!',2); } if (getGlobal("Arina.Online") == '1'){ setGlobal('Arina.attHome', $aah) ; setGlobal('Arina.atHome',0); } if (getGlobal("DarkTime.active") == '1' && getGlobal("NobodyHomeMode.status") == '1' ) { setGlobal("Sonoff_relay_05.status", 1); say('Включила свет на улице',2); }
//Если пользователь не дома $mah="Мария,"; $mnh="Марии нет,"; if (getGlobal("Mariya.Online") == '2' && getGlobal("NightMode.active") == '0') { setGlobal('Mariya.attHome', $mnh) ; say("Мария оффлайн",2); SetTimeOut("NobodyHome","setGlobal('Mariya.atHome',1);",900); } //Если пользователь дома if (getGlobal("Mariya.Online") == '1' && getGlobal("NobodyHomeMode.status") == '1') { setGlobal("NobodyHomeMode.status", 0); say('Мария с возвращением,я скучала!',2); } if (getGlobal("Mariya.Online") == '1') { setGlobal('Mariya.attHome', $mah) ; setGlobal("Mariya.atHome", 0); } if (getGlobal("DarkTime.active") == '1' && getGlobal("NobodyHomeMode.status") == '1' ) { setGlobal("Sonoff_relay_05.status", 1); say('Включила свет на улице',2); }
, Россия
© 2025 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Публичный договор
SmartLiving