<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change afterPath="$PROJECT_DIR$/scripts/lib/switchbot.php" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/config/water.php" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/scripts/hotwater.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/cuisine.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/cuisine.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/sdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/sdb.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/profile.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/profile.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/lib/switchbot.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/switchbot.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/tmdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/tmdb.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1642149121693" duration="376000" />
<workItem from="1642240002240" duration="1108000" />
<workItem from="1642761590471" duration="1992000" />
- <workItem from="1642848701157" duration="1843000" />
- </task>
- <task id="LOCAL-00457" summary=".">
- <created>1615881926505</created>
- <option name="number" value="00457" />
- <option name="presentableId" value="LOCAL-00457" />
- <option name="project" value="LOCAL" />
- <updated>1615881926506</updated>
+ <workItem from="1642848701157" duration="3435000" />
+ <workItem from="1642856038290" duration="3025000" />
</task>
<task id="LOCAL-00458" summary=".">
<created>1615883286918</created>
<option name="project" value="LOCAL" />
<updated>1642848715262</updated>
</task>
- <option name="localTasksCounter" value="506" />
+ <task id="LOCAL-00506" summary=".">
+ <created>1642854570967</created>
+ <option name="number" value="00506" />
+ <option name="presentableId" value="LOCAL-00506" />
+ <option name="project" value="LOCAL" />
+ <updated>1642854570967</updated>
+ </task>
+ <option name="localTasksCounter" value="507" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
$favoriteslights = array_merge($favoriteslights, $c['favorites']);
include "default.php";
+ include "water.php";
- $nav=['home','lights','music','remote','coffee','switch','settings','alert','off'];
+ $nav=['home','lights','water','music','remote','coffee','switch','settings','alert','off'];
}
\ No newline at end of file
if (DISPLAYINTERFACE) {
$c = sdb();
$shortcuts['lights'] = $c['all'];
- $nav = ['home', 'lights', 'music', 'media', 'remote', 'switch', 'settings', 'alert', 'off'];
+ $nav = ['home', 'lights','water', 'music', 'media', 'remote', 'switch', 'settings', 'alert', 'off'];
include_once ROOT . '/config/music.php';
];
$favoriteslights[] = array_merge($allmusics['France Info'], array('volume' => 50));
$favoriteslights = array_merge($favoriteslights, $c['favorites']);
+ include "water.php";
include "media.php";
include "default.php";
}
\ No newline at end of file
--- /dev/null
+<?php
+
+$shortcuts['water'] = [
+ ['type' => 'light', 'scene' => 'sdb/hotwater/eco', 'label' => 'Eco'],
+ ['type' => 'light', 'scene' => 'sdb/hotwater/max', 'label' => 'Max'],
+ ['type' => 'light', 'scene' => 'sdb/hotwater/off', 'label' => 'Off'],
+
+];
\ No newline at end of file
--- /dev/null
+<?php
+require_once "import.php";
+if (isset($_GET['on'])) {
+ echo hotwater($_GET['on']);
+}
\ No newline at end of file
$harmonyClient = null;
$endQueue = [];
+require_once ROOT . '/vendor/autoload.php';
require_once ROOT . '/scripts/lib/profile.php';
require_once ROOT . "/config/global.php";
require_once ROOT . '/config/rooms.php';
require_once ROOT . '/scripts/lib/state.php';
require_once ROOT . '/scripts/lib/hue.php';
require_once ROOT . '/scripts/lib/harmony.php';
-require_once ROOT . '/scripts/lib/insteon.php';
require_once ROOT . '/scripts/lib/scenes.php';
require_once ROOT . '/scripts/lib/squeezebox.php';
require_once ROOT . '/scripts/lib/freebox.php';
'music' => '<div data-menu="music"><i class="fa fa-music" aria-hidden="true"></i><span>Musique & Radio</span></div>',
'media' => '<div data-menu="media"><i class="fa fa-tv-retro" aria-hidden="true"></i><span>Medias & TV</span></div>',
'coffee' => '<div data-menu="coffee"><i class="fa fa-oven" aria-hidden="true"></i><span>Cuisine / Café</span></div>',
+ 'water' => '<div data-menu="water"><i class="fa fa-faucet-drip" aria-hidden="true"></i><span>Eau chaude</span></div>',
'fan' => '<a href="/scripts/light.php?scene=' . config('ROOM') . '/fan/toggle" class="ajax"><i class="fa fa-fan" aria-hidden="true"></i><span>Ventilateur</span></a>',
'remote' => '<div data-menu="remote"><i class="fa fa-play" aria-hidden="true"></i><span>Télécommande</span></div>',
'switch' => '<div data-menu="switch"><i class="far fa-portal-enter" aria-hidden="true"></i><span>Changer de pièce</span></div>',
<?php
+
+use Illuminate\Support\Str;
+
+require_once ROOT . '/vendor/autoload.php';
+
$u = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
$n = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '-';
$n = str_replace('/', '-', $n);
$n = trim($n, '/ ');
-$profileFp = fopen('/var/log/tortugahome/profiles/' . \Illuminate\Support\Str::slug($n) . '.log', 'a+b');
+$profileFp = fopen('/var/log/tortugahome/profiles/' . Str::slug($n) . '.log', 'a+b');
$profileStart = microtime(true);
fwrite($profileFp, "\r\n\r\n------------\r\n" . 'URL : ' . $u . "\r\nDate : " . date('Y-m-d H:i:s') . "\r\n" . print_r($_REQUEST, true) . "\r\n\r\n");
'sdb/ampli/off' => [
['type' => 'domoticz', 'device' => '476', 'command' => false, 'priority' => true],
],
+ 'sdb/hotwater/eco' => [
+ ['type' => 'function', 'function' => 'hotwater', 'args' => ['1']],
+ ],
+ 'sdb/hotwater/max' => [
+ ['type' => 'function', 'function' => 'hotwater', 'args' => ['2']],
+ ],
+ 'sdb/hotwater/off' => [
+ ['type' => 'function', 'function' => 'hotwater', 'args' => ['0']],
+ ],
'sdb/off' => [
['type' => 'state', 'key' => 'sdb', 'value' => 0],
['type' => 'domoticz', 'scene' => 20, 'command' => false, 'priority' => true],
execScene('bureau/' . $scene);
}
-function updateCuisine(){
- $salon=getState('salon','off');
- if($salon==='on' || $salon==='off' || $salon==='tamise'){
+function updateCuisine()
+{
+ $salon = getState('salon', 'off');
+ if ($salon === 'on' || $salon === 'off' || $salon === 'tamise') {
execScene('cuisine/on');
- }else if($salon=='cinema'){
+ } else if ($salon == 'cinema') {
execScene('cuisine/tamise');
}
}
<?php
function switchbot($device, $command = 'press')
{
- sshCommand('/usr/bin/python3 /usr/local/python-host/switchbot_py3.py -d ' . $device . ' -c ' . $command, 'bureausun', true, true);
+ return sshCommand('/usr/bin/python3 /usr/local/python-host/switchbot_py3.py -d ' . $device . ' -c ' . $command, 'bureausun', true, true);
}
-function hotwater($on = true)
+function hotwater($newState)
{
+ // 0 : OFF
+ // 1 : ECO
+ // 2 : MAX
+
+ $changing = getState('hotwater_change', '0');
+// if ($changing == '1') {
+// return 'changing';
+// }
+ setState('hotwater_change', '1');
+
$device = 'C1:F7:66:5E:A2:CF';
$state = getState('hotwater', '1');
- $newState = $on ? '1' : '0';
if ($newState === $state) {
- return;
+ return 'no state change';
}
- if ($newState === '1') {
- switchbot($device);
- } else {
- switchbot($device);
- sleep(2);
- switchbot($device);
+
+ $clicks = (3 + $newState - $state) % 3;
+ $res = '';
+ for ($i = 0; $i < $clicks; $i++) {
+ $res .= ' one click - ';
+ $res .= switchbot($device);
+ sleep(5);
}
+ setState('hotwater', $newState);
+ setState('hotwater_change', '0');
+ return $res;
}
\ No newline at end of file
{
global $videoExt;
+ set_time_limit(0);
+
$e = explode(':', $tvShow['dir']);
if ($e[0] === 'netflix') {
$res['shortcuts'][] = ['label' => $tvShow['data']['name'], 'type' => 'netflix', 'url' => '/scripts/netflix.php?id=' . $e[1], 'poster' => $this->_poster($tvShow['data']['poster_path'])];