<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
+ <change afterPath="$PROJECT_DIR$/scripts/lib/router.php" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/scripts/router_devices_list.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/cheminee.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cheminee.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/domoticz_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/domoticz_device_event.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/ecomode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/ecomode.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/pop.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/pop.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<property name="DatabaseDriversLRU" value="sqlite" />
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="JavaScriptWeakerCompletionTypeGuess" value="true" />
+ <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="true" />
<property name="WebServerToolWindowPanel.toolwindow.highlight.mappings" value="true" />
<workItem from="1576480199671" duration="3374000" />
<workItem from="1576522031507" duration="1545000" />
<workItem from="1577298113584" duration="24000" />
- <workItem from="1577298151244" duration="1212000" />
- </task>
- <task id="LOCAL-00206" summary=".">
- <created>1566380942924</created>
- <option name="number" value="00206" />
- <option name="presentableId" value="LOCAL-00206" />
- <option name="project" value="LOCAL" />
- <updated>1566380942924</updated>
+ <workItem from="1577298151244" duration="2270000" />
+ <workItem from="1577358967357" duration="4248000" />
</task>
<task id="LOCAL-00207" summary=".">
<created>1566458823293</created>
<option name="project" value="LOCAL" />
<updated>1576522982317</updated>
</task>
- <option name="localTasksCounter" value="255" />
+ <task id="LOCAL-00255" summary=".">
+ <created>1577310765026</created>
+ <option name="number" value="00255" />
+ <option name="presentableId" value="LOCAL-00255" />
+ <option name="project" value="LOCAL" />
+ <updated>1577310765026</updated>
+ </task>
+ <option name="localTasksCounter" value="256" />
<servers />
</component>
<component name="TodoView">
</state>
<state x="720" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577298128269" />
<state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1576479992407" />
- <state x="935" y="114" key="CommitChangelistDialog2" timestamp="1576522977384">
- <screen x="0" y="0" width="2560" height="1040" />
+ <state x="701" y="114" key="CommitChangelistDialog2" timestamp="1577310762113">
+ <screen x="0" y="0" width="1920" height="1040" />
</state>
+ <state x="701" y="114" key="CommitChangelistDialog2/0.0.1920.1040@0.0.1920.1040" timestamp="1577310762113" />
<state x="701" y="127" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1575647157027" />
<state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1576522977384" />
- <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1576493932196">
- <screen x="0" y="0" width="2560" height="1040" />
+ <state x="836" y="443" key="NewPhpFileDialog" timestamp="1577363498855">
+ <screen x="0" y="0" width="1920" height="1040" />
</state>
+ <state x="836" y="443" key="NewPhpFileDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577363498855" />
<state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1576493932196" />
- <state x="732" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1577299162028">
+ <state x="732" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1577358968384">
<screen x="0" y="0" width="1920" height="1040" />
</state>
- <state x="732" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577299162028" />
+ <state x="732" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577358968384" />
<state x="732" y="383" key="com.intellij.ide.util.TipDialog/0.0.1920.1160@0.0.1920.1160" timestamp="1575647093028" />
<state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1576522032866" />
<state x="976" y="257" width="607" height="526" key="find.popup" timestamp="1576492890263">
}, 10000);
}
- if (raspberry) {
+ if (true || raspberry) {
setInterval(function () {
checkEcoMode(false);
}, 60000);
cronVelib($cronmin);
cronWeather($cronmin);
cronBackyard($cronmin);
+ cronGuest($cronmin);
}
if ($cronmin % 10 == 0) {
cronSqueezeFavorites($cronmin);
cronHeartbeat($cronmin);
}
+function cronGuest($cronmin)
+{
+ setState('guest', hasGuest() ? '1' : '0');
+}
+
function cronInsteon($cronmin)
{
insteonCommand('knock');
off('salon');
break;
case 'Move':
- _remoteCmd('pause', 'salon');
+ if (getCurrentHarmonyActivity() != 'musique-radio') {
+ _remoteCmd('pause', 'salon');
+ }
break;
case 'Clock_Wise':
if (getCurrentHarmonyActivity() !== 'poweroff') {
heartbeat();
}
ob_end_clean();
-die(getState('ecomode'));
+
+$res = getState('ecomode');
+if (!$res && in_array(config('DEVICE'), ['bureau', 'bureausun'])) {
+ $res = getDomoticzDeviceStatus(391) === 'Closed';
+}
+
+die($res);
require_once ROOT . '/scripts/lib/ssh.php';
require_once ROOT . '/scripts/lib/cachemedia.php';
require_once ROOT . '/scripts/lib/ifttt.php';
+require_once ROOT . '/scripts/lib/router.php';
profile('Loaded libraries', __FILE__, __LINE__);
--- /dev/null
+<?php
+
+function routerDevicesList()
+{
+ $res = httpRequest('http://192.168.13.1/status-devices.asp', 'get', ['_' => time()], ['admin', 'BDQw479qbJST4u']);
+ // echo $res->getBody();
+ if (preg_match('/dhcpd_lease = ([^;]+);/m', $res->getBody(), $dhcp)) {
+ if (preg_match_all('/192\.168\.13\.[0-9]{1,3}/', $dhcp[1], $matches)) {
+ return $matches[0];
+ }
+ }
+ return [];
+}
+
+function hasGuest()
+{
+ $guests = ['192.168.13.150', '192.168.13.151', '192.168.13.152', '192.168.13.153'];
+ return count(array_intersect(routerDevicesList(), $guests)) > 0;
+}
\ No newline at end of file
],
'salon/on' => [
['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO'],
+ ['type' => 'domoticz', 'device' => '1203', 'command' => true, 'priority' => true], // sapin
['type' => 'insteon', 'command' => '0?113=I=0=0'],
['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
],
'salon/off' => [
['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false, 'brightness' => 0)],
+ ['type' => 'domoticz', 'device' => '1203', 'command' => false, 'priority' => true], // sapin
['type' => 'insteon', 'command' => '0?133=I=0=0'],
['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']],
],
'salon/cinema' => [
['type' => 'ecomode', 'mode' => '0'],
+ ['type' => 'domoticz', 'device' => '1203', 'command' => true, 'priority' => true], // sapin
['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'],
['type' => 'insteon', 'command' => '0?1111=I=0=0'],
],
'salon/tamise' => [
+ ['type' => 'domoticz', 'device' => '1203', 'command' => true, 'priority' => true], // sapin
['type' => 'ecomode', 'mode' => '0'],
['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'],
['type' => 'insteon', 'command' => '0?1130=I=0=0'],
['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
],
'salon/lecturenocture' => [
+ ['type' => 'domoticz', 'device' => '1203', 'command' => true, 'priority' => true], // sapin
['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'],
['type' => 'insteon', 'command' => '0?1113=I=0=0'],
['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.25]],
$_GET['im'] = '5';
include "import.php";
+if (getState('guest', '0') === '1' && $_GET['action'] == 'long') {
+ $_GET['action'] = 'tap';
+}
+
if ($_GET['button'] == 'wc') {
if ($_GET['action'] == 'tap') {
wcToggle();
--- /dev/null
+<?php
+require_once "import.php";
+header('Content-Type: text/plain');
+echo hasGuest();
+exit;