From: Vincent Date: Tue, 3 Nov 2020 07:49:44 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e2bb78a2cc8369f6ca2cb55d81b860ea888789ba;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8d03771..8156e3e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,9 +3,10 @@ - + + - + @@ -1282,12 +1294,12 @@ - - + + - + @@ -1305,10 +1317,6 @@ - - - - diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index fa4c657..1310b22 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -73,6 +73,7 @@ function cronEcoMode($cronmin) _logSection('Ecomode'); $ecomode = (int)getEcoMode(); $scenes = [0 => 'off', 1 => 'on', 2 => 'super']; + execScene('ecomode/' . $scenes[$ecomode]); } diff --git a/scripts/lib/ecomode.php b/scripts/lib/ecomode.php index 202e1d4..ca88c74 100644 --- a/scripts/lib/ecomode.php +++ b/scripts/lib/ecomode.php @@ -1,15 +1,18 @@ 'off', 1 => 'on', 2 => 'super']; execScene('ecomode/' . $scenes[$mode]); - -// $server = new \Hoa\Eventsource\Server(); -// $server->ecomode->send($mode); } function disableSuperEcoMode() diff --git a/scripts/lib/harmony.php b/scripts/lib/harmony.php index ef03b7b..d8166fa 100644 --- a/scripts/lib/harmony.php +++ b/scripts/lib/harmony.php @@ -30,13 +30,13 @@ function harmonyRequest($uri, $method = 'GET', $hub = 'salon') function harmonyActivity($activity) { - if ($activity == 'tv' || $activity == 'poweroff' || $activity == 'off') { + if ($activity == 'tv' || $activity == 'shield' || $activity == 'poweroff' || $activity == 'off') { setPlaying('mycanal', 'salon'); } $wait = 0; $current = getCurrentHarmonyActivity(); if ($current == 'off' || $current == 'poweroff' || !$current) { - if ($activity == 'media') { + if ($activity == 'media' || $activity == 'shield' || $activity == 'tv') { $wait = 30; } } diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index d716daa..e2453ba 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -56,25 +56,60 @@ $scenes = [ ['type' => 'nightmode', 'mode' => '0'], ['type' => 'function', 'function' => 'chambreAuto', 'args' => [true]], ], + 'chambre/bed/base' => [ + ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]], + ['type' => 'nightmode', 'mode' => '1'], + ['type' => 'ecomode', 'mode' => '1'], + ['type' => 'state', 'key' => 'chambre', 'value' => 0], + ['type' => 'scene', 'scene' => 'chambre/rideaux/close'], + ['type' => 'insteon', 'command' => '0?1131=I=0=0'], + ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]], + ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'], + ['type' => 'scene', 'scene' => 'chambre/raspberry/off'], + ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Va Au Lit'], + ], 'chambre/bed' => [ - ['type' => 'scene', 'scene' => 'chambre/bedbase'], + ['type' => 'scene', 'scene' => 'chambre/bed/base'], ['type' => 'scene', 'scene' => 'chambre/nightlights'], + ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'], + ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on ['type' => 'scene', 'scene' => 'sdb/nuit'], ['type' => 'scene', 'scene' => 'chambre/cheminee'], ], - 'chambre/bedbase' => [ - ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]], + 'chambre/bed/off' => [ + ['type' => 'scene', 'scene' => 'chambre/bed/base'], ['type' => 'nightmode', 'mode' => '1'], ['type' => 'ecomode', 'mode' => '1'], + ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'], + ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'], + ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]], + ['type' => 'scene', 'scene' => 'chambre/cheminee/off'], + ], + 'chambre/sleep/off' => [ + ['type' => 'scene', 'scene' => 'chambre/bed/base'], + ['type' => 'scene', 'scene' => 'sdb/off'], + ], + 'chambre/sleep/base' => [ + ['type' => 'nightmode', 'mode' => '1'], + ['type' => 'ecomode', 'mode' => '1'], + ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]], ['type' => 'state', 'key' => 'chambre', 'value' => 0], - ['type' => 'scene', 'scene' => 'chambre/rideaux/close'], - ['type' => 'insteon', 'command' => '0?1131=I=0=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' => 'scene', 'scene' => 'sdb/off'], ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'], - ['type' => 'scene', 'scene' => 'chambre/raspberry/off'], - ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Va Au Lit'], + ['type' => 'delay', 'scene' => 'chambre/planetarium/off', 'delay' => 3600], // Planétarium off dans une heure ], + 'chambre/sleep' => [ + ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'], + ['type' => 'hue', 'group' => $chambre, 'scene' => '-P3feFyrTnFNfXi'], // Veilleuse + + ['type' => 'domoticz', 'scene' => 10, 'command' => true, 'priority' => true], + ['type' => 'scene', 'scene' => 'chambre/sleep/base'], + ['type' => 'delay', 'scene' => 'chambre/bed/off', 'delay' => 300], // Tout off dans 5 min + ], + 'chambre/boreal' => [ ['type' => 'nightmode', 'mode' => '0'], ['type' => 'state', 'key' => 'chambre', 'value' => 1], @@ -127,31 +162,7 @@ $scenes = [ ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]], ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'], ], - 'chambre/sleepoff' => [ - ['type' => 'scene', 'scene' => 'chambre/bedbase'], - ['type' => 'scene', 'scene' => 'sdb/off'], - ['type' => 'scene', 'scene' => 'sdb/off'], - ], - 'chambre/sleepbase' => [ - ['type' => 'nightmode', 'mode' => '1'], - ['type' => 'ecomode', 'mode' => '1'], - ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]], - ['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' => 'scene', 'scene' => 'sdb/off'], - ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'], - ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on - ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'], - ['type' => 'delay', 'scene' => 'chambre/bedoff', 'delay' => 300], // Tout off dans 5 min - ['type' => 'delay', 'scene' => 'chambre/planetarium/off', 'delay' => 3600], // Planétarium off dans une heure - ], - 'chambre/sleep' => [ - ['type' => 'hue', 'group' => $chambre, 'scene' => '-P3feFyrTnFNfXi'], // Veilleuse + - ['type' => 'domoticz', 'scene' => 10, 'command' => true, 'priority' => true], - ['type' => 'scene', 'scene' => 'chambre/sleepbase'], - ], + 'chambre/moon' => [ ['type' => 'hue', 'group' => $chambre, 'scene' => '5PKfoOn8ss17o2l'], // Clair de lune ['type' => 'domoticz', 'scene' => 11, 'command' => true, 'priority' => true], @@ -234,14 +245,7 @@ $scenes = [ ['type' => 'insteon', 'command' => '0?1332=I=0=0'], ['type' => 'domoticz', 'scene' => 19, 'command' => false, 'priority' => true], ], - 'chambre/bedoff' => [ - ['type' => 'nightmode', 'mode' => '1'], - ['type' => 'ecomode', 'mode' => '1'], - ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'], - ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'], - ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]], - ['type' => 'scene', 'scene' => 'chambre/cheminee/off'], - ], + 'chambre/cheminee' => [ ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['chambre', 'fire', 1]], ], @@ -305,12 +309,12 @@ $scenes = [ ['type' => 'domoticz', 'device' => '392', 'command' => true, 'priority' => true], ], 'home/aulit' => [ - ['type' => 'scene', 'scene' => 'chambre/aulitbase'], + ['type' => 'scene', 'scene' => 'home/aulitbase'], ['type' => 'scene', 'scene' => 'chambre/bed'], ], 'home/aulitoff'=>[ - ['type' => 'scene', 'scene' => 'chambre/aulitbase'], - ['type' => 'scene', 'scene' => 'chambre/off'], + ['type' => 'scene', 'scene' => 'home/aulitbase'], + ['type' => 'scene', 'scene' => 'chambre/bed/off'], ['type' => 'scene', 'scene' => 'sdb/off'], ], 'home/aulitbase' => [