<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change afterPath="$PROJECT_DIR$/install.md" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/scripts/lib/wol.php" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/scripts/wc.php" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/scripts/wol.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/.idea/home.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/home.iml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/.idea/php.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/php.xml" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/images/earth.png" afterDir="false" />
+ <change afterPath="$PROJECT_DIR$/images/suncurve.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/bureau.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/bureau.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/cave.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/cave.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/cuisine.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/cuisine.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/config/tv.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/tv.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/images/rooms/medium/entree.jpg" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/images/rooms/originaux/entree.jpg" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/images/rooms/originaux/litjerome.jpg" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/images/rooms/originaux/litvincent.jpg" beforeDir="false" />
- <change beforePath="$PROJECT_DIR$/images/rooms/originaux/sdb.jpg" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/salon.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/salon.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/sdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/sdb.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/settings.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/settings.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/config/wc.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/wc.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/app_token" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/app_token" 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/domoticz_status.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/domoticz_status.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/freeboxapi.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/freeboxapi.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/gradient.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/gradient.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/import.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/import.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/lib/denon.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/denon.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/domoticz.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/domoticz.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/flowerpower.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/flowerpower.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/freebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/freebox.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/harmony.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/harmony.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/http.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/http.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/hue.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/kodi.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/kodi.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/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/mediarasp.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/off.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/off.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/pc.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/pc.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/proc.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/proc.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/remoteinfos.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/router.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/router.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/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/lib/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/ssh.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/ssh.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/tmdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/tmdb.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/weatherstation.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/weatherstation.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/mediarasp.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/mediarasp.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/shield.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/sleeppc.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/sleeppc.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/squeeze.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/squeeze.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/squeezeplayerstatus.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/squeezeplayerstatus.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/servers/_startdaemon.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/_startdaemon.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/servers/domoticz.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/domoticz.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/servers/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/hue.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/servers/insteon.php" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/servers/logcat.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/logcat.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/servers/logcatb.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/logcatb.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/servers/logcats.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/logcats.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/servers/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/squeezebox.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/servers/ssh.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/ssh.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/servers/startdaemon" beforeDir="false" afterPath="$PROJECT_DIR$/servers/startdaemon" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/style/gradient.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/gradient.css" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/style/gradient.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/gradient.less" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/style/style.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.less" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/style/weatherstation.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/weatherstation.css" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/style/weatherstation.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/weatherstation.less" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1622787397330" duration="3950000" />
<workItem from="1638959846647" duration="5250000" />
<workItem from="1638973361360" duration="1389000" />
- <workItem from="1639125380760" duration="3516000" />
- </task>
- <task id="LOCAL-00442" summary=".">
- <created>1611683302030</created>
- <option name="number" value="00442" />
- <option name="presentableId" value="LOCAL-00442" />
- <option name="project" value="LOCAL" />
- <updated>1611683302030</updated>
+ <workItem from="1639125380760" duration="5173000" />
</task>
<task id="LOCAL-00443" summary=".">
<created>1611911651461</created>
<option name="project" value="LOCAL" />
<updated>1622706612280</updated>
</task>
- <option name="localTasksCounter" value="491" />
+ <task id="LOCAL-00491" summary=".">
+ <created>1639181242353</created>
+ <option name="number" value="00491" />
+ <option name="presentableId" value="LOCAL-00491" />
+ <option name="project" value="LOCAL" />
+ <updated>1639181242355</updated>
+ </task>
+ <option name="localTasksCounter" value="492" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
config('SQUEEZEBOX_PLAYER', 'Bureau');
config('VIDEOPLAYER', 'mediarasp');
config('VOLUME_DEVICE', 'harmony');
-config('VOLUME_STEP', 2);
+config('VOLUME_STEP', 3);
config('SLEEPTYPE', 'screensaver');
config('SCREENSAVER', 'suncurve');
config('SLEEPSCREEN', 15);
$c = bureau();
$shortcuts['lights'] = $c['all'];
$favoriteslights = [
- ['type' => 'volume', 'volume' => '3%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
- ['type' => 'volume', 'volume' => '3%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
];
$favoriteslights = array_merge($favoriteslights, $c['favorites']);
config('SLEEPSCREEN', 30);
config('SCREENSAVER_BRIGHTNESS', 100);
config('SLEEPTYPE', 'screensaver');
-config('SCREENSAVER','weatherstation');
+config('SCREENSAVER', 'weatherstation');
config('VIDEOPLAYER', 'mediarasp-small');
config('TVPLAYER', 'mediarasp-small');
config('VOLUME', 60);
config('VOLUME_DEVICE', 'Squeezebox');
-config('VOLUME_STEP',5);
-config('HIDEMASK_TIMEOUT',250);
-config('THEME','#978270');
+config('VOLUME_STEP', 5);
+config('HIDEMASK_TIMEOUT', 250);
+config('THEME', '#978270');
if (DISPLAYINTERFACE) {
$c = cave();
$shortcuts['lights'] = $c['all'];
- $nav=['home','lights','music','media','remote','switch','settings','alert','off'];
+ $nav = ['home', 'lights', 'music', 'media', 'remote', 'switch', 'settings', 'alert', 'off'];
- include_once ROOT . '/config/music.php';
+ include_once ROOT . '/config/music.php';
- $favoriteslights = [
- ['type' => 'volume', 'volume' => '5%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
- ['type' => 'volume', 'volume' => '5%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
- ];
- $favoriteslights[] = array_merge($allmusics['France Info'], array('volume' => 50));
+ $favoriteslights = [
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
+ ];
+ $favoriteslights[] = array_merge($allmusics['France Info'], array('volume' => 50));
$favoriteslights = array_merge($favoriteslights, $c['favorites']);
- include "media.php";
- include "default.php";
+ include "media.php";
+ include "default.php";
}
\ No newline at end of file
$c = cuisine();
$favoriteslights = [
- ['type' => 'volume', 'volume' => '5%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
- ['type' => 'volume', 'volume' => '5%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP').'%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP').'%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
];
$favoriteslights = array_merge($favoriteslights, $c['favorites']);
define('LATITUDE', 48.8758392);
define('LONGITUDE', 2.3422104);
+define('NAS_ROOT', 'smb://192.168.13.1/1.42.6-25556/');
+define('NAS_PWD_ROOT', 'smb://Share:RQpZHMDLtbc229FQV3@192.168.13.1/1.42.6-25556/');
+
$squeezeboxPlayers = array(
'Cave' => 'b8:27:eb:ab:b4:50',
'Salle de bains' => '9f:e3:5d:6e:15:35',
'Lit Vincent' => 'b8:27:eb:40:0e:e9',
'WC' => 'b8:27:eb:f6:1d:30',
//'Bureau' => 'cc:cc:2d:2a:b5:35',
- 'Bureau' => '7e:23:f6:33:1d:3b',
+ //'Bureau' => 'd6:12:01:da:63:f9',
+ 'Bureau' => '00:04:20:17:82:8b',
);
],
'cuisine' => [
'ip' => '192.168.13.31',
- 'key' => 'dmGYolpN-k4:APA91bEcMcfkZ0jZViEvyqyVWoT71-vQko9DE0wwg-vzPkZ5-lHwiVJDH38dXfIoWrHWTrtEiMsv-6TrebFR-dNOLhVoVUb3rCsehmLi-Ew17lkP75Yqds3KsWEiyF_yx-i-9dc_4ewV',
+ 'key' => 'f1rVkITIwwc:APA91bFMwnvK_H-SvFeAQb2i8jmZw2Vcv0xrt46ejSjwaOLhBo7OVS2CozF79HgxDf3qsTbHRxZ976VW8-9JtxCAjQTqOV6n6UkS7x6oFCLbwlnyQhm5JTGu9171Gt7k_Bi6WFVJ9cFd',
'password' => '4pyA?Rnyeyc1$44M'
],
'salon' => [
'ip' => '192.168.13.30',
- 'key' => 'dmGYolpN-k4:APA91bEcMcfkZ0jZViEvyqyVWoT71-vQko9DE0wwg-vzPkZ5-lHwiVJDH38dXfIoWrHWTrtEiMsv-6TrebFR-dNOLhVoVUb3rCsehmLi-Ew17lkP75Yqds3KsWEiyF_yx-i-9dc_4ewV',
+ 'key' => 'd9-9VKyjp9c:APA91bGjiqU5rE52O6GvkCSSENWSsTYI9uZPfWofwwDHIivks4dKZJNSa1ixCLXTSg99rtC5Ca5Yv9-J_DG3c8hdDUAa_W7cHCdjLPbKxDTEgvnVBWgm9NLWCKG5KGmd5evkHuA3ZLzO',
'password' => '4pyA?Rnyeyc1$44M'
],
'sdb' => [
'ip' => '192.168.13.32',
- 'key' => 'dmGYolpN-k4:APA91bEcMcfkZ0jZViEvyqyVWoT71-vQko9DE0wwg-vzPkZ5-lHwiVJDH38dXfIoWrHWTrtEiMsv-6TrebFR-dNOLhVoVUb3rCsehmLi-Ew17lkP75Yqds3KsWEiyF_yx-i-9dc_4ewV',
+ 'key' => 'dcJ4TswVcXA:APA91bETlTCSE4HXOU-KiR2Hr6RdT6VwqsOcYl4XOpA-vLIs_qWT7zu8bRD9w4LXWdBYzn2iVZyGvQlBaU2KReJ62xe-H7oGuT93LbsZN20Az1oUxCgbjgLbcQ4WygEKBtoLa_WuQM1l',
'password' => '4pyA?Rnyeyc1$44M'
]
//dOQilKX5CVQ:APA91bGOo1g2Hk2p7A4qYNg0wuKjvDeU3quKi6r73ae6rxVqSXmztMIDRn00DOZmXP1q1fBS0hLEd7xZo_Rr3LQMrRIHJpgy0FxnH7G_OV3kxFmGqWu1yOg5tBUEPlEybH_JkjlEgGof
'bureausun' => ['id' => 'bureausun', 'host' => '192.168.13.70', 'shield' => '192.168.13.41', 'user' => 'pi', 'password' => 'atacama'],
'lit' => ['id' => 'lit', 'host' => '192.168.13.69', 'user' => 'pi', 'password' => 'atacama'],
'sdb' => ['id' => 'sdb', 'shield' => '192.168.13.32'],
- 'avion' => ['id' => 'avion', 'host' => '192.168.13.5', 'user' => 'Tortuga', 'password' => 's77vpo*wu', 'mac' => 'E0:D5:5E:68:67:B9'],
+ 'avion' => ['id' => 'avion', 'host' => '192.168.13.5', 'user' => 'Tortuga', 'password' => '8nc4PuwzCScw&^Vi$Fh#&n', 'mac' => 'E0:D5:5E:68:67:B9'],
];
// Browse media files on NAS
config('VIDEOPLAYER', 'shield');
config('TVPLAYER', 'shield');
config('VOLUME_DEVICE', 'DenonAVR');
-config('VOLUME_STEP',2);
+config('VOLUME_STEP', 2);
config('VIDEOPLAYER_DEVICE', 'salon');
config('HIDEMASK_TIMEOUT', 250);
-config('THEME','#d0a25b');
+config('THEME', '#d0a25b');
config('SLEEPSCREEN', 150);
config('SCREENSAVER_BRIGHTNESS', 100);
config('SLEEPTYPE', 'screensaver');
-config('SCREENSAVER','weatherstation');
+config('SCREENSAVER', 'weatherstation');
if (DISPLAYINTERFACE) {
$c = salon();
$shortcuts['lights'] = $c['all'];
$favoriteslights = [
- ['type' => 'volume', 'volume' => '3%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
- ['type' => 'volume', 'volume' => '3%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
];
$favoriteslights = array_merge($favoriteslights, $c['favorites']);
include "default.php";
include ROOT . "/config/media.php";
- $nav=['home','lights','music','media','remote','switch','fan','settings','alert','off'];
+ $nav = ['home', 'lights', 'music', 'media', 'remote', 'switch', 'fan', 'settings', 'alert', 'off'];
}
config('SLEEPSCREEN', 30);
config('SCREENSAVER_BRIGHTNESS', 100);
config('SLEEPTYPE', 'screensaver');
-config('SCREENSAVER','weatherstation');
+config('SCREENSAVER', 'weatherstation');
config('VIDEOPLAYER', 'mediarasp-small');
config('TVPLAYER', 'mediarasp-small');
config('VOLUME', 60);
config('VOLUME_DEVICE', 'Squeezebox');
-config('VOLUME_STEP',5);
-config('HIDEMASK_TIMEOUT',250);
-config('THEME','#92475c');
+config('VOLUME_STEP', 3);
+config('HIDEMASK_TIMEOUT', 250);
+config('THEME', '#92475c');
if (DISPLAYINTERFACE) {
$c = sdb();
$shortcuts['lights'] = $c['all'];
- $nav=['home','lights','music','media','remote','switch','settings','alert','off'];
+ $nav = ['home', 'lights', 'music', 'media', 'remote', 'switch', 'settings', 'alert', 'off'];
- include_once ROOT . '/config/music.php';
+ include_once ROOT . '/config/music.php';
- $favoriteslights = [
- ['type' => 'volume', 'volume' => '5%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
- ['type' => 'volume', 'volume' => '5%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
- ];
- $favoriteslights[] = array_merge($allmusics['France Info'], array('volume' => 50));
+ $favoriteslights = [
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
+ ];
+ $favoriteslights[] = array_merge($allmusics['France Info'], array('volume' => 50));
$favoriteslights = array_merge($favoriteslights, $c['favorites']);
- include "media.php";
- include "default.php";
+ include "media.php";
+ include "default.php";
}
\ No newline at end of file
'sdb' => 'Salle de bains'];
$shortcuts['settings'] = [
- ['type' => 'volume', 'volume' => '10%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
- ['type' => 'volume', 'volume' => '10%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP').'%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP').'%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
['type' => 'action', 'action' => 'screen-off', 'label' => 'écran off'],
['type' => 'action', 'action' => 'sound-off', 'label' => 'sound off'],
['type' => 'action', 'action' => 'close', 'label' => 'Fermer'],
config('ROOM', 'wc');
config('SQUEEZEBOX_PLAYER', 'WC');
config('VOLUME', 60);
-config('VOLUME_STEP',5);
+config('VOLUME_STEP', 5);
config('VOLUME_DEVICE', 'SqueezeboxPlayer');
-config('HIDEMASK_TIMEOUT',250);
+config('HIDEMASK_TIMEOUT', 250);
if (DISPLAYINTERFACE) {
$c = wc();
$shortcuts['lights'] = $c['all'];
- $nav=['home','lights','music','remote','switch','settings','alert','off'];
+ $nav = ['home', 'lights', 'music', 'remote', 'switch', 'settings', 'alert', 'off'];
include_once ROOT . '/config/music.php';
$favoriteslights = [
- ['type' => 'volume', 'volume' => '5%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
- ['type' => 'volume', 'volume' => '5%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
+ ['type' => 'volume', 'volume' => config('VOLUME_STEP') . '%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
];
$favoriteslights = array_merge($favoriteslights, $c['favorites']);
include "media.php";
if (lastOffScreen < Date.now() - 30000) {
lastOffScreen = Date.now();
if (androidApp) {
- phonetask('screenoff');
+ //phonetask('screenoff');
} else {
sshCommand('/usr/local/bin/screenoff');
}
hidescreensaver = true;
}
if (androidApp) {
- phonetask('screenon');
+ //phonetask('screenon');
} else {
sshCommand('/usr/local/bin/screenon');
}
-4mC9Si6L2UFREW9CAyAgcrsH5stP8Qk/TEk6rCAIzzSrp2G2C872NKdz3RC5VWiA
\ No newline at end of file
+afcd7pJHR6fef3QNlBUysKWSpr5Axe1pTKa7+p9YGjYwGKYBP87xcnYE/hV+FYCb
\ No newline at end of file
cronRooms($cronmin);
//cronInsteon($cronmin);
cronWeather($cronmin);
+ cronMagnet($cronmin);
if ($cronmin % 5 == 0) {
cronTraffic($cronmin, false);
_logSection('End Loop (min:' . $cronmin . ')');
}
+function cronMagnet($cronmin)
+{
+ _logSection('Magnet links');
+ file_get_contents("https://entree.home.tortuga.enhydra.fr/scripts/freeboxapi.php?action=magnets");
+}
+
function cronXPlanet($cronmin)
{
_logSection('XPlanet');
{
_logSection('Rooms');
if (getState('bureauAutoMode') == '1') {
+ _logSection('Bureau');
updateBureauAuto();
}
if (getState('chambreAutoMode') == '1') {
+ _logSection('Chambre');
updateChambreAuto();
}
if (getState('courAutoMode') == '1') {
+ _logSection('Cour');
updateCourAuto();
}
+ _logSection('Planetarium');
checkPlanetarium();
if ($cronmin % 2) {
+ _logSection('WC VMC');
checkWCVMC();
}
}
{
_logSection('Pings');
global $devices;
- setState('vincenthere', ping('192.168.13.31', 5) ? '1' : '0');
+ setState('vincenthere', ping('192.168.13.20', 5) ? '1' : '0');
setState('hasnetwork', ping('1.1.1.1', 3, 443) ? '1' : '0');
foreach ($devices as $name => $device) {
$result = ping($device['host'], 3, 22) ? '1' : '0';
function cronSqueezeCheckPlayers($cronmin)
{
_logSection('Check squeezebox players');
-// $players = ['Salon' => 'salon', 'Bureau' => 'bureau'];
-// foreach ($players as $player => $device) {
-// if (getSqueezePlayerStatus($player) === -1) {
-// if (!shieldPlayingVideo($device)) {
-// shieldRunAppAndBackHome('sbplayer', $device, 1, true);
-// sleep(5);
-// }
-// }
-// }
}
function cronWeather($cronmin)
$res['wc_humidity'] = toNumber(getDomoticzDeviceStatus(1502), true);
$res['office_temp'] = toNumber(getDomoticzDeviceStatus(1496), 1);
$res['office_humidity'] = toNumber(getDomoticzDeviceStatus(1497), true);
+ $res['cellar_humidity'] = toNumber(getDomoticzDeviceStatus(4818), true);
+ $res['cellar_temp'] = toNumber(getDomoticzDeviceStatus(4817), 1);
$res['pressure'] = round($weather['Pressure']['Metric']['Value']);
$res['pressureTendency'] = $weather['PressureTendency']['Code'];
$res['precipitations24'] = round($weather['PrecipitationSummary']['Past24Hours']['Metric']['Value']);
define('TIMELIMIT', 1);
$_GET['im'] = '5';
-$wcSwitch = 6448;
-
-if ($_GET['device'] == 1033 || $_GET['device'] == 1476 || $_GET['device'] == 1478) {
+if ($_GET['device'] == 4680 || $_GET['device'] == 1476 || $_GET['device'] == 1478 || $_GET['device'] == 4955) {
$forceConfig = 'salon';
}
-if ($_GET['device'] == $wcSwitch) {
+if ($_GET['device'] == 1695) {
$forceConfig = 'wc';
}
-if ($_GET['device'] == 1478) {
+if ($_GET['device'] == 4600) {
$forceConfig = 'bureau';
}
+if ($_GET['device'] == 4711) {
+ $forceConfig = 'sdb';
+}
require_once "import.php";
if ($_GET['device'] == 480) {
chambreToggle();
-} else if ($_GET['device'] == 1033 || $_GET['device'] == 1476) {
+} else if ($_GET['device'] == 4680 || $_GET['device'] == 1476 || $_GET['device'] == 1478 || $_GET['device'] == 4955) {
// Cube
switch ($_GET['state']) {
case 'Shake':
}
} else if ($_GET['device'] == 1451) {
domoticzSwitch(1450);
-} else if ($_GET['device'] == $wcSwitch) {
+} else if ($_GET['device'] == 1695) {
$forceConfig = 'wc';
- switch (str_replace(' ', '_', $_GET['state'])) {
+ switch ($_GET['state']) {
case 'Double_Click':
execScene('wc/spa');
setState('wc', 1);
wcToggle();
break;
}
-} else if ($_GET['device'] == 1478) {
+} else if ($_GET['device'] == 4600) {
// Cube bureau
switch ($_GET['state']) {
case 'Shake':
execScene('bureau/rideaux/toggle');
break;
case 'Flip_180':
- execScene('bureau/auto');
+ execScene('bureau/fan/toggle');
break;
case 'Free_Fall':
execScene('bureau/off');
}
break;
case 'Clock_Wise':
- volume(config('VOLUME_STEP'), '+');
+ volume(config('VOLUME_STEP'), '+',);
break;
case 'Anti_Clock_Wise':
volume(config('VOLUME_STEP'), '-');
break;
case 'Tap':
harmonyActivity('musique');
- squeezePlayByName('FIP', 'Bureau');
+ $lastTap = getState('bureau_squeeze_tap', 0);
+ $musics = ['FIP', 'Samba'];
+ $i = ($lastTap + 1) % count($musics);
+ setState('bureau_squeeze_tap', $i);
+ squeezePlayByName($musics[$i], 'Bureau');
+ break;
+ case 'Alert':
+ default:
+ break;
+ }
+} else if ($_GET['device'] == 4711) {
+ // Cube SDB
+ switch ($_GET['state']) {
+ case 'Shake':
+ execScene('home/alert');
+ break;
+ case 'Flip_90':
+ execScene('sdb/off');
+ break;
+ case 'Flip_180':
+ execScene('sdb/on');
+ break;
+ case 'Free_Fall':
+ off('sdb');
+ break;
+ case 'Move':
+ //_remoteCmd('pause', 'salon');
+ break;
+ case 'Clock_Wise':
+ volume(config('VOLUME_STEP'), '+');
+ break;
+ case 'Anti_Clock_Wise':
+ volume(config('VOLUME_STEP'), '-');
+ break;
+ case 'Tap':
+ squeezePlayByName('FIP', $squeezeboxPlayers['Salle de bains']);
break;
case 'Alert':
default:
<?php
require_once "import.php";
-print_r(getDomoticzDeviceStatus($_GET['device']));
\ No newline at end of file
+ob_end_clean();
+echo ":::".getDomoticzDeviceStatus($_GET['device']);
\ No newline at end of file
<?php
require_once "import.php";
-
if ($_GET['action'] == 'resetWifi') {
freeboxResetWifi();
netgearWifiExtReboot();
+} else if ($_GET['action'] == 'auth') {
+ die(freeboxAuthorizeApp());
+} else if ($_GET['action'] === 'magnets') {
+ freeboxWatchMagnets();
}
\ No newline at end of file
if ($type == 'youtube') {
$res['video_path'] = downloadYoutubeDL('https://www.youtube.com/watch?v=' . $res['videoid'], 0, false, 'webm');
}
+
header('Content-type: application/json');
-$r = ['type' => $type, 'data' => $res];
+$r = ['c' => $c, 'type' => $type, 'data' => $res];
+$r['paused'] = inWinsowsList('192.168.13.4', 'avion', 1);
die(json_encode($r));
\ No newline at end of file
}
if (isset($_GET['delay'])) {
+ ignore_user_abort(true);
set_time_limit($_GET['delay'] + 30);
sleep($_GET['delay']);
}
function denonAVRVolume($volume, $increase = '')
{
$current = denonAVRGetVolume();
+ echo '::' . $current . '::';
if ($increase === '+' || $increase === '-') {
if ($increase === '+') {
$volume += $current;
}
$volume = min(80, max(0, round($volume)));
if ($volume !== $current) {
+ if ($volume < 10) {
+ $volume = '0' . $volume;
+ }
echo _denonTelnet('MV' . $volume);
}
return $current . '->' . $volume;
function denonAVRGetVolume()
{
$res = _denonTelnet('MV?');
+ if (stristr($res, 'MVMAX')) {
+ return denonAVRGetVolume();
+ }
+ echo '//' . $res . '//';
$res = substr($res, 2);
if ($res > 100) {
$res /= 10;
function _denonTelnet($cmd)
{
+
$client = getDenonTelnetClient();
+ profile('got denon telnet client for ' . $cmd);
+
$res = $client->execute($cmd);
if ($res->isError()) {
return false;
}
+ profile('Denon telnet ' . $cmd);
return trim($res->getResponseText());
}
function denonAVROff()
{
- _denonTelnet('ZMOFF');
- _denonTelnet('Z2OFF');
- _denonTelnet('PWSTANDBY');
+ profile('Denon AVR OFF');
+
+ if (denonAVRGetPowerState()) {
+ _denonTelnet('ZMOFF');
+ }
+ //_denonTelnet('Z2OFF');
+ //_denonTelnet('PWSTANDBY');
}
function epson($on = true, $force = false)
{
+ profile('Epson ' . $on);
+
$currentState = getState('EpsonPowerState', '0') === '1';
if (!$force && $currentState === $on) {
return;
}
$cmd = $on ? 'PowerOn' : 'PowerOff';
echo 'Epson ' . $cmd . "\n";
- sshCommand('/usr/local/bin/ir Epson ' . $cmd, 'salon');
+ sshCommand('/usr/local/bin/ir Epson ' . $cmd, 'salon', false, true);
setState('EpsonPowerState', $on ? '1' : '0');
if ($currentState !== $on && $on) {
sleep(30);
*/
function getDenonTelnetClient()
{
- global $denonTelnetClient;
- if (!isset($denonTelnetClient)) {
- $denonTelnetClient = Graze\TelnetClient\TelnetClient::factory();
- $denonTelnetClient->connect('192.168.13.42:23', '', '', "\r", 2);
- }
+ /** @var Graze\TelnetClient\TelnetClient $denonTelnetClient */
+ $denonTelnetClient = Graze\TelnetClient\TelnetClient::factory();
+ $denonTelnetClient->connect('192.168.13.42:23', '', '', "\r", 2);
+ $denonTelnetClient->setReadTimeout(2);
+
return $denonTelnetClient;
}
\ No newline at end of file
function domoticzCmd($command, $priority = false)
{
+
$redis = connectRedis();
$queue_name = 'domoticz_queue';
//echo ':)';
$res = runDomoticzCommand(['type' => 'devices', 'rid' => $device]);
$res = json_decode($res->getBody(), true);
- // print_r($res);
try {
$update = new DateTime($res['result'][0]['LastUpdate']);
$now = new DateTime();
<?php
function updateFlowerPower()
{
- $device = getState('device_bureausun_awake') ? 'bureausun' : 'cerveau';
+ $device = getState('device_salon_awake') ? 'salon' : 'bureausun';
$res = sshRunCommand('timeout -k 10 1m /usr/local/bin/flowerpower', $device, true, true);
$fp = explode("\n", $res['output']);
$map = [1 => 1467, 0 => 1468];
<?php
-function freeboxChannel($channel)
-{
- if (config('DEVICE') === 'bureau') {
- $currentActivity = getCurrentHarmonyActivity();
- harmonyActivity('tv');
- }
- if ($channel === 'replay') {
- $commands = ['right', 'ok', 'pause=5', 'down', 'down', 'down', 'down', 'down'];
- } elseif ($channel === 'netflix') {
- $commands = ['right', 'down', 'down', 'down', 'ok', 'pause=25', 'ok', 'pause=5', 'down'];
- } else {
- $commands = array_merge(['ok', 'pause=5'], str_split((string)$channel));
- }
- $keys = array_merge(array('home', 'pause=2', 'home', 'pause=1', 'home', 'left', 'right', 'home'), $commands);
+use alphayax\freebox\utils\rest\RestAuth;
- if (config('DEVICE') === 'bureau') {
- if ($currentActivity != 'tv') {
- sleep(50);
- }
- }
- print_r($keys);
- freeboxKey($keys);
-}
+const FREEBOX_APP_ID = 'fr.enhydra.tortuga.home';
+const FREEBOX_APP_NAME = 'Tortuga Home';
+const FREEBOX_APP_VERSION = '0.0.2';
-function freeboxKey($keys, $long = false)
+function freeboxAuthorizeApp()
{
- foreach ($keys as $key) {
- if (strpos($key, 'pause=') === 0) {
- $e = explode('pause=', $key, 2);
- $p = intval($e[1]);
- echo 'wait ' . $p . 's' . '<br>';
- sleep($p);
- continue;
- }
- echo $key . "<br>";
- httpRequest('http://192.168.13.2/pub/remote_control', 'GET', ['code' => '42472024', 'key' => $key]);
- }
+ unlink('app_token');
+ $freeboxAPI = new \alphayax\freebox\utils\Application(FREEBOX_APP_ID, FREEBOX_APP_NAME, FREEBOX_APP_VERSION);
+ $freeboxAPI->authorize();
+ $freeboxAPI->openSession();
+ return $freeboxAPI->getAppToken();
}
function getFreeboxAPIInstance()
{
global $freeboxAPI;
if (!isset($freeboxAPI)) {
- $freeboxAPI = new \alphayax\freebox\utils\Application('tortuga.home', 'Tortuga home', '0.0.1');
- $freeboxAPI->setAppToken('4mC9Si6L2UFREW9CAyAgcrsH5stP8Qk/TEk6rCAIzzSrp2G2C872NKdz3RC5VWiA');
+ $freeboxAPI = new \alphayax\freebox\utils\Application(FREEBOX_APP_ID, FREEBOX_APP_NAME, FREEBOX_APP_VERSION);
+ $freeboxAPI->setAppToken('afcd7pJHR6fef3QNlBUysKWSpr5Axe1pTKa7+p9YGjYwGKYBP87xcnYE/hV+FYCb');
$freeboxAPI->openSession();
}
return $freeboxAPI;
sleep(5);
$wifi->setConfiguration(new \alphayax\freebox\api\v3\models\WiFi\GlobalConfig(['enabled' => true]));
+}
+
+function freeboxAddMagnet($url)
+{
+ echo $url;
+ $download = new alphayax\freebox\api\v3\services\download\Download(getFreeboxAPIInstance());
+ $download->addFromUrl($url);
+}
+
+function freeboxWOL($mac, $password = '')
+{
+ $freebox = getFreeboxAPIInstance();
+ $rest = new RestAuth($freebox->getFreeboxApiHost() . '/api/v4/lan/wol/pub/');
+ $rest->setSessionToken($freebox->getSessionToken());
+ $rest->POST(['mac' => $mac, 'password' => $password]);
+}
+
+function freeboxWatchMagnets()
+{
+ $dir = '/nas/Téléchargements/Watch';
+ $dr = opendir($dir);
+ while ($f = readdir($dr)) {
+ if ($f == '.' || $f == '..' || !stristr($f, '.magnet')) {
+ continue;
+ }
+ try {
+ $file = $dir . '/' . $f;
+ freeboxAddMagnet(file_get_contents($file));
+ unlink($file);
+ } catch (Exception $e) {
+ if (stristr($e->getMessage(), '(exists)')) {
+ unlink($file);
+ }
+ echo $e->getMessage();
+ }
+ }
}
\ No newline at end of file
{
global $harmonyClient;
- $ip = '192.168.13.7';
-
+ $ip = 'harmonyapi.home.tortuga.enhydra.fr';
$uri = 'http://' . $ip . ':8282/hubs/' . $hub . '/' . ltrim($uri, '/');
if (null == $harmonyClient) {
if ($activity !== 'off' && $activity !== 'poweroff') {
ecoMode('0');
}
- if ($activity === 'musique' || $activity === 'tv') {
+ if ($activity === 'tv') {
shieldWakeup('bureau');
}
$res = harmonyRequest('activities/' . $activity, 'POST');
$options['headers'] = $headers;
$res= $client->request($method, $url, $options);
- print_r($res);
return $res;
}
\ No newline at end of file
return array('groups' => $hue->getGroups(), 'scenes' => $hue->getScenes(), 'lights' => $hue->getLights());
}
-function hueCommand($action, $transitionTime)
+function hueCommand($action, $transitionTime = null)
{
$redis = connectRedis();
$queue = $redis->igbget('hue_queue');
<?php
$kodiClients = [];
-$kodiIP = ['salon' => '192.168.13.40', 'bureau' => '192.168.13.41', 'avion' => '192.168.13.5', 'cuisine' => '192.168.13.32'];
+$kodiIP = ['salon' => '192.168.13.40', 'bureau' => '192.168.13.41', 'avion' => '192.168.13.5', 'cuisine' => '192.168.13.31', 'sdb' => '192.168.13.32'];
$_tvshowallstatus = null;
$_koditotmdb = null;
return mysqli_connect('kodidb.home.tortuga.enhydra.fr', "kodi", "atacama", "MyVideos119");
}
-function kodiGetAllKodiToTmdb($force=false)
+function kodiGetAllKodiToTmdb($force = false)
{
global $_koditotmdb;
if ($force || null === $_koditotmdb) {
return $_koditotmdb;
}
-function kodiGetTVShowAllStatus($force=false)
+function kodiGetTVShowAllStatus($force = false)
{
global $_tvshowallstatus;
$seen = connectRedis()->igbget('mediaseen');
$seenChanged = false;
+ $useen = [];
+
+ foreach ($seen as $item => $true) {
+ $useen[_normalizeSeenFile($item)] = true;
+ }
+
+ connectRedis()->igbset('mediaseen', $useen);
+ $seen = $useen;
+
$result = mysqli_query($con, 'SELECT * FROM path');
$paths = [];
while ($path = $result->fetch_assoc()) {
- $paths[$path['idPath']] = str_replace('nfs://192.168.13.3/', '/', $path['strPath']);
+ $p = _normalizeSeenFile($path['strPath']);
+
+ $paths[$path['idPath']] = $p;
}
$result = mysqli_query($con, 'SELECT * FROM files');
$files = [];
$playCounts = [];
while ($file = $result->fetch_assoc()) {
+ if (!isset($paths[$file['idPath']])) {
+ continue;
+ }
$filename = $paths[$file['idPath']] . $file['strFilename'];
$files[$filename] = $file['idFile'];
$playCounts[$filename] = $file['playCount'];
}
}
+function _normalizeSeenFile($p)
+{
+ $p = str_replace('nfs://192.168.13.3/', '/', $p);
+ $p = str_replace(NAS_ROOT, '/volume1/Share/', $p);
+ $p = str_replace(NAS_PWD_ROOT, '/volume1/Share/', $p);
+ $p = str_replace('smb://Share:dcfyjbcyckwydtgufjx@192.168.13.4/Share//', '/volume1/Share/', $p);
+ $p = str_replace('smb://nas.home.tortuga.enhydra.fr/1.42.6-25556/', '/volume1/Share/', $p);
+ $p = str_replace('.x264.', '.', $p);
+ return $p;
+}
+
function tmdbToKodiId($tmdbId, $type = 'tvshow')
{
$result = mysqli_query(getKodiDBConnection(), 'SELECT `media_id` FROM `uniqueid` WHERE `value`="' . $tmdbId . '" AND `type`="tmdb"');
require_once ROOT . '/scripts/lib/kodi.php';
require_once ROOT . '/scripts/lib/climacell.php';
require_once ROOT . '/scripts/lib/homeconnect.php';
+require_once ROOT . '/scripts/lib/wol.php';
profile('Loaded libraries', __FILE__, __LINE__);
function getCurrentConfig()
{
global $forceConfig;
+
+ $ips = ['192.168.13.31' => 'cuisine', '192.168.13.30' => 'salon', '192.168.13.32' => 'sdb'];
+
if (!isset($forceConfig) && isset($_SERVER['HTTP_HOST']) && stristr($_SERVER['HTTP_HOST'], '.home.tortuga.enhydra.fr')) {
$e = explode('.', $_SERVER['HTTP_HOST']);
$_GET['c'] = array_shift($e);
$expires = time() + 60 * 60 * 24 * 30;
if (isset($_GET['c'])) {
- setcookie('homeconfig', $_GET['c'], $expires, '/', 'enhydra.fr');
+ if (!headers_sent()) {
+ setcookie('homeconfig', $_GET['c'], $expires, '/', 'enhydra.fr');
+ }
$_COOKIE['homeconfig'] = $_GET['c'];
}
if (!isset($_COOKIE['homeconfig'])) {
+
+ if (isset($ips[$_SERVER['REMOTE_ADDR']])) {
+ $c = $ips[$_SERVER['REMOTE_ADDR']];
+ } else {
+ $c = 'salon';
+ }
if (!headers_sent()) {
- setcookie('homeconfig', 'salon', $expires, '/', 'enhydra.fr');
+ setcookie('homeconfig', $c, $expires, '/', 'enhydra.fr');
}
- $_COOKIE['homeconfig'] = 'salon';
+ $_COOKIE['homeconfig'] = $c;
}
return $_COOKIE['homeconfig'];
}
function volume($volume, $increase = '', $device = null)
{
$d = $device === null ? config('VOLUME_DEVICE') : $device;
- echo $d.';'.$volume.';'.$increase;
+ echo $d . ';' . $volume . ';' . $increase;
if ($increase == ' ') {
$increase = '+';
case 'squeezebox':
return squeezeVolume($volume, $increase, config('SQUEEZEBOX_PLAYER'));
case 'harmony':
- $lastHarmonyVolume = getState('last_harmony_volume', 0);
+ $lastHarmonyVolume = min(time(), getState('last_harmony_volume', 0));
$limit = time() - 2;
if ($lastHarmonyVolume > $limit) {
return;
case 'vlc':
return VLCCmd(['command' => 'volume', 'val' => $increase . '20'], $device);
case 'denonavr':
- return denonAVRVolume($volume,$increase);
+ return denonAVRVolume($volume, $increase);
}
}
-function phoneTask($task, $phone, $encode = false)
+function phoneTask($task, $phone, $encode = true)
{
global $phones;
$p = $phones[$phone];
'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>',
- '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>',
+ '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>',
'clock' => '<div data-menu="clock"><i class="far fa-alarm-clock" aria-hidden="true"></i><span>Réveil</span></div>',
$device = config('DEVICE');
}
+ profile('remote cmd ' . $cmd . ' on ' . $device);
+
$map = ['play' => 'pl_pause',
'pause' => 'pl_pause',
'stop' => 'pl_stop',
function mediaRaspPlayMovie($movie, $device = null)
{
- stopPlayersIn($device);
setPlaying('mediarasp:' . $movie, $device);
- mediaRaspCommons($device);
+
+ profile('mediaRaspPlayMovie ' . $movie, __FILE__, __LINE__);
$m = explode('.', $movie);
$ext = array_pop($m);
$x264 = true;
}
$base = implode('.', $m);
- $final = $base . '.srt';
- $srt = [$final, $base . '.fr.srt', $base . '.en.srt'];
-
- foreach ($srt as $srtfile) {
- if (file_exists($srtfile)) {
- $srtcontent = cleanUpSubtitle(file_get_contents($srtfile));
-
- file_put_contents($final, $srtcontent);
-
- if ($x264) {
- copy($final, $base . '.x264.srt');
- }
- break;
- }
- }
addSeen($movie);
$res = VLCPlay($movie, $device);
- mediaRaspPostPlay($device);
setPlaying('mediarasp:' . $movie, $device);
return $res;
}
}
-function mediaRaspPostPlay($device)
-{
- $rasps = ['entree', 'bureausun', 'litvincent', 'litjerome', 'sdb'];
- if (in_array($device, $rasps)) {
-
- }
-}
-
function mediaRaspPlayStream($url, $device = null)
{
setPlaying('mediarasp:' . $url, $device);
mediaRaspCommons($device);
$res = VLCPlay($url, $device);
- mediaRaspPostPlay($device);
setPlaying('mediarasp:' . $url, $device);
mediaRaspCommons($device);
return $res;
$dest = downloadYoutubeDL($castURL, $height, true, 'mkv');
getYoutubeDLMeta($castURL);
$res = VLCPlay($dest, $device);
- mediaRaspPostPlay($device);
setPlaying('mediarasp:cast:' . $castURL);
return $res;
}
if (null === $device) {
$device = config('DEVICE');
}
+ profile('OFF ' . $device);
commonOff($device);
if ($device == 'bureau' || $device == 'bureausun') {
offBureau();
global $devices;
$s = 'device_' . $device . '_awake';
- $ip = $devices[$device]['host'];
- $mac = $devices[$device]['mac'];
- `wakeonlan -i $ip $mac`;
- if (getState($s) === '1') {
- return;
+ wol($device);
+
+ if (getState($s) == '0') {
+ sleep(10);
}
setState($s, '1');
- sleep(10);
- sshCommand('"C:\Program Files\Scripts\wakeup.bat"', $device, false);
+ sshCommand('"C:\Program Files\Scripts\wakeup.bat"', $device, false, false);
setState($s, '1');
}
-function sleepPC($device,$force=false)
+function shutdownPC($device, $force = false, $blocking = false)
+{
+ return sleepPC($device, $force, $blocking, 'shutdown');
+}
+
+
+function sleepPC($device, $force = false, $blocking = false, $action = 'sleep')
{
$s = 'device_' . $device . '_awake';
if (!$force && getState($s) == '0') {
return;
}
setState($s, '0');
- $res = sshCommand('"C:\Program Files\Scripts\sleep.bat"', $device, true,true);
+ $cmd = "C:\\Program Files\\Scripts\\$action.bat";
+ $res = sshCommand('"' . $cmd . '"', $device, $blocking, false);
setState($s, '0');
return $res;
}
function pcScreensProfile($profile, $device)
{
- sshCommand('"C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe" -monitorloadprofile "' . $profile . '"', $device, false, true);
+ sshCommand('"C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe" -monitorloadprofile "' . $profile . '"', $device, false, false);
+}
+
+function listWindows($device, $tries = 1)
+{
+ $file = '/nas/Cache/Avion/windowslist.csv';
+ for ($i = 0; $i < $tries; $i++) {
+ if (file_exists($file)) {
+ $r = @file_get_contents($file);
+ if ($r) {
+ setState('listwindows_avion', $r);
+ return $r;
+ }
+ }
+ sleep(3);
+ }
+ return getState('listwindows_avion');
+}
+
+function inWinsowsList($str, $device, $tries = 1)
+{
+ $list = listWindows($device, $tries);
+ return stristr($list, $str) !== false;
}
\ No newline at end of file
$t = mktime($hour, $min, $sec, $month, $day, date('Y'));
$c = time();
-
- $res = $t < $c - 5 || $t > $c;
+ $res = $t < $c - 15 || $t > $c;
if ($res) {
echo $c - $t . "\n";
}
<?php
$u = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
-if (stristr($u, 'index.php') || !stristr($u, '.php')) {
- $profileFp = fopen(__DIR__ . '/../../log/profile.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");
-}
+$n = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '-';
+$n = str_replace('.php', '', $n);
+$n = str_replace('/home/tortugahome/www/', '', $n);
+$n = str_replace('/', '-', $n);
+$n = trim($n, '/ ');
-function profile($desc, $file, $line)
+$profileFp = fopen('/var/log/tortugahome/profiles/' . \Illuminate\Support\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");
+
+function profile($desc, $file = 'unset', $line = 'unset')
{
- global $profileStart, $profileFp;
- if (is_resource($profileFp)) {
- $ms = round((microtime(true) - $profileStart) * 1000) . 'ms';
- fwrite($profileFp, $ms . ';' . $desc . ';' . $file . ';' . $line . "\r\n");
- }
+ global $profileStart, $profileFp;
+ if (is_resource($profileFp)) {
+ $ms = round((microtime(true) - $profileStart) * 1000) . 'ms';
+ fwrite($profileFp, $ms . ';' . $desc . ';' . $file . ';' . $line . "\r\n");
+ }
}
\ No newline at end of file
$res['time'] = '';
$res['title'] = '';
$res['artwork'] = '';
- $res['status'] = '';
+ $res['status'] = json_encode($p);
if (isset($p[0]['result'])) {
$r = $p[0]['result'];
$res['can_seek'] = $r['canseek'];
}
$res = ['title' => '', 'artwork' => ''];
- $file = str_replace('smb://Share:dcfyjbcyckwydtgufjx@192.168.13.4/Share/', '/volume1/Share', $source);
- $file = str_replace('/nas', '/volume1/Share', $file);
+ $file = str_replace(NAS_ROOT, '/volume1/Share/', $source);
+ $file = str_replace(NAS_PWD_ROOT, '/volume1/Share/', $file);
+ $file = str_replace('/nas/', '/volume1/Share/', $file);
+ $res['title'] = $file;
+
if (file_exists($file . '.tmdb.id')) {
$id = file_get_contents($file . '.tmdb.id');
if (intval($id) > 0) {
function routerDevicesList()
{
- try {
- $res = httpRequest('http://192.168.13.1/status-devices.asp', 'get', ['_' => time()], ['admin', 'BDQw479qbJST4u']);
- } catch (Exception $e) {
- return [];
- }
- // 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];
- }
- }
+// try {
+// $res = httpRequest('http://192.168.13.1/status-devices.asp', 'get', ['_' => time()], ['admin', 'BDQw479qbJST4u']);
+// } catch (Exception $e) {
+// return [];
+// }
+// // 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 [];
}
$home = 15;
$alert = 16;
-$chambrefan = 2724;
+$chambrefan = 4616;
$scenes = [
'chambre/matin' => [
['type' => 'nightmode', 'mode' => '1'],
['type' => 'ecomode', 'mode' => '1'],
['type' => 'state', 'key' => 'chambre', 'value' => 0],
- ['type' => 'scene', 'scene' => 'chambre/rideaux/close'],
+ ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]],
//['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
['type' => 'scene', 'scene' => 'chambre/cheminee/off'],
+ ['type' => 'scene', 'scene' => 'chambre/cheminee/off', 'delay' => 2],
],
'chambre/sleep/off' => [
['type' => 'scene', 'scene' => 'chambre/bed/base'],
['type' => 'state', 'key' => 'chambre', 'value' => 0],
//['type' => 'insteon', 'command' => '0?1332=I=0=0'], // Lustre et tableau off
['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
- ['type' => 'scene', 'scene' => 'chambre/rideaux/close'],
+ ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]],
['type' => 'scene', 'scene' => 'sdb/off'],
['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on
['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 0, 'hue' => '46920', 'saturation' => 255, 'transitionTime' => 0)],
['type' => 'hue', 'light' => $litvincent, 'scene' => array('brightness' => 128, 'colorTemp' => 156, 'transitionTime' => 60 * 60)],
],
-// 'chambre/rideaux/west/open' => [
-// ['type' => 'insteon', 'command' => '3?02622013CB0F11FF=I=3'],
-// ],
-// 'chambre/rideaux/west/close' => [
-// ['type' => 'insteon', 'command' => '3?02622013CB0F1300=I=3'],
-// ],
-// 'chambre/rideaux/east/open' => [
-// ['type' => 'insteon', 'command' => '3?02622014690F1300=I=3'],
-// ],
-// 'chambre/rideaux/east/close' => [
-// ['type' => 'insteon', 'command' => '3?02622014690F11FF=I=3'],
-// ],
+
'chambre/rideaux/open' => [
- //['type' => 'domoticz', 'scene' => '3', 'command' => false, 'priority' => true],
- ['type' => 'domoticz', 'device' => '1756', 'command' => 'Group Off', 'priority' => true],
+ ['type' => 'function', 'function' => 'chambreRideaux'],
],
'chambre/rideaux/close' => [
- //['type' => 'domoticz', 'scene' => '3', 'command' => true, 'priority' => true],
- ['type' => 'domoticz', 'device' => '1756', 'command' => 'Group On', 'priority' => true],
+ ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]],
],
'home/alert' => [
+ ['type' => 'function', 'function' => 'alert',],
+ ],
+ 'home/doalert' => [
['type' => 'domoticz', 'device' => '4207', 'command' => true, 'priority' => true],
['type' => 'hue', 'group' => $alert, 'scene' => ['alert' => 'lselect']],
- ['type' => 'hue', 'group' => $alert, 'delay' =>3, 'scene' => ['alert' => 'none']],
+ ['type' => 'hue', 'group' => $alert, 'delay' => 3, 'scene' => ['alert' => 'none']],
['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Tortuga Alerte'],
+ ['type' => 'phonetask', 'phone' => 'sdb', 'task' => 'Tortuga Alerte'],
],
'home/aulit' => [
['type' => 'scene', 'scene' => 'chambre/bed'],
['type' => 'scene', 'scene' => 'salon/fan/off'],
],
'salon/cinemabase' => [
- // ['type' => 'scene', 'scene' => 'cuisine/tamise'],
+ // ['type' => 'scene', 'scene' => 'cuisine/tamise'],
// ['type' => 'ecomode', 'mode' => '0'],
// ['type' => 'insteon', 'command' => '0?1111=I=0=0'],
],
'salon/fan/toggle' => [
['type' => 'domoticz', 'device' => '478', 'command' => 'Toggle', 'priority' => true],
],
- 'bureau/wakeuppc' => [
+ 'bureau/pc/wakeup' => [
['type' => 'function', 'function' => 'wakeupPC', 'args' => ['avion']],
],
- 'bureau/sleeppc' => [
+ 'bureau/pc/sleep' => [
['type' => 'function', 'function' => 'sleepPC', 'args' => ['avion']],
],
+ 'bureau/pc/shutdown' => [
+ ['type' => 'function', 'function' => 'shutdownPC', 'args' => ['avion']],
+ ],
'bureau/screens/off' => [
['type' => 'function', 'function' => 'pcScreensProfile', 'args' => ['Games', 'avion']]
],
['type' => 'domoticz', 'device' => '3529', 'command' => true, 'priority' => true],
],
'bureau/fan/toggle' => [
- ['type' => 'domoticz', 'device' => '3529', 'command' => 'Toggle', 'priority' => true],
+ ['type' => 'function', 'function' => 'harmonyDeviceCommand', 'args' => ['klarstein-whisperwind', 'power-toggle']],
],
-
'bureau/auto' => [
['type' => 'function', 'function' => 'bureauAuto', 'args' => [true]],
],
'bureau/base/on' => [
['type' => 'ecomode', 'mode' => '0'],
- ['type' => 'function', 'function' => 'wakeupPC', 'args' => ['avion']],
+ ['type' => 'scene', 'scene' => 'bureau/pc/wakeup'],
],
'bureau/cinema' => [
['type' => 'scene', 'scene' => 'bureau/base/off'],
['type' => 'hue', 'group' => $bureau, 'scene' => '7mofVclWdtvpVyt'],
['type' => 'domoticz', 'scene' => 25, 'command' => true, 'priority' => true],
-
],
'bureau/lumineux' => [
['type' => 'hue', 'group' => $bureau, 'scene' => 'SdXwtZu5PCDjK2h'],
],
'bureau/base/off' => [
+ ['type' => 'domoticz', 'scene' => 42, 'command' => false, 'priority' => true],
['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]],
['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'off'],
- ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'off'],
- ['type' => 'scene', 'scene' => 'bureau/sleeppc'],
+ ['type' => 'hue', 'group' => $bureau, 'scene' => array('on' => false, 'brightness' => 0)],
+ ['type' => 'hue', 'light' => 23, 'scene' => array('on' => false, 'brightness' => 0)],
],
'bureau/off' => [
- ['type' => 'hue', 'group' => $bureau, 'scene' => array('on' => false, 'brightness' => 0)],
- ['type' => 'domoticz', 'scene' => 42, 'command' => false, 'priority' => true],
['type' => 'scene', 'scene' => 'bureau/base/off'],
+ ['type' => 'scene', 'scene' => 'bureau/pc/sleep'],
],
'bureau/sound/on' => [
['type' => 'domoticz', 'device' => 24, 'switchtype' => 'scene', 'command' => true, 'priority' => true],
//['type' => 'scene', 'scene' => 'cuisine/off'],
['type' => 'scene', 'scene' => 'salon/off'],
['type' => 'scene', 'scene' => 'cour/off'],
- ['type' => 'scene', 'scene' => 'bureau/off'],
+ ['type' => 'scene', 'scene' => 'bureau/base/off'],
['type' => 'scene', 'scene' => 'chambre/off'],
['type' => 'scene', 'scene' => 'sdb/off'],
['type' => 'scene', 'scene' => 'wc/off'],
['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Stop All Sounds'],
['type' => 'scene', 'scene' => 'chambre/planetarium/off'],
['type' => 'scene', 'scene' => 'cuisine/coffee/off'],
+ ['type' => 'scene', 'scene' => 'bureau/pc/shutdown'],
['type' => 'scene', 'scene' => 'home/hueoff'],
['type' => 'scene', 'scene' => 'salon/media/off'],
['type' => 'scene', 'scene' => 'salon/off', 'delay' => 2],
['type' => 'scene', 'scene' => 'salon/on'],
['type' => 'scene', 'scene' => 'bureau/auto'],
['type' => 'scene', 'scene' => 'chambre/auto'],
- ['type' => 'scene', 'scene' => 'chambre/rideaux/open'],
['type' => 'scene', 'scene' => 'sdb/on'],
['type' => 'scene', 'scene' => 'cour/auto'],
['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
],
'wc/morning' => [
['type' => 'hue', 'group' => $wc, 'scene' => 'NC5ejamHGUNURj8'],
- ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['FIP', $squeezeboxPlayers['WC'], 70, false]],
+ ['type' => 'function', 'function' => 'wcMusic', 'args' => [70]],
],
'wc/day' => [
['type' => 'hue', 'group' => $wc, 'scene' => 'qfuu8z5QaJ6J26W'],
- ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['FIP', $squeezeboxPlayers['WC'], 80, false]],
+ ['type' => 'function', 'function' => 'wcMusic', 'args' => [80]],
],
'wc/evening' => [
['type' => 'hue', 'group' => $wc, 'scene' => 'h82j28eNu6ZHVhM'],
- ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['FIP', $squeezeboxPlayers['WC'], 80, false]],
+ ['type' => 'function', 'function' => 'wcMusic', 'args' => [80]],
],
'wc/late' => [
['type' => 'hue', 'group' => $wc, 'scene' => 'IGo4F5jRQXc1H95'],
- ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['FIP', $squeezeboxPlayers['WC'], 70, false]],
+ ['type' => 'function', 'function' => 'wcMusic', 'args' => [70]],
],
'wc/night' => [
['type' => 'hue', 'group' => $wc, 'scene' => 'eJy09JTEzCiIL1P'],
],
'sdb/ampli/on' => [
- ['type' => 'domoticz', 'device' => '1438', 'command' => true, 'priority' => true],
+ ['type' => 'domoticz', 'device' => '476', 'command' => true, 'priority' => true],
],
'sdb/ampli/off' => [
- ['type' => 'domoticz', 'device' => '1438', 'command' => false, 'priority' => true],
+ ['type' => 'domoticz', 'device' => '476', 'command' => false, 'priority' => true],
],
'sdb/off' => [
['type' => 'state', 'key' => 'sdb', 'value' => 0],
['type' => 'function', 'function' => 'stopSqueezeboxPlayer', 'args' => [$squeezeboxPlayers['Salle de bains'], false]],
],
'sdb/on' => [
+ ['type' => 'state', 'key' => 'sdb', 'value' => 1],
['type' => 'state', 'key' => 'sdb', 'value' => 1],
['type' => 'domoticz', 'scene' => 20, 'command' => true, 'priority' => true],
],
];
+function chambreRideaux($ouvre = true)
+{
+ $device = 1756;
+ $priority = true;
+ // ['type' => 'domoticz', 'device' => '1756', 'command' => 'Group Off', 'priority' => 'sync'],
+ if ($ouvre && getDomoticzDeviceStatus($device) === 'Off') {
+ return;
+ }
+ $cmd = $ouvre ? 'Group Off' : 'Group On';
+ domoticzSwitch($device, $cmd, 'light', $priority);
+ if ($ouvre) {
+ usleep(1000000 * 4.7);
+ domoticzSwitch($device, $cmd, 'light', $priority);
+ }
+}
+
function execScene($name, $fromUserAction = false, $transitionTime = null)
{
global $scenes;
+
$scene = $scenes[$name];
+ profile('Exec scene ' . $name . '/' . $fromUserAction, __FILE__, __LINE__);
+
$e = explode('/', $name);
if ($fromUserAction && $e[1] !== 'auto' && count($e) == 2) {
$action['device'] = $action['scene'];
$action['switchtype'] = 'scene';
}
- domoticzSwitch($action['device'], $action['command'], isset($action['switchtype']) ? $action['switchtype'] : 'light', isset($action['priority']) && $action['priority']);
+ domoticzSwitch($action['device'], $action['command'], isset($action['switchtype']) ? $action['switchtype'] : 'light', $action['priority'] ?? false);
} else if ($action['type'] == 'ir') {
irsend($action['room'], $action['device'], $action['command']);
} else if ($action['type'] == 'ifttt') {
}
}
+function wcMusic($volume)
+{
+ if (date('w') == '5') {
+ $music = 'Samba';
+ //$volume += 10;
+ } else {
+ $music = 'FIP';
+ }
+ squeezePlayByName($music, 'WC', $volume, false);
+}
+
function wcToggle()
{
if (getState('wc') == 1) {
function checkPlanetarium($periodicOffCheck = true)
{
- $device = 1452;
+ $device = 4617;
$on = getState('planetarium') == '1';
+ $h = date('G');
+ if ($h >= 2 && $h <= 20) {
+ $on = false;
+ }
if ($on) {
if ($periodicOffCheck) {
$min = intval(date('i'));
updateChambreAuto($transitionTime);
} else if (getState('chambreAutoMode') === '1') {
setState('chambreAutoMode', '0');
- try {
- if (isset($_SERVER['REQUEST_URI'])) {
- $r = $_SERVER['REQUEST_URI'];
- } else if (php_sapi_name() === 'cli') {
- $r = 'cli ';
- }
- throw new Error('Setting chambre auto mode to false in ' . $r);
- } catch (Error $e) {
- $log = ROOT . '/log/chambreautooff.log';
- file_put_contents($log, file_get_contents($log) . "\n\n" . date('Y-m-d H:i:s') . "\n" . $e->getMessage() . "\n" . $e->getTraceAsString());
- }
}
}
$timeout = $delay + 30;
$url = WEB_ROOT . 'scripts/light.php?delay=' . $delay . '&scene=' . $scene . '&sid=' . session_id();
return delayHttpCall($url, $timeout);
+}
+
+function alert()
+{
+ if (getNightMode()) {
+ return;
+ }
+
+ execScene('home/doalert');
+
+ $rep = 1 * 2;
+ $domoticzDevices = [4016, 4017, 4033, 4201, 4202, 4203, 4204, 4205, 4614, 4622];
+ $domoticzStates = [];
+
+ foreach ($domoticzDevices as $domoticzDevice) {
+ $domoticzStates[$domoticzDevice] = getDomoticzDeviceStatus($domoticzDevice);
+ }
+
+ for ($i = 0; $i < $rep; $i++) {
+ foreach ($domoticzDevices as $device) {
+ domoticzSwitch($device, 'Toggle', 'light', true);
+ }
+ }
+
+ $hue = getHueInstance();
+ $group = $hue->getGroups()[18];
+ $allLights = $hue->getLights();
+ $lights = [];
+
+ foreach ($group->getLightIds() as $lightId) {
+ $lights[$lightId] = $allLights[$lightId]->isOn();
+ }
+
+ for ($i = 0; $i < $rep; $i++) {
+ $reverse = $i % 2 === 0;
+ foreach ($lights as $light => $state) {
+ hueCommand(['light' => $light, 'scene' => ['on' => $reverse ? !$state : $state]]);
+ }
+ }
+
+ sleep(15);
+
+ foreach ($lights as $lightId => $state) {
+ hueCommand(['light' => $lightId, 'scene' => ['on' => $state]]);
+ }
+
+ foreach ($domoticzStates as $domoticzDevice => $domoticzState) {
+ domoticzSwitch($domoticzDevice, $domoticzState);
+ }
+
}
\ No newline at end of file
$device = getDevice($device);
$onlySound = in_array(shieldGetCurrentApp($device), ['spotify']);
+ profile('Run activity for shield ' . $device);
+
if ($device['id'] === 'salon') {
stopPlayersIn('salon', true, false);
denonAVROn('Media Player', $force);
- epson(true);
execScene('salon/cinema');
+ epson(true);
} else if ($device['id'] === 'bureau' || $device['id'] === 'bureausun') {
stopPlayersIn('bureau', true, false);
if ($onlySound) {
function shieldKodi($file, $device = null)
{
+ $url = shieldNormalizeURL($file);
+ profile('shield kodi ' . $file . '//' . $url, __FILE__, __LINE__);
shieldRunActivity($device);
shieldHome($device);
- shieldCommand('shell am start', '-a android.intent.action.VIEW -d \'"' . shieldNormalizeURL($file) . '"\' -n org.xbmc.kodi/.Splash', $device);
+ shieldCommand('shell am start', '-a android.intent.action.VIEW -d \'"' . $url . '"\' -n org.xbmc.kodi/.Splash', $device);
}
function shieldNormalizeURL($input)
{
if (strpos($input, '/nas') === 0) {
$input = str_replace('/nas/', '/', $input);
- return 'smb://Share:dcfyjbcyckwydtgufjx@192.168.13.4/Share/' . $input;
+ return NAS_ROOT . $input;
}
return $input;
}
'sbplayer' => 'com.angrygoat.android.sbplayer',
'spotify' => 'com.spotify.tv.android',
'steamlink' => 'com.valvesoftware.steamlink',
+ 'squeezeplayer' => 'de.bluegaspode.squeezeplayer',
+ 'tortuga' => 'fr.enhydra.tortuga.home',
];
}
{
if (shieldIsAwake($device)) {
$backToSleep = false;
- } else {
- shieldWakeup($device);
}
+ shieldWakeup($device);
if ($backToSleep) {
$d = getDevice($device);
$s = 'maskShield' . ucfirst($d['id']) . 'Wakeup';
function shieldLogcat($cases = [], $device = null)
{
+ $cmd = _adbcmd('logcat', '', $device);
+
+ `pkill -f "$cmd"`;
shieldConnect(false, $device);
$proc = new proc();
- $cmd = _adbcmd('logcat', '', $device);
+
echo $cmd . "\n";
$proc->open($cmd);
$proc->on($cases);
return $output;
}
+
function _adbcmd($command, $params, $device = null)
{
$device = getDevice($device);
return;
}
+
squeezeRequest('sync -', $player);
squeezeRequest('stop', $player);
squeezeRequest('power 0', $player);
if ($devices) {
$room = getRoomBySqueezeboxPlayer($player);
if ($room == 'salon') {
-
+ denonAVROff();
} else if ($room === 'sdb') {
execScene('sdb/ampli/off');
} else if ($room === 'bureau') {
denon(false);
}
}
+ profile('stopped squeezebox player ' . $player);
}
function getRoomBySqueezeboxPlayer($player)
return -1;
}
+ print_r($res);
if (!isset($res['result']) || !isset($res['result']['_mode'])) {
- return false;
+ return -2;
}
return $res['result']['_mode'] == 'play' ? 1 : 0;
}
global $squeezeboxPlayers;
$player = _player($player);
if ($player == $squeezeboxPlayers['Salon']) {
- denonAVROn('HEOS Music');
+ $state=denonAVRGetPowerState();
+ denonAVROn('HEOS Music', false);
+ sleep(4);
+ if(!$state){
+ denonAVROff();
+ denonAVROn('HEOS Music', true);
+ }
} else if ($player == $squeezeboxPlayers['Salle de bains']) {
execScene('sdb/ampli/on');
+ if (getSqueezePlayerStatus($player) < 0) {
+ phoneTask('Tortuga', 'sdb');
+ }
+
} else if ($player == $squeezeboxPlayers['Bureau']) {
- setState('maskShieldBureauWakeup', time() + 15);
harmonyActivity('musique');
- shieldRunAppAndBackHome('sbplayer', 'bureau', 1, false);
} else if ($player == $squeezeboxPlayers['Chambre']) {
denon(true);
}
function sshRunCommand($command, $device = null, $blocking = true, $sudo = false)
{
$ssh = getSSHInstance($device, $sudo);
- print_r($ssh);
if ($ssh) {
$stream = @ssh2_exec($ssh, $command);
if (!$stream) {
public function getAlphaShortcuts()
{
$letters = [];
+ foreach (str_split('#ABCDEFGHIJKLMNOPQRSTUVWXYZ') as $l) {
+ $letters[$l] = [];
+ }
+
foreach ($this->movies as $movie) {
- $firstLetter = $this->_firstLetter($movie['data']['title']);
- if (!isset($letters[$firstLetter])) {
- $letters[$firstLetter] = [];
+ $firstLetters = $this->_firstLetters([$movie['data']['title'], $movie['data']['original_title']]);
+ foreach ($firstLetters as $firstLetter) {
+ if (!isset($letters[$firstLetter])) {
+ continue;
+ }
+ $letters[$firstLetter][] = $movie;
}
- $letters[$firstLetter][] = $movie;
}
- ksort($letters);
-
return $this->_makeSub($letters, 'movies-alpha-', 'Films par titre', 'poster');
}
- protected function _firstLetter($title)
+ protected function _firstLetters($titles)
{
- $res = $this->remove_accents($title);
- $res = trim($res, '\'');
- $res = mb_substr($res, 0, 1);
- $res = mb_strtoupper($res);
- $res = preg_replace('|\d|', '#', $res);
+ $res = [];
+ $allTitles = [];
+ foreach ($titles as $title) {
+ $title = mb_strtolower($title);
+ $title = $this->remove_accents($title);
+ $title = trim($title, '\' ');
+ $allTitles[] = $title;
+ $allTitles[] = $this->_removeMeanlessWords($title);
+ }
- return $res;
+ $allTitles = array_unique($allTitles);
+ foreach ($allTitles as $title) {
+ $letter = mb_substr($title, 0, 1);
+ $letter = mb_strtoupper($letter);
+ $letter = preg_replace('|\d|', '#', $letter);
+ $res[] = $letter;
+ }
+
+ return array_unique($res);
+ }
+
+ protected function _removeMeanlessWords($title)
+ {
+ $remove = ['un', 'une', 'le', 'la', 'l', 'the', 'a', 'der', 'die', 'das', 'ein', 'el', 'una'];
+ $e = preg_split('/(\s|\')/', mb_strtolower($title));
+ $res = [];
+ foreach ($e as $item) {
+ if (!in_array($item, $remove)) {
+ $res[] = $item;
+ }
+ }
+ return implode(' ', $res);
}
protected function remove_accents($string)
$res .= '<tr><td class="hicon livingroom"><i class="fa fa-cocktail"></i></td><td class="livingroom">' . $weather['livingroom_temp'] . ' °C</td><td class="hicon hum livingroom"><i class="fa fa-tint"></i></td><td class="hum livingroom">' . $weather['livingroom_humidity'] . '%</td>';
$res .= '<td class="sep"></td><td class="hicon office"><i class="fa fa-plane"></i></td><td class="office">' . $weather['office_temp'] . ' °C</td><td class="hicon hum office"><i class="fa fa-tint"></i></td><td class="hum office">' . $weather['office_humidity'] . '%</td></tr>';
$res .= '<tr><td class="hicon wc"><i class="fa fa-toilet"></i></td><td class="wc">' . $weather['wc_temp'] . ' °C</td><td class="hicon hum wc"><i class="fa fa-tint"></i></td><td class="hum wc">' . $weather['wc_humidity'] . '%</td>';
- $res .= '<td class="sep"></td><td class="hicon bedroom"><i class="fa fa-bed"></i></td><td class="bedroom">' . $weather['bedroom_temp'] . ' °C</td><td class="hicon hum bedroom"><i class="fa fa-tint"></i></td><td class="hum bedroom">' . $weather['bedroom_humidity'] . '%</td></tr>';
- $res .= '<tr><td class="hicon bathroom"><i class="fa fa-bath"></i></td><td class="bathroom">' . $weather['bathroom_temp'] . ' °C</td><td class="hicon hum bathroom"><i class="fa fa-tint"></i></td><td class="hum bathroom">' . $weather['bathroom_humidity'] . '%</td></tr>';
+ $res .= '<td class="sep"></td><td class="hicon bedroom"><i class="fa fa-bed"></i></td><td class="bedroom">' . $weather['bedroom_temp'] . ' °C</td><td class="hicon hum bedroom"><i class="fa fa-tint"></i></td><td class="hum bedroom">' . $weather['bedroom_humidity'] . '%</td>';
+ $res .= '<tr><td class="hicon bathroom"><i class="fa fa-bath"></i></td><td class="bathroom">' . $weather['bathroom_temp'] . ' °C</td><td class="hicon hum bathroom"><i class="fa fa-tint"></i></td><td class="hum bathroom">' . $weather['bathroom_humidity'] . '%</td>';
+ $res .= '<td class="sep"></td><td class="hicon cellar"><i class="fa fa-bat"></i></td><td class="cellar">' . $weather['cellar_temp'] . ' °C</td><td class="hicon hum cellar"><i class="fa fa-tint"></i></td><td class="hum cellar">' . $weather['cellar_humidity'] . '%</td></tr>';
$res .= '</table>';
$res .= '</div>';
$res .= '<div class="forecasts">';
echo getPlaying($_GET['device']);
}
-if ($_GET['small'] == 1) {
+if (isset($_GET['small']) && $_GET['small'] == 1) {
sleep(3);
moveVLC(false);
}
\ No newline at end of file
<?php
require_once "import.php";
+$device = $_GET['device'] ?? null;
echo '<pre>';
if (isset($_GET['key'])) {
- shieldKey($_GET['key']);
+ shieldKey($_GET['key'], $device);
} else if (isset($_GET['netflix'])) {
- shieldNetflix($_GET['netflix']);
+ shieldNetflix($_GET['netflix'], $device);
} else if (isset($_GET['text'])) {
- shieldText($_GET['text']);
+ shieldText($_GET['text'], $device);
} else if (isset($_GET['action'])) {
if ($_GET['action'] == 'apps') {
- shieldListApps();
+ shieldListApps($device);
} else if ($_GET['action'] == 'currentApp') {
- shieldGetCurrentApp();
+ shieldGetCurrentApp($device);
}
} else if (isset($_GET['intents'])) {
- shieldFindIntents($_GET['intents']);
-} elseif (isset($_GET['tv'])) {
- shieldTv($_GET['tv']);
-} elseif (isset($_GET['live'])) {
- shieldTv($_GET['live']);
-} else if (isset($_GET['replay'])) {
- shieldTv($_GET['replay'], 'replay');
+ shieldFindIntents($_GET['intents'], $device);
} else if (isset($_GET['vlc'])) {
- shieldVLC($_GET['vlc']);
+ shieldVLC($_GET['vlc'], $device);
} else if (isset($_GET['kodi'])) {
- shieldKodi($_GET['kodi']);
+ shieldKodi($_GET['kodi'], $device);
} else if (isset($_GET['mycanal'])) {
$e = explode(':', $_GET['mycanal']);
- shieldMyCanal($e[1], $e[0]);
+ shieldMyCanal($e[1], $e[0], $device);
} else if (isset($_GET['runappback'])) {
- shieldRunAppAndBackHome($_GET['runappback']);
-}else if(isset($_GET['netflix'])){
- shieldNetflix();
+ shieldRunAppAndBackHome($_GET['runappback'], $device);
}
echo '</pre>';
\ No newline at end of file
<?php
require_once "import.php";
-print_r(sleepPC('avion', true));
\ No newline at end of file
+print_r(shutdownPC('avion', true, true));
\ No newline at end of file
<?php
require_once "import.php";
-if(isset($_GET['name'])){
+set_time_limit(5);
+
+if (isset($_GET['name'])) {
squeezePlayByName($_GET['name'], $_GET['player']);
exit;
}
$requests = json_decode($_GET['requests']);
}
-if (!in_array('stop', $requests) || isset($_GET['name'])) {
- if ($_GET['player'] == 'Salon') {
-
- } elseif ($_GET['player'] == 'Salle de bains') {
- execScene('sdb/ampli/on');
- } else if ($_GET['player'] === 'Bureau') {
- setState('maskShieldBureauWakeup', time()+15);
- print_r(harmonyActivity("musique"));
- }
- setPlaying('squeezebox');
-} else {
- if ($_GET['player'] == 'Salle de bains') {
- //execScene('sdb/ampli/off');
- }
- if (getPlaying() == 'squeezebox') {
- setPlaying('');
- }
-}
-
if (isset($_GET['type']) && $_GET['type'] == 'squeeze_spotify') {
checkSpottyLogin(true);
}
- $res = [];
- foreach ($requests as $request) {
- $res[] = squeezeRequest($request, $_GET['player']);
- }
+$res = [];
+foreach ($requests as $request) {
+ squeezeRequest($request, $_GET['player']);
+}
<?php
require_once "import.php";
-getSqueezePlayerStatus();
\ No newline at end of file
+echo _player() . ':' . getSqueezePlayerStatus();
\ No newline at end of file
-#!/usr/bin/php7.4
+#!/usr/bin/php
<?php
$n = $argv[1];
-#!/usr/bin/php7.4
+#!/usr/bin/php
<?php
-#!/usr/bin/php7.4
+#!/usr/bin/php
<?php
require_once __DIR__ . "/../scripts/import.php";
<?php
require_once __DIR__ . "/../scripts/import.php";
-if (!isset($device)) {
- $device = 'salon';
-}
-
// Set time limit to indefinite execution
set_time_limit(0);
ignore_user_abort(true);
},
'Waking up from sleep' => function () use ($device) {
echo 'wakeup ' . $device . "\n";
- if ($device == 'salon') {
- $state = 'maskShieldSalonWakeup';
- $squeezePlayer = 'Salon';
- } else if ($device === 'bureau') {
- $state = 'maskShieldBureauWakeup';
- $squeezePlayer = 'Bureau';
- }
- if (getState($state, '0') < time() && getSqueezePlayerStatus($squeezePlayer) <= 0) {
- shieldRunActivity($device,true);
- }
+ shieldRunActivity(null, true);
},
'WindowManager: handleComboKeys keyCode: 25, keyAction: 1' => function () use ($device) {
echo 'volume-down ' . $device . "\n";
- if ($device === 'bureau') {
- volume('3', '-', 'harmony');
- } else if ($device === 'salon') {
- volume('2', '-', 'denonavr');
- }
+ volume(config('VOLUME_STEP'), '-');
},
'WindowManager: handleComboKeys keyCode: 24, keyAction: 1' => function () use ($device) {
echo 'volume-up ' . $device . "\n";
- if ($device === 'bureau') {
- volume('3', '+', 'harmony');
- } else if ($device === 'salon') {
- volume('2', '+', 'denonavr');
- }
+ volume(config('VOLUME_STEP'), '+');
}
];
echo 'Run home server logcat ' . $device . "\n";
-while (true) {
- shieldLogcat($cases, $device);
- echo 'Logcat ended' . "\n----\n";
-}
+shieldLogcat($cases, $device);
+echo 'Logcat ended' . "\n----\n";
-#!/usr/bin/php7.4
+#!/usr/bin/php
<?php
-$device = 'bureau';
+$forceConfig = $device = 'bureau';
include_once "logcat.php";
\ No newline at end of file
-#!/usr/bin/php7.4
+#!/usr/bin/php
<?php
-$device = 'salon';
+$forceConfig = $device = 'salon';
include_once "logcat.php";
\ No newline at end of file
-#!/usr/bin/php7.4
+#!/usr/bin/php
<?php
require_once __DIR__ . "/../scripts/import.php";
-#!/usr/bin/php7.4
+#!/usr/bin/php
<?php
require_once __DIR__ . "/../scripts/import.php";
}
.video-background {
background: #000;
- position: fixed;
+ position: absolute;
top: 0;
right: 0;
bottom: 0;
height: 100%;
}
+
body {
background-color: #000000;
&[data-type="gradient"] {
.video-background {
background: #000;
- position: fixed;
+ position: absolute;
top: 0;
right: 0;
bottom: 0;
#burger {
@w: 14vh;
- @o: unit(@w/2, vh);
+ @o: unit((@w/2), vh);
position: fixed;
right: @o;
bottom: @o;
color: #fff;
right: @f;
bottom: @f;
- font-size: unit(@f/45*55, vh);
+ font-size: unit((@f/45)*55, vh);
}
}
#weatherstation .contents .house .office {
color: #051234;
}
+#weatherstation .contents .house .cellar {
+ color: #978270;
+}
#weatherstation .contents .house td {
vertical-align: bottom;
text-align: left;
width: 100%;
height: 100%;
+
.contents {
position: absolute;
top: 0px;
white-space: nowrap;
position: absolute;
left: 200px;
- height:100%;
+ height: 100%;
.icon {
width: 200px;
width: 100%;
margin: 40px 20px 0;
position: absolute;
- bottom:20px;
+ bottom: 20px;
.sep {
min-width: 25px;
color: #051234;
}
+ .cellar {
+ color: #978270;
+ }
+
+
td {
vertical-align: bottom;
text-align: left;
}
.curvemix(@width,@margin,@color) {
+
+ @halfw: (@width / 2);
+
position: absolute;
- width: unit(@width+@margin*2, px);
+ width: unit(@width + @margin * 2, px);
height: unit(@width, px);
.orbit {
position: absolute;
.horizon {
position: absolute;
left: 0px;
- width: unit(@width+@margin*2, px);
- top: unit(@width/2-1, px);
+ width: unit(@width + @margin * 2, px);
+ top: unit(@halfw - 1, px);
border-top: 1px dashed @color;
z-index: 1;
}
display: block;
position: absolute;
top: -17px;
- left: unit(@width/-2-15, px);
+ left: unit((-1 * @halfw) - 15, px);
z-index: 3;
}
position: absolute;
- top: unit(@width/2, px);
- left: unit(@width/2+@margin, px);
+ top: unit(@halfw, px);
+ left: unit(@halfw+@margin, px);
z-index: 3;
transform-origin: 0 0 0;
}