From: Vincent Date: Tue, 16 Jun 2020 06:19:24 +0000 (+0200) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4c68cc18927d4a51fb47b1a39b20540d3a18c444;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index edbce86..2cdf70f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,11 +2,13 @@ + + + + - - - - + + - - - - - - - @@ -256,6 +251,13 @@ + + + + + + + @@ -834,14 +836,8 @@ - - - - 1578855521161 - 1578900097020 @@ -1179,7 +1175,14 @@ - @@ -1229,25 +1232,27 @@ - - + + + - + - + - - + + + diff --git a/config/balcon.php b/config/balcon.php new file mode 100644 index 0000000..700b9e2 --- /dev/null +++ b/config/balcon.php @@ -0,0 +1,23 @@ + + + + + '; + + $favoriteslights = [ + + ]; + $favoriteslights = array_merge($favoriteslights, $c['favorites']); + include "default.php"; +} \ No newline at end of file diff --git a/config/cour.php b/config/cour.php new file mode 100644 index 0000000..0b54ce5 --- /dev/null +++ b/config/cour.php @@ -0,0 +1,22 @@ + + + + + '; + $favoriteslights = [ + + ]; + $favoriteslights = array_merge($favoriteslights, $c['favorites']); + include "default.php"; +} \ No newline at end of file diff --git a/config/rooms.php b/config/rooms.php index 7f5c6cc..d255b68 100644 --- a/config/rooms.php +++ b/config/rooms.php @@ -1,6 +1,6 @@ 'Maison', 'salon' => 'Salon', 'chambre' => 'Chambre', 'bureau' => 'Bureau', 'sdb' => 'Salle de bain'); +$rooms = array('home' => 'Maison', 'salon' => 'Salon', 'chambre' => 'Chambre', 'bureau' => 'Bureau', 'sdb' => 'Salle de bain', 'cour' => 'Cour', 'wc' => 'WC'); function chambre($additionnalfavorites = array()) { @@ -139,6 +139,39 @@ function wc() ['type' => 'light', 'scene' => 'wc/off', 'label' => 'éteindre'], ['type' => 'light', 'scene' => 'wc/spa', 'label' => 'spa'], ['type' => 'light', 'scene' => 'wc/nuit', 'label' => 'nuit'], + ['type' => 'separator', 'label' => 'VMC'], + ['type' => 'light', 'scene' => 'wc/vmc/on', 'label' => 'Allumer'], + ['type' => 'light', 'scene' => 'wc/vmc/off', 'label' => 'éteindre'], + ]; + $all = array_merge($favorites, [ + + ]); + return array('all' => $all, 'favorites' => $favorites); +} + +function cour() +{ + $favorites = [ + ['type' => 'light', 'scene' => 'cour/on', 'label' => 'Allumer'], + ['type' => 'light', 'scene' => 'cour/off', 'label' => 'éteindre'], + ['type' => 'separator', 'label' => 'Projecteurs'], + ['type' => 'light', 'scene' => 'cour/projecteurs/on', 'label' => 'Allumer'], + ['type' => 'light', 'scene' => 'cour/projecteurs/off', 'label' => 'éteindre'], + ]; + $all = array_merge($favorites, [ + + ]); + return array('all' => $all, 'favorites' => $favorites); +} + +function balcon() +{ + $favorites = [ +// ['type' => 'light', 'scene' => 'cour/on', 'label' => 'Allumer'], +// ['type' => 'light', 'scene' => 'cour/off', 'label' => 'éteindre'], +// ['type' => 'separator', 'label' => 'Projecteurs'], +// ['type' => 'light', 'scene' => 'cour/projecteurs/on', 'label' => 'Allumer'], +// ['type' => 'light', 'scene' => 'cour/projecteurs/off', 'label' => 'éteindre'], ]; $all = array_merge($favorites, [ diff --git a/images/backgrounds/balcon.jpg b/images/backgrounds/balcon.jpg new file mode 100644 index 0000000..a5e7e73 Binary files /dev/null and b/images/backgrounds/balcon.jpg differ diff --git a/images/backgrounds/cour.jpg b/images/backgrounds/cour.jpg new file mode 100644 index 0000000..b7404c5 Binary files /dev/null and b/images/backgrounds/cour.jpg differ diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 2d95a24..df4183e 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -275,6 +275,7 @@ $scenes = [ ['type' => 'scene', 'scene' => 'chambre/bed'], ['type' => 'scene', 'scene' => 'bureau/off'], ['type' => 'scene', 'scene' => 'salon/off'], + ['type' => 'scene', 'scene' => 'cour/off'], ['type' => 'function', 'function' => 'stopHarmony'], ['type' => 'function', 'function' => 'stopAllSqueezebox'], ], @@ -443,10 +444,12 @@ $scenes = [ ['type' => 'scene', 'scene' => 'home/hueoff'], ['type' => 'ecomode', 'mode' => '2'], ['type' => 'scene', 'scene' => 'salon/off'], + ['type' => 'scene', 'scene' => 'cour/off'], ['type' => 'scene', 'scene' => 'bureau/off'], ['type' => 'scene', 'scene' => 'chambre/off'], ['type' => 'scene', 'scene' => 'sdb/off'], ['type' => 'scene', 'scene' => 'wc/off'], + ['type' => 'scene', 'scene' => 'cour/off'], ['type' => 'function', 'function' => 'stopHarmony'], ['type' => 'function', 'function' => 'stopAllSqueezebox'], ['type' => 'function', 'function' => 'offAllOMX'], @@ -464,6 +467,7 @@ $scenes = [ ['type' => 'scene', 'scene' => 'bureau/auto'], ['type' => 'scene', 'scene' => 'chambre/auto'], ['type' => 'scene', 'scene' => 'sdb/on'], + ['type' => 'scene', 'scene' => 'cour/on'], ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'], ], 'home/hueoff' => [ @@ -475,6 +479,9 @@ $scenes = [ ['type' => 'function', 'function' => 'squeezeRequest', 'args' => ['power 1', $squeezeboxPlayers['Salon']]], ['type' => 'function', 'function' => 'squeezeRequest', 'args' => ['play', $squeezeboxPlayers['Salon']]] ], + 'wc/on' => [ + ['type' => 'function', 'function' => 'wcOn'], + ], 'wc/morning' => [ ['type' => 'hue', 'group' => $wc, 'scene' => 'NC5ejamHGUNURj8'], ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['FIP', $squeezeboxPlayers['WC'], 30, false]], @@ -509,6 +516,13 @@ $scenes = [ ['type' => 'hue', 'group' => $wc, 'scene' => ['effect' => 'colorloop', 'on' => true, 'brightness' => 128]], ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['WC'], 65]], ], + 'wc/vmc/on' => [ + ['type' => 'function', 'function' => 'wcVMCOn'], + ], + 'wc/vmc/off' => [ + ['type' => 'function', 'function' => 'wcVMCOff', 'args' => [0]], + ], + 'sdb/ampli/on' => [ ['type' => 'domoticz', 'device' => '1438', 'command' => true, 'priority' => true], ], @@ -541,10 +555,22 @@ $scenes = [ ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['Salle de bains'], 65]], ], 'salon/freebox/on' => [ - ['type' => 'domoticz', 'device' => '1439', 'command' => true, 'priority' => true], + ['type' => 'domoticz', 'device' => '1439', 'command' => true], ], 'salon/freebox/off' => [ - ['type' => 'domoticz', 'device' => '1439', 'command' => false, 'priority' => true], + ['type' => 'domoticz', 'device' => '1439', 'command' => false], + ], + 'cour/on' => [ + ['type' => 'domoticz', 'device' => '678', 'command' => true], + ], + 'cour/off' => [ + ['type' => 'domoticz', 'device' => '678', 'command' => false], + ], + 'cour/projecteurs/on' => [ + ['type' => 'domoticz', 'device' => '679', 'command' => true], + ], + 'cour/projecteurs/off' => [ + ['type' => 'domoticz', 'device' => '679', 'command' => false], ], 'ecomode/basic' => [ ['type' => 'scene', 'scene' => 'sdb/ampli/off'], @@ -896,6 +922,9 @@ function wcVMCOff($timeout = 600) function _wcVMCOff($timeout) { + if ($timeout === 0) { + return insteonCommand('0?1334=I=0=0'); + } $rand = rand(100000, 1000000); setState('wcTimeout', $rand); sleep($timeout);