]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 10 Jan 2023 07:47:44 +0000 (08:47 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 10 Jan 2023 07:47:44 +0000 (08:47 +0100)
.htaccess
.idea/dataSources.local.xml
.idea/workspace.xml
scripts/lib/scenes.php

index 09c0204116a38e4168228f864309c0cb1d41676f..c6081bf3f713c80c6a0d235c28e58aeac330c9c9 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -1,4 +1,4 @@
-Require ip 192.168.1.0/24 192.168.13.0/24 127.0.0.0/8 88.190.245.49 192.168.0.0/16 172.0.0.0/8
+Require ip 127.0.0.0/8 88.190.245.49 192.168.0.0/16 172.0.0.0/8
 <IfModule mod_rewrite.c>
         Options +FollowSymlinks
         RewriteEngine on
index 19eb798ff6ee4abff82fa1afc0ce979a65eb58fb..a2ba83682b3ee200a8f68dbd0700672e062ed5e0 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="dataSourceStorageLocal" created-in="IU-223.7571.182">
+  <component name="dataSourceStorageLocal" created-in="IU-223.8214.52">
     <data-source name="LFY(3).db" uuid="e5a3291d-855f-44b2-be41-76fe6b0c2136">
       <database-info product="SQLite" version="3.25.1" jdbc-version="2.1" driver-name="SQLite JDBC" driver-version="3.25.1" dbms="SQLITE" exact-version="3.25.1" exact-driver-version="3.25">
         <identifier-quote-string>&quot;</identifier-quote-string>
index 1b9be3fae5b975140b35ffd9ff38f3533d891606..f7f586ee375d551417acdefa28dc7c53cefabab1 100644 (file)
@@ -5,10 +5,9 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
-      <change afterPath="$PROJECT_DIR$/scripts/lib/klarstein.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.htaccess" beforeDir="false" afterPath="$PROJECT_DIR$/.htaccess" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/dataSources.local.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.local.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/rooms.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/rooms.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
       <workItem from="1669880798666" duration="763000" />
       <workItem from="1670747610011" duration="3339000" />
       <workItem from="1670938658004" duration="715000" />
-      <workItem from="1671182830643" duration="65000" />
-    </task>
-    <task id="LOCAL-00496" summary=".">
-      <created>1640269478891</created>
-      <option name="number" value="00496" />
-      <option name="presentableId" value="LOCAL-00496" />
-      <option name="project" value="LOCAL" />
-      <updated>1640269478907</updated>
+      <workItem from="1671182830643" duration="354000" />
+      <workItem from="1671608997335" duration="2669000" />
+      <workItem from="1672343219774" duration="322000" />
+      <workItem from="1672344461763" duration="1440000" />
+      <workItem from="1672659425048" duration="1077000" />
+      <workItem from="1673335540351" duration="136000" />
     </task>
     <task id="LOCAL-00497" summary=".">
       <created>1640525937679</created>
       <option name="project" value="LOCAL" />
       <updated>1669881079546</updated>
     </task>
-    <option name="localTasksCounter" value="545" />
+    <task id="LOCAL-00545" summary=".">
+      <created>1671182986722</created>
+      <option name="number" value="00545" />
+      <option name="presentableId" value="LOCAL-00545" />
+      <option name="project" value="LOCAL" />
+      <updated>1671182986722</updated>
+    </task>
+    <option name="localTasksCounter" value="546" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index b277c2c936089fa1ea00187694417c7fe23742df..db6e85652aaf52dc48ce7e73f1defe312cd599a5 100644 (file)
@@ -24,1445 +24,1415 @@ $alert = 16;
 $chambrefan = 4616;
 
 $scenes = [
-    'chambre/matin' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'ecomode', 'mode' => '0'],
-        ['type' => 'scene', 'scene' => 'chambre/nightlights'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'dawn', 'delay' => 1],
-        ['type' => 'scene', 'scene' => 'chambre/rideaux/open', 'delay' => 31],
-        ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
-        ['type' => 'scene', 'scene' => 'chambre/planetarium/off'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Matin'],
-        ['type' => 'scene', 'scene' => 'chambre/auto', 'delay' => 35],
-        ['type' => 'scene', 'scene' => 'cuisine/coffee/on'],
-    ],
-    'chambre/deshumidificateur/on' => [
-        //['type' => 'domoticz', 'device' => $chambrefan, 'command' => true],
-    ],
-    'chambre/deshumidificateur/off' => [
-        //['type' => 'domoticz', 'device' => $chambrefan, 'command' => false],
-    ],
-    'chambre/fan/on' => [
-        ['type' => 'domoticz', 'device' => $chambrefan, 'command' => true],
-    ],
-    'chambre/fan/off' => [
-        ['type' => 'domoticz', 'device' => $chambrefan, 'command' => false],
-    ],
-    'chambre/fan/toggle' => [
-        ['type' => 'domoticz', 'device' => $chambrefan, 'command' => 'Toggle'],
-    ],
-    'chambre/auto' => [
-        ['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' => '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' => 'phonetask', 'phone' => 'vincent', 'task' => 'Va Au Lit'],
-    ],
-    'chambre/bed' => [
-        ['type' => 'scene', 'scene' => 'chambre/bed/base'],
-        ['type' => 'scene', 'scene' => 'chambre/nightlights'],
-        ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on
-        ['type' => 'scene', 'scene' => 'sdb/nuit'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'],
-    ],
-    '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'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/off', 'delay' => 2],
-    ],
-    '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' => 'insteon', 'command' => '0?1332=I=0=0'], // Lustre et tableau off
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
-        ['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' => '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' => 'hue', 'group' => $chambre, 'scene' => 'mwAGvt2n70oXCqA'],
-        ['type' => 'domoticz', 'scene' => 4, 'command' => true, 'priority' => true],
-        //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
-    ],
-    'chambre/savane' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'ABqCuE-ob-sw2vQ'],
-        ['type' => 'domoticz', 'scene' => 5, 'command' => true, 'priority' => true],
-        //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/focus' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'Ne6uJnnoPO9yRhl'],
-        ['type' => 'domoticz', 'scene' => 6, 'command' => true, 'priority' => true],
-        //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
-    ],
-    'chambre/chillout' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => '03gdSwPyZ9sbZVg'],
-        ['type' => 'domoticz', 'scene' => 7, 'command' => true, 'priority' => true],
-        //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/reading/fireplace' => [
-        ['type' => 'scene', 'scene' => 'chambre/chillout'],
-        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Cheminée', $squeezeboxPlayers['Chambre']]],
-    ],
-    'chambre/reading' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'BNiNQjxiWNbKRaH'],
-        ['type' => 'domoticz', 'scene' => 8, 'command' => true, 'priority' => true],
-        // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/tonic' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'Tlcft9sPK492cJA'],
-        ['type' => 'domoticz', 'scene' => 9, 'command' => true, 'priority' => true],
-        // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
-    ],
-
-    'chambre/moon' => [
-        ['type' => 'hue', 'group' => $chambre, 'scene' => '5PKfoOn8ss17o2l'], // Clair de lune
-        ['type' => 'domoticz', 'scene' => 11, 'command' => true, 'priority' => true],
-        ['type' => 'scene', 'scene' => 'chambre/sleepbase'],
-    ],
-    'chambre/party' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'qvQXHDodBPa0cZf'],
-        ['type' => 'domoticz', 'scene' => 12, 'command' => true, 'priority' => true],
-        //['type' => 'insteon', 'command' => '0?1119=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/flowers' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'VtGPKtpQ7DF-RCd'],
-        ['type' => 'domoticz', 'scene' => 13, 'command' => true, 'priority' => true],
-        //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/tropical' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'Mqq8VMsmPQtzEQ0'],
-        ['type' => 'domoticz', 'scene' => 14, 'command' => true, 'priority' => true],
-        // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/beach' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'HfMaPG92lEOUDB0'],
-        ['type' => 'domoticz', 'scene' => 15, 'command' => true, 'priority' => true],
-        //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/nightlights' => [
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'JNieZpDHu5fbMyf'],
-        ['type' => 'domoticz', 'scene' => 16, 'command' => true, 'priority' => true],
-    ],
-    'chambre/summernight' => [
-        ['type' => 'scene', 'scene' => 'chambre/nightlights'],
-        //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/lounge' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'XGuSVQ3RCd7JUBC'],
-        ['type' => 'domoticz', 'scene' => 17, 'command' => true, 'priority' => true],
-        // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/full' => [
-        ['type' => 'nightmode', 'mode' => '0'],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => 'ZkiQbNQDXJz9-OC'],
-        ['type' => 'domoticz', 'scene' => 18, 'command' => true, 'priority' => true],
-        // ['type' => 'insteon', 'command' => '0?1132=I=0=0'],
-        ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee'],
-    ],
-    'chambre/off' => [
-        ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'],
-        ['type' => 'scene', 'scene' => 'chambre/cheminee/off'],
-        ['type' => 'scene', 'scene' => 'chambre/fan/off'],
-    ],
-    'chambre/off/exceptcheminee' => [
-        ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
-        ['type' => 'state', 'key' => 'chambre', 'value' => 0],
-        ['type' => 'hue', 'group' => $chambre, 'scene' => array('on' => false)],
-        // ['type' => 'insteon', 'command' => '0?1332=I=0=0'],
-        ['type' => 'domoticz', 'scene' => 19, 'command' => false, 'priority' => true],
-    ],
-    'chambre/cheminee' => [
-        ['type' => 'domoticz', 'scene' => 43, 'command' => true, 'priority' => true],
-    ],
-    'chambre/cheminee/smallfire' => [
-        ['type' => 'domoticz', 'scene' => 44, 'command' => true, 'priority' => true],
-    ],
-    'chambre/cheminee/cold' => [
-        ['type' => 'domoticz', 'scene' => 43, 'command' => true, 'priority' => true],
-    ],
-    'chambre/cheminee/off' => [
-        ['type' => 'domoticz', 'scene' => 43, 'command' => false, 'priority' => true],
-    ],
-    'chambre/toggle' => [
-        ['type' => 'function', 'function' => 'chambreToggle'],
-    ],
-    'chambre/planetarium/off' => [
-        ['type' => 'function', 'function' => 'planetarium', 'args' => [false]],
-    ],
-    'chambre/planetarium/on' => [
-        ['type' => 'function', 'function' => 'planetarium', 'args' => [true]],
-    ],
-    'chambre/vincent/lecture' => [
-        ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 35, 'colorTemp' => 346, 'transitionTime' => 10)],
-    ],
-    'chambre/vincent/litdiscret' => [
-        ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 20, 'hue' => 0, 'saturation' => 255, 'transitionTime' => 1)],
-    ],
-    'chambre/vincent/crepuscule' => [
-        // ['type' => 'insteon', 'command' => '3?0262261ED00F1300=I=3'],
-        ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 60, 'hue' => '0', 'saturation' => 255, 'transitionTime' => 10)],
-        ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => false, 'brightness' => 0, 'transitionTime' => 10 * 60)],
-        //['type' => 'insteon', 'command' => '3?0262261ED00F11FF=I=3'],
-    ],
-    'chambre/vincent/aube' => [
-        ['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/open' => [
-        ['type' => 'function', 'function' => 'chambreRideaux'],
-    ],
-    'chambre/rideaux/close' => [
-        ['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' => 'phonetask', 'phone' => 'vincent', 'task' => 'Tortuga Alerte'],
-        ['type' => 'phonetask', 'phone' => 'sdb', 'task' => 'Tortuga Alerte'],
-    ],
-    'home/aulit' => [
-        ['type' => 'scene', 'scene' => 'chambre/bed'],
-        ['type' => 'scene', 'scene' => 'home/aulitbase'],
-    ],
-    'home/aulitoff' => [
-        ['type' => 'scene', 'scene' => 'home/aulitbase'],
-        ['type' => 'scene', 'scene' => 'chambre/bed/off'],
-        ['type' => 'scene', 'scene' => 'sdb/off'],
-    ],
-    'home/aulitbase' => [
-        ['type' => 'scene', 'scene' => 'bureau/off'],
-        ['type' => 'scene', 'scene' => 'salon/off'],
-        ['type' => 'scene', 'scene' => 'cuisine/off'],
-        ['type' => 'scene', 'scene' => 'cour/off'],
-        ['type' => 'scene', 'scene' => 'salon/media/off'],
-        ['type' => 'function', 'function' => 'stopHarmony'],
-        ['type' => 'function', 'function' => 'stopAllSqueezebox'],
-        ['type' => 'nightmode', 'mode' => '1'],
-        ['type' => 'ecomode', 'mode' => '1'],
-        ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
-    ],
-    'home/music/synchro/soiree' => [
-        ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine', 'Bureau', 'WC']]],
-    ],
-    'home/music/synchro/salon-cuisine' => [
-        ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine']]],
-    ],
-    'home/music/synchro/all' => [
-        ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine', 'Bureau', 'WC', 'Chambre', 'SDB']]],
-    ],
-    'home/music/synchro/chambre-sdb' => [
-        ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Chambre', 'SDB']]],
-    ],
-    'home/music/synchro/bureau-wc' => [
-        ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Bureau', 'WC']]],
-    ],
-    'home/music/synchro/off' => [
-        ['type' => 'function', 'function' => 'stopAllSqueezebox'],
-    ],
-    'salon/projector/on' => [
-        ['type' => 'function', 'function' => 'epson', 'args' => [true, true]],
-    ],
-    'salon/projector/off' => [
-        ['type' => 'function', 'function' => 'epson', 'args' => [false, true]],
-    ],
-    'salon/auto' => [
-        ['type' => 'function', 'function' => 'salonAuto', 'args' => [true]],
-    ],
-    'salon/bar/on' => [
-        ['type' => 'domoticz', 'device' => 6887, 'command' => true, 'priority' => true],
-    ],
-    'salon/bar/off' => [
-        ['type' => 'domoticz', 'device' => 6887, 'command' => false, 'priority' => true],
-    ],
-    'salon/bar/toggle' => [
-        ['type' => 'domoticz', 'device' => 6887, 'command' => 'Toggle', 'priority' => true],
-    ],
-    'salon/day' => [
-        ['type' => 'domoticz', 'scene' => 45, 'command' => true, 'priority' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => '9ay5VtNcjvUZIFF', 'repeat' => 2],
-        ['type' => 'state', 'key' => 'salon', 'value' => 'on'],
-        ['type' => 'scene', 'scene' => 'cuisine/on', 'delay' => 1],
-        ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
-    ],
-    'salon/lumineux' => [
-        ['type' => 'domoticz', 'scene' => 51, 'command' => true, 'priority' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => '9ay5VtNcjvUZIFF', 'repeat' => 2],
-        ['type' => 'state', 'key' => 'salon', 'value' => 'on'],
-        ['type' => 'scene', 'scene' => 'cuisine/on', 'delay' => 1],
-        ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
-    ],
-    'salon/off' => [
-        ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
-        ['type' => 'domoticz', 'scene' => 45, 'command' => false, 'priority' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
-        ['type' => 'state', 'key' => 'salon', 'value' => 'off'],
-        //['type' => 'insteon', 'command' => '0?133=I=0=0'],
-        ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']],
-        ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
-        ['type' => 'scene', 'scene' => 'salon/fan/off'],
-        ['type' => 'scene', 'scene' => 'salon/bar/off'],
-    ],
-    'salon/cinemabase' => [
-
-        // ['type' => 'scene', 'scene' => 'cuisine/tamise'],
-//        ['type' => 'ecomode', 'mode' => '0'],
-        // ['type' => 'insteon', 'command' => '0?1111=I=0=0'],
-    ],
-    'salon/cineclub' => [
-        ['type' => 'scene', 'scene' => 'salon/bar/off'],
-        ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
-        ['type' => 'domoticz', 'scene' => 46, 'command' => true, 'priority' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu', 'repeat' => 2],
-        ['type' => 'scene', 'scene' => 'salon/cinemabase'],
-        ['type' => 'domoticz', 'scene' => 46, 'command' => true, 'priority' => true],
-        ['type' => 'state', 'key' => 'salon', 'value' => 'cinema'],
-        ['type' => 'scene', 'scene' => 'cuisine/tamise', 'repeat' => 2],
-    ],
-    'salon/cinema' => [
-        ['type' => 'scene', 'scene' => 'salon/bar/off'],
-        ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
-        ['type' => 'domoticz', 'scene' => 47, 'command' => true, 'priority' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35', 'repeat' => 2],
-        ['type' => 'scene', 'scene' => 'salon/cinemabase'],
-        ['type' => 'state', 'key' => 'salon', 'value' => 'cinema'],
-        ['type' => 'domoticz', 'scene' => 47, 'command' => true, 'priority' => true],
-        ['type' => 'scene', 'scene' => 'cuisine/tamise', 'repeat' => 2],
-    ],
-    'salon/tamise' => [
-        ['type' => 'ecomode', 'mode' => '0'],
-        ['type' => 'domoticz', 'scene' => 48, 'command' => true, 'priority' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU', 'repeat' => 2],
-        ['type' => 'state', 'key' => 'salon', 'value' => 'tamise'],
-        // ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
-        ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
-        ['type' => 'scene', 'scene' => 'cuisine/on', 'repeat' => 2],
-    ],
-    'salon/theatre' => [
-        ['type' => 'ecomode', 'mode' => '0'],
-        ['type' => 'domoticz', 'scene' => 53, 'command' => true, 'priority' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'xWNIeznSzek8dKS', 'repeat' => 2],
-        ['type' => 'state', 'key' => 'salon', 'value' => 'theatre'],
-        // ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
-        ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
-        ['type' => 'scene', 'scene' => 'cuisine/on', 'repeat' => 2],
-    ],
-    'salon/lecturenocture' => [
-        ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
-        ['type' => 'domoticz', 'scene' => 49, 'command' => true, 'priority' => true],
-        ['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'],
-        ['type' => 'state', 'key' => 'salon', 'value' => 'tamise'],
-        // ['type' => 'insteon', 'command' => '0?1113=I=0=0'],
-        ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.25]],
-        ['type' => 'scene', 'scene' => 'cuisine/on', 'repeat' => 2],
-        ['type' => 'scene', 'scene' => 'salon/bar/off'],
-    ],
-    'salon/cheminee' => [
-        ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 1]],
-    ],
-    'salon/cheminee/off' => [
-        ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']],
-    ],
-    'salon/media/off' => [
-        ['type' => 'function', 'function' => 'off', 'args' => ['salon']],
-    ],
-    'salon/media/play' => [
-
-    ],
-    'salon/fan/on' => [
-        ['type' => 'domoticz', 'device' => '478', 'command' => true],
-    ],
-    'salon/fan/off' => [
-        ['type' => 'domoticz', 'device' => '478', 'command' => false],
-    ],
-    'salon/fan/toggle' => [
-        ['type' => 'domoticz', 'device' => '478', 'command' => 'Toggle', 'priority' => true],
-    ],
-    'bureau/pc/wakeup' => [
-        ['type' => 'function', 'function' => 'wakeupPC', 'args' => ['avion']],
-    ],
-    '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']]
-    ],
-    'bureau/screens/on' => [
-        ['type' => 'function', 'function' => 'pcScreensProfile', 'args' => ['Tortuga', 'avion']]
-    ],
-    'bureau/fan/on' => [
-        ['type' => 'domoticz', 'device' => '3529', 'command' => true, 'priority' => true],
-    ],
-    'bureau/fan/off' => [
-        ['type' => 'domoticz', 'device' => '3529', 'command' => true, 'priority' => true],
-    ],
-    'bureau/fan/toggle' => [
-        ['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' => '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'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lumineux'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 26, 'command' => true, 'priority' => true],
-    ],
-    'bureau/veilleuse' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'ooQq4Jfbf1CleDy'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'veilleuse'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 27, 'command' => true, 'priority' => true],
-    ],
-    'bureau/flowers' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'mJ-AVlYFyL5x1cN'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'flowers'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 28, 'command' => true, 'priority' => true],
-    ],
-    'bureau/videogames' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'ooQq4Jfbf1CleDy'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'veilleuse'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/off'],
-        ['type' => 'domoticz', 'scene' => 29, 'command' => true, 'priority' => true],
-    ],
-    'bureau/tchernobyl' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'KoByn2ehWHDdchu'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tchernobyl'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 30, 'command' => true, 'priority' => true],
-    ],
-    'bureau/outrun' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => '9TzWQt6f7-EgVtm'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'outrun'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 31, 'command' => true, 'priority' => true],
-    ],
-    'bureau/boreal' => [
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'boreal'],
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'dJaWFQBb0APEgtL'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 32, 'command' => true, 'priority' => true],
-    ],
-    'bureau/tropical' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'biXLpKpIZYDlxen'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tropical'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 33, 'command' => true, 'priority' => true],
-
-    ],
-    'bureau/lounge' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'vvE8WAMdNpgswrw'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lounge'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 34, 'command' => true, 'priority' => true],
-
-    ],
-    'bureau/focus' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'yPYgG-zQWuAA13d'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'space'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 35, 'command' => true, 'priority' => true],
-
-    ],
-    'bureau/tonic' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'S-YiVWKsEKipL0G'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tonic'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 36, 'command' => true, 'priority' => true],
-
-    ],
-    'bureau/lecture' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'Hjr7rfz4LC9xVoB'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lecture'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 37, 'command' => true, 'priority' => true],
-
-    ],
-    'bureau/chillout' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => '-UOMTUG6z-hMbRA'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'chillout'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 38, 'command' => true, 'priority' => true],
-
-    ],
-    'bureau/tamise' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => '8fgGg2ylE4aO3t3'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tamise'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 39, 'command' => true, 'priority' => true],
-    ],
-    'bureau/beach' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => '0mPAKOl-Kw8Fwb1'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'beach'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 40, 'command' => true, 'priority' => true],
-
-    ],
-    'bureau/jellyfish' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'VhHVIcN-nKLwP9E'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'jellyfish'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 41, 'command' => true, 'priority' => true],
-
-    ],
-    'bureau/sharks' => [
-        ['type' => 'hue', 'group' => $bureau, 'scene' => 'VhHVIcN-nKLwP9E'],
-        ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'sharks'],
-        ['type' => 'scene', 'scene' => 'bureau/base/on'],
-        ['type' => 'scene', 'scene' => 'bureau/screens/on'],
-        ['type' => 'domoticz', 'scene' => 41, 'command' => true, 'priority' => true],
-
-    ],
-    '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' => 'hue', 'group' => $bureau, 'scene' => array('on' => false)],
-        ['type' => 'hue', 'light' => 23, 'scene' => array('on' => false)],
-    ],
-    'bureau/off' => [
-        ['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],
-    ],
-    'bureau/sound/off' => [
-        ['type' => 'domoticz', 'device' => 24, 'switchtype' => 'scene', 'command' => false],
-    ],
-    'bureau/media/play' => [
-        ['type' => 'state', 'key' => 'bureauPlaying', 'value' => '1'],
-        ['type' => 'scene', 'scene' => 'bureau/screen/down'],
-        ['type' => 'scene', 'scene' => 'bureau/rideaux/close'],
-        ['type' => 'scene', 'scene' => 'bureau/cinema'],
-        ['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]],
-        //['type' => 'ir', 'room' => 'bureausun', 'device' => 'Projector', 'command' => 'PowerOn'],
-        ['type' => 'function', 'function' => 'harmonyActivity', 'args' => ['tv']],
-        ['type' => 'scene', 'scene' => 'bureau/sound/on'],
-
-    ],
-    'bureau/media/stop' => [
-        ['type' => 'state', 'key' => 'bureauPlaying', 'value' => '0'],
-        ['type' => 'scene', 'scene' => 'bureau/screen/up'],
-        ['type' => 'scene', 'scene' => 'bureau/rideaux/open'],
-        ['type' => 'scene', 'scene' => 'bureau/auto'],
-//        ['type' => 'ir', 'room' => 'bureausun', 'device' => 'Projector', 'command' => 'PowerOff'],
-        ['type' => 'scene', 'scene' => 'bureau/sound/off'],
-    ],
-    'bureau/screen/down' => [
-        ['type' => 'domoticz', 'device' => '1', 'command' => true, 'priority' => true],
-    ],
-    'bureau/screen/up' => [
-        ['type' => 'domoticz', 'device' => '1', 'command' => false, 'priority' => true],
-    ],
-    'bureau/rideaux/close' => [
-        ['type' => 'domoticz', 'device' => '391', 'command' => true, 'priority' => true],
-    ],
-    'bureau/rideaux/open' => [
-        ['type' => 'domoticz', 'device' => '391', 'command' => false, 'priority' => true],
-    ],
-    'bureau/rideaux/toggle' => [
-        ['type' => 'domoticz', 'device' => '391', 'command' => 'Toggle', 'priority' => true],
-    ],
-    'insteon/off' => [
-        // ['type' => 'insteon', 'command' => '0?135=I=0=0'],
-    ],
-    'home/off' => [
-        ['type' => 'scene', 'scene' => 'home/hueoff'],
-        ['type' => 'ecomode', 'mode' => '2'],
-        ['type' => 'scene', 'scene' => 'cuisine/off'],
-        ['type' => 'scene', 'scene' => 'salon/off'],
-        ['type' => 'scene', 'scene' => 'cour/off'],
-        ['type' => 'scene', 'scene' => 'bureau/base/off'],
-        ['type' => 'scene', 'scene' => 'chambre/off'],
-        ['type' => 'scene', 'scene' => 'sdb/off'],
-        ['type' => 'scene', 'scene' => 'wc/off'],
-        ['type' => 'function', 'function' => 'stopHarmony'],
-        ['type' => 'function', 'function' => 'stopAllSqueezebox'],
-        ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
-        ['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' => 'sdb/hotwater/auto'],
-    ],
-
-    'home/welcome/eco' => [
-        ['type' => 'function', 'function' => 'welcomeEco'],
-    ],
-
-    'home/welcome/eco/salon' => [
-        ['type' => 'scene', 'scene' => 'cuisine/on'],
-        ['type' => 'scene', 'scene' => 'salon/auto'],
-        ['type' => 'ecomode', 'mode' => '0'],
-        ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
-        ['type' => 'scene', 'scene' => 'bureau/off'],
-        ['type' => 'scene', 'scene' => 'chambre/off'],
-    ],
-
-    'home/welcome/eco/homeoffice' => [
-        ['type' => 'scene', 'scene' => 'cuisine/coffee/on'],
-        ['type' => 'scene', 'scene' => 'bureau/auto'],
-        ['type' => 'ecomode', 'mode' => '0'],
-        ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
-        ['type' => 'scene', 'scene' => 'salon/off'],
-        ['type' => 'scene', 'scene' => 'chambre/off'],
-    ],
-
-    'home/welcome' => [
-        ['type' => 'scene', 'scene' => 'home/welcome/eco'],
-        ['type' => 'scene', 'scene' => 'bureau/auto'],
-        ['type' => 'scene', 'scene' => 'chambre/auto'],
-        ['type' => 'scene', 'scene' => 'sdb/on'],
-        ['type' => 'scene', 'scene' => 'cour/auto'],
-        ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
-        ['type' => 'ecomode', 'mode' => '0'],
-    ],
-    'home/hueoff' => [
-        ['type' => 'hue', 'group' => 17, 'scene' => ['on' => false, 'effect' => 'none']],
-    ],
-    'wc/on' => [
-        ['type' => 'function', 'function' => 'wcOn'],
-    ],
-    'wc/morning' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => 'NC5ejamHGUNURj8'],
-        ['type' => 'function', 'function' => 'wcMusic', 'args' => [70]],
-    ],
-    'wc/day' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => 'qfuu8z5QaJ6J26W'],
-        ['type' => 'function', 'function' => 'wcMusic', 'args' => [80]],
-    ],
-    'wc/evening' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => 'h82j28eNu6ZHVhM'],
-        ['type' => 'function', 'function' => 'wcMusic', 'args' => [80]],
-    ],
-    'wc/late' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => 'IGo4F5jRQXc1H95'],
-        ['type' => 'function', 'function' => 'wcMusic', 'args' => [70]],
-    ],
-    'wc/night' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => 'eJy09JTEzCiIL1P'],
-    ],
-    'wc/nightambiance' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => ['effect' => 'none']],
-        ['type' => 'scene', 'scene' => 'wc/night'],
-        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Nuit d\'été', $squeezeboxPlayers['WC'], 100, false]],
-    ],
-    'wc/off' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => ['on' => false, 'effect' => 'none']],
-        ['type' => 'function', 'function' => 'stopSqueezeboxPlayer', 'args' => [$squeezeboxPlayers['WC'], false]],
-        ['type' => 'state', 'key' => 'wc', 'value' => 0],
-        ['type' => 'function', 'function' => 'wcVMCOff'],
-    ],
-    'wc/spa' => [
-        ['type' => 'hue', 'group' => $wc, 'scene' => ['effect' => 'colorloop', 'on' => true, 'brightness' => 128]],
-        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['WC'], 100]],
-        ['type' => 'function', 'function' => 'wcVMCOff'],
-    ],
-    'wc/vmc/on' => [
-        ['type' => 'function', 'function' => 'wcVMCOn'],
-    ],
-    'wc/vmc/off' => [
-        ['type' => 'domoticz', 'device' => '6449', 'command' => false, 'priority' => true],
-    ],
-    'sdb/ampli/on' => [
-        ['type' => 'domoticz', 'device' => '476', 'command' => true, 'priority' => true],
-    ],
-    'sdb/ampli/off' => [
-        ['type' => 'domoticz', 'device' => '476', 'command' => false, 'priority' => true],
-    ],
-    'sdb/hotwater/auto' => [
-        ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['1']],
-    ],
-    'sdb/hotwater/auto/force' => [
-        ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['1', true]],
-    ],
-    'sdb/hotwater/eco' => [
-        ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['0']],
-        ['type' => 'function', 'function' => 'hotwater', 'args' => ['1']],
-    ],
-    'sdb/hotwater/max' => [
-        ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['0']],
-        ['type' => 'function', 'function' => 'hotwater', 'args' => ['2']],
-    ],
-    'sdb/hotwater/off' => [
-        ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['0']],
-        ['type' => 'function', 'function' => 'hotwater', 'args' => ['0']],
-    ],
-    'sdb/off' => [
-        ['type' => 'state', 'key' => 'sdb', 'value' => 0],
-        ['type' => 'domoticz', 'scene' => 20, 'command' => false, 'priority' => true],
-        ['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],
-    ],
-    'sdb/morning' => [
-        ['type' => 'state', 'key' => 'sdb', 'value' => 1],
-        ['type' => 'scene', 'scene' => 'sdb/on'],
-        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['France Info', $squeezeboxPlayers['Salle de bains'], 30]],
-    ],
-    'sdb/nuit' => [
-        ['type' => 'state', 'key' => 'sdb', 'value' => 1],
-        ['type' => 'domoticz', 'scene' => 21, 'command' => true, 'priority' => true],
-    ],
-    'sdb/spa' => [
-        ['type' => 'state', 'key' => 'sdb', 'value' => 1],
-        ['type' => 'domoticz', 'scene' => 22, 'command' => true, 'priority' => true],
-        ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Nature sounds', $squeezeboxPlayers['Salle de bains'], 65]],
-    ],
-    'salon/freebox/on' => [
-        ['type' => 'domoticz', 'device' => '1439', 'command' => true, 'priority' => true],
-    ],
-    'salon/freebox/off' => [
-        ['type' => 'domoticz', 'device' => '1439', 'command' => false],
-    ],
-    'cuisine/hotte/on' => [
-        ['type' => 'domoticz', 'scene' => 52, 'command' => true],
-    ],
-    'cuisine/hotte/off' => [
-        ['type' => 'domoticz', 'scene' => 52, 'command' => false],
-    ],
-    'cuisine/base/on' => [
-        ['type' => 'hue', 'group' => $cuisine, 'scene' => 'UDlNCnVQjTHZJFF'],
-    ],
-    'cuisine/on' => [
-        ['type' => 'scene', 'scene' => 'cuisine/hotte/on'],
-        ['type' => 'scene', 'scene' => 'cuisine/base/on'],
-    ],
-    'cuisine/tamise' => [
-        ['type' => 'scene', 'scene' => 'cuisine/hotte/on'],
-        ['type' => 'hue', 'group' => $cuisine, 'scene' => '44yXoQdJErFPksE']
-    ],
-    'cuisine/off' => [
-        ['type' => 'scene', 'scene' => 'cuisine/hotte/off'],
-        //['type' => 'hue', 'group' => $cuisine, 'scene' => array('on' => false)]
-    ],
-    'cuisine/toaster/toggle' => [
-        ['type' => 'domoticz', 'device' => '1453', 'command' => 'Toggle', 'priority' => true],
-    ],
-    'cuisine/toaster/on' => [
-        ['type' => 'domoticz', 'device' => '1453', 'command' => true, 'priority' => true],
-    ],
-    'cuisine/toaster/off' => [
-        ['type' => 'domoticz', 'device' => '1453', 'command' => false, 'priority' => true],
-    ],
-    'cuisine/coffee/on' => [
-        ['type' => 'function', 'function' => 'coffee_on'],
-    ],
-    'cuisine/coffee/off' => [
-        ['type' => 'function', 'function' => 'coffee_off'],
-    ],
-    'cour/auto' => [
-        ['type' => 'domoticz', 'device' => '6899', 'command' => true],
-        ['type' => 'function', 'function' => 'courAuto', 'args' => [true]],
-    ],
-    'cour/daylight' => [
-        ['type' => 'domoticz', 'device' => '6899', 'command' => true],
-        ['type' => 'hue', 'group' => $cour, 'scene' => '8RyJJ3Dn7ayPQ8t'],
-    ],
-    'cour/lumineux' => [
-        ['type' => 'domoticz', 'device' => '6899', 'command' => true],
-        ['type' => 'hue', 'group' => $cour, 'scene' => 'XzV1CuYIdHXPKoJ'],
-    ],
-    'cour/tropical' => [
-        ['type' => 'domoticz', 'device' => '6899', 'command' => true],
-        ['type' => 'hue', 'group' => $cour, 'scene' => 'wBdbymg1w5ZZvtS'],
-    ],
-    'cour/grow' => [
-        ['type' => 'domoticz', 'device' => '6899', 'command' => true],
-        ['type' => 'hue', 'group' => $cour, 'scene' => 'WVanIpWUWjkBjsS'],
-    ],
-    'cour/off' => [
-        ['type' => 'hue', 'group' => $cour, 'scene' => ['on' => false]],
-        ['type' => 'function', 'function' => 'courAuto', 'args' => [false]],
-        ['type' => 'domoticz', 'device' => '6899', 'command' => false],
-    ],
-    'cour/projecteurs/on' => [
-        ['type' => 'domoticz', 'device' => '6898', 'command' => true],
-    ],
-    'cour/projecteurs/off' => [
-        ['type' => 'domoticz', 'device' => '6898', 'command' => false],
-    ],
-    'ecomode/basic' => [
-        ['type' => 'domoticz', 'device' => '1', 'switchtype' => 'scene', 'command' => false],
-    ],
-    'ecomode/super' => [
-        ['type' => 'scene', 'scene' => 'ecomode/basic'],
-        ['type' => 'domoticz', 'device' => '2', 'switchtype' => 'scene', 'command' => false],
-    ],
-    'ecomode/notsuper' => [
-        ['type' => 'domoticz', 'device' => '2', 'switchtype' => 'scene', 'command' => true],
-    ],
-    'ecomode/on' => [
-        ['type' => 'scene', 'scene' => 'ecomode/basic'],
-        ['type' => 'scene', 'scene' => 'ecomode/notsuper'],
-    ],
-    'ecomode/off' => [
-        ['type' => 'scene', 'scene' => 'ecomode/notsuper'],
-        ['type' => 'domoticz', 'device' => '1', 'switchtype' => 'scene', 'command' => true, 'priority' => false],
-    ],
+       'chambre/matin' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'ecomode', 'mode' => '0'],
+               ['type' => 'scene', 'scene' => 'chambre/nightlights'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'dawn', 'delay' => 1],
+               ['type' => 'scene', 'scene' => 'chambre/rideaux/open', 'delay' => 31],
+               ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
+               ['type' => 'scene', 'scene' => 'chambre/planetarium/off'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'phonetask', 'phone' => 'vincent', 'task' => 'Matin'],
+               ['type' => 'scene', 'scene' => 'chambre/auto', 'delay' => 35],
+               ['type' => 'scene', 'scene' => 'cuisine/coffee/on'],
+       ],
+       'chambre/deshumidificateur/on' => [
+               //['type' => 'domoticz', 'device' => $chambrefan, 'command' => true],
+       ],
+       'chambre/deshumidificateur/off' => [
+               //['type' => 'domoticz', 'device' => $chambrefan, 'command' => false],
+       ],
+       'chambre/fan/on' => [
+               ['type' => 'domoticz', 'device' => $chambrefan, 'command' => true],
+       ],
+       'chambre/fan/off' => [
+               ['type' => 'domoticz', 'device' => $chambrefan, 'command' => false],
+       ],
+       'chambre/fan/toggle' => [
+               ['type' => 'domoticz', 'device' => $chambrefan, 'command' => 'Toggle'],
+       ],
+       'chambre/auto' => [
+               ['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' => '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' => 'phonetask', 'phone' => 'vincent', 'task' => 'Va Au Lit'],
+       ],
+       'chambre/bed' => [
+               ['type' => 'scene', 'scene' => 'chambre/bed/base'],
+               ['type' => 'scene', 'scene' => 'chambre/nightlights'],
+               ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on
+               ['type' => 'scene', 'scene' => 'sdb/nuit'],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee/smallfire'],
+       ],
+       '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'],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee/off', 'delay' => 2],
+       ],
+       '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' => 'insteon', 'command' => '0?1332=I=0=0'], // Lustre et tableau off
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
+               ['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' => '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' => 'hue', 'group' => $chambre, 'scene' => 'mwAGvt2n70oXCqA'],
+               ['type' => 'domoticz', 'scene' => 4, 'command' => true, 'priority' => true],
+               //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
+       ],
+       'chambre/savane' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'ABqCuE-ob-sw2vQ'],
+               ['type' => 'domoticz', 'scene' => 5, 'command' => true, 'priority' => true],
+               //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/focus' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'Ne6uJnnoPO9yRhl'],
+               ['type' => 'domoticz', 'scene' => 6, 'command' => true, 'priority' => true],
+               //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
+       ],
+       'chambre/chillout' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => '03gdSwPyZ9sbZVg'],
+               ['type' => 'domoticz', 'scene' => 7, 'command' => true, 'priority' => true],
+               //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/reading/fireplace' => [
+               ['type' => 'scene', 'scene' => 'chambre/chillout'],
+               ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Cheminée', $squeezeboxPlayers['Chambre']]],
+       ],
+       'chambre/reading' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'BNiNQjxiWNbKRaH'],
+               ['type' => 'domoticz', 'scene' => 8, 'command' => true, 'priority' => true],
+               // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/tonic' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'Tlcft9sPK492cJA'],
+               ['type' => 'domoticz', 'scene' => 9, 'command' => true, 'priority' => true],
+               // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
+       ],
+
+       'chambre/moon' => [
+               ['type' => 'hue', 'group' => $chambre, 'scene' => '5PKfoOn8ss17o2l'], // Clair de lune
+               ['type' => 'domoticz', 'scene' => 11, 'command' => true, 'priority' => true],
+               ['type' => 'scene', 'scene' => 'chambre/sleepbase'],
+       ],
+       'chambre/party' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'qvQXHDodBPa0cZf'],
+               ['type' => 'domoticz', 'scene' => 12, 'command' => true, 'priority' => true],
+               //['type' => 'insteon', 'command' => '0?1119=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/flowers' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'VtGPKtpQ7DF-RCd'],
+               ['type' => 'domoticz', 'scene' => 13, 'command' => true, 'priority' => true],
+               //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/tropical' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'Mqq8VMsmPQtzEQ0'],
+               ['type' => 'domoticz', 'scene' => 14, 'command' => true, 'priority' => true],
+               // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/beach' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'HfMaPG92lEOUDB0'],
+               ['type' => 'domoticz', 'scene' => 15, 'command' => true, 'priority' => true],
+               //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/nightlights' => [
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'JNieZpDHu5fbMyf'],
+               ['type' => 'domoticz', 'scene' => 16, 'command' => true, 'priority' => true],
+       ],
+       'chambre/summernight' => [
+               ['type' => 'scene', 'scene' => 'chambre/nightlights'],
+               //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/lounge' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'XGuSVQ3RCd7JUBC'],
+               ['type' => 'domoticz', 'scene' => 17, 'command' => true, 'priority' => true],
+               // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/full' => [
+               ['type' => 'nightmode', 'mode' => '0'],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => 'ZkiQbNQDXJz9-OC'],
+               ['type' => 'domoticz', 'scene' => 18, 'command' => true, 'priority' => true],
+               // ['type' => 'insteon', 'command' => '0?1132=I=0=0'],
+               ['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee'],
+       ],
+       'chambre/off' => [
+               ['type' => 'scene', 'scene' => 'chambre/off/exceptcheminee'],
+               ['type' => 'scene', 'scene' => 'chambre/cheminee/off'],
+               ['type' => 'scene', 'scene' => 'chambre/fan/off'],
+       ],
+       'chambre/off/exceptcheminee' => [
+               ['type' => 'state', 'key' => 'chambre', 'value' => 0],
+               ['type' => 'state', 'key' => 'chambreOff', 'value' => 1],
+               ['type' => 'hue', 'group' => $chambre, 'scene' => array('on' => false)],
+               // ['type' => 'insteon', 'command' => '0?1332=I=0=0'],
+               ['type' => 'domoticz', 'scene' => 19, 'command' => false, 'priority' => true],
+               ['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
+       ],
+       'chambre/cheminee' => [
+               ['type' => 'domoticz', 'scene' => 43, 'command' => true, 'priority' => true],
+       ],
+       'chambre/cheminee/smallfire' => [
+               ['type' => 'domoticz', 'scene' => 44, 'command' => true, 'priority' => true],
+       ],
+       'chambre/cheminee/cold' => [
+               ['type' => 'domoticz', 'scene' => 43, 'command' => true, 'priority' => true],
+       ],
+       'chambre/cheminee/off' => [
+               ['type' => 'domoticz', 'scene' => 43, 'command' => false, 'priority' => true],
+       ],
+       'chambre/toggle' => [
+               ['type' => 'function', 'function' => 'chambreToggle'],
+       ],
+       'chambre/planetarium/off' => [
+               ['type' => 'function', 'function' => 'planetarium', 'args' => [false]],
+       ],
+       'chambre/planetarium/on' => [
+               ['type' => 'function', 'function' => 'planetarium', 'args' => [true]],
+       ],
+       'chambre/vincent/lecture' => [
+               ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 35, 'colorTemp' => 346, 'transitionTime' => 10)],
+       ],
+       'chambre/vincent/litdiscret' => [
+               ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 20, 'hue' => 0, 'saturation' => 255, 'transitionTime' => 1)],
+       ],
+       'chambre/vincent/crepuscule' => [
+               // ['type' => 'insteon', 'command' => '3?0262261ED00F1300=I=3'],
+               ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => true, 'brightness' => 60, 'hue' => '0', 'saturation' => 255, 'transitionTime' => 10)],
+               ['type' => 'hue', 'light' => $litvincent, 'scene' => array('on' => false, 'brightness' => 0, 'transitionTime' => 10 * 60)],
+               //['type' => 'insteon', 'command' => '3?0262261ED00F11FF=I=3'],
+       ],
+       'chambre/vincent/aube' => [
+               ['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/open' => [
+               ['type' => 'function', 'function' => 'chambreRideaux'],
+       ],
+       'chambre/rideaux/close' => [
+               ['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' => 'phonetask', 'phone' => 'vincent', 'task' => 'Tortuga Alerte'],
+               ['type' => 'phonetask', 'phone' => 'sdb', 'task' => 'Tortuga Alerte'],
+       ],
+       'home/aulit' => [
+               ['type' => 'scene', 'scene' => 'chambre/bed'],
+               ['type' => 'scene', 'scene' => 'home/aulitbase'],
+       ],
+       'home/aulitoff' => [
+               ['type' => 'scene', 'scene' => 'home/aulitbase'],
+               ['type' => 'scene', 'scene' => 'chambre/bed/off'],
+               ['type' => 'scene', 'scene' => 'sdb/off'],
+       ],
+       'home/aulitbase' => [
+               ['type' => 'scene', 'scene' => 'bureau/off'],
+               ['type' => 'scene', 'scene' => 'salon/off'],
+               ['type' => 'scene', 'scene' => 'cuisine/off'],
+               ['type' => 'scene', 'scene' => 'cour/off'],
+               ['type' => 'scene', 'scene' => 'salon/media/off'],
+               ['type' => 'function', 'function' => 'stopHarmony'],
+               ['type' => 'function', 'function' => 'stopAllSqueezebox'],
+               ['type' => 'nightmode', 'mode' => '1'],
+               ['type' => 'ecomode', 'mode' => '1'],
+               ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
+       ],
+       'home/music/synchro/soiree' => [
+               ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine', 'Bureau', 'WC']]],
+       ],
+       'home/music/synchro/salon-cuisine' => [
+               ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine']]],
+       ],
+       'home/music/synchro/all' => [
+               ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine', 'Bureau', 'WC', 'Chambre', 'SDB']]],
+       ],
+       'home/music/synchro/chambre-sdb' => [
+               ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Chambre', 'SDB']]],
+       ],
+       'home/music/synchro/bureau-wc' => [
+               ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Bureau', 'WC']]],
+       ],
+       'home/music/synchro/off' => [
+               ['type' => 'function', 'function' => 'stopAllSqueezebox'],
+       ],
+       'salon/projector/on' => [
+               ['type' => 'function', 'function' => 'epson', 'args' => [true, true]],
+       ],
+       'salon/projector/off' => [
+               ['type' => 'function', 'function' => 'epson', 'args' => [false, true]],
+       ],
+       'salon/auto' => [
+               ['type' => 'function', 'function' => 'salonAuto', 'args' => [true]],
+       ],
+       'salon/bar/on' => [
+               ['type' => 'domoticz', 'device' => 6887, 'command' => true, 'priority' => true],
+       ],
+       'salon/bar/off' => [
+               ['type' => 'domoticz', 'device' => 6887, 'command' => false, 'priority' => true],
+       ],
+       'salon/bar/toggle' => [
+               ['type' => 'domoticz', 'device' => 6887, 'command' => 'Toggle', 'priority' => true],
+       ],
+       'salon/day' => [
+               ['type' => 'domoticz', 'scene' => 45, 'command' => true, 'priority' => true],
+               ['type' => 'hue', 'group' => $salon, 'scene' => '9ay5VtNcjvUZIFF', 'repeat' => 2],
+               ['type' => 'state', 'key' => 'salon', 'value' => 'on'],
+               ['type' => 'scene', 'scene' => 'cuisine/on', 'delay' => 1],
+               ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
+       ],
+       'salon/lumineux' => [
+               ['type' => 'domoticz', 'scene' => 51, 'command' => true, 'priority' => true],
+               ['type' => 'hue', 'group' => $salon, 'scene' => '9ay5VtNcjvUZIFF', 'repeat' => 2],
+               ['type' => 'state', 'key' => 'salon', 'value' => 'on'],
+               ['type' => 'scene', 'scene' => 'cuisine/on', 'delay' => 1],
+               ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
+       ],
+       'salon/off' => [
+               ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
+               ['type' => 'domoticz', 'scene' => 45, 'command' => false, 'priority' => true],
+               ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
+               ['type' => 'state', 'key' => 'salon', 'value' => 'off'],
+               //['type' => 'insteon', 'command' => '0?133=I=0=0'],
+               ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']],
+               ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
+               ['type' => 'scene', 'scene' => 'salon/fan/off'],
+               ['type' => 'scene', 'scene' => 'salon/bar/off'],
+       ],
+       'salon/cinemabase' => [
+
+               // ['type' => 'scene', 'scene' => 'cuisine/tamise'],
+               //        ['type' => 'ecomode', 'mode' => '0'],
+               // ['type' => 'insteon', 'command' => '0?1111=I=0=0'],
+       ],
+       'salon/cineclub' => [
+               ['type' => 'scene', 'scene' => 'salon/bar/off'],
+               ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
+               ['type' => 'domoticz', 'scene' => 46, 'command' => true, 'priority' => true],
+               ['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu', 'repeat' => 2],
+               ['type' => 'scene', 'scene' => 'salon/cinemabase'],
+               ['type' => 'domoticz', 'scene' => 46, 'command' => true, 'priority' => true],
+               ['type' => 'state', 'key' => 'salon', 'value' => 'cinema'],
+               ['type' => 'scene', 'scene' => 'cuisine/tamise', 'repeat' => 2],
+       ],
+       'salon/cinema' => [
+               ['type' => 'scene', 'scene' => 'salon/bar/off'],
+               ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
+               ['type' => 'domoticz', 'scene' => 47, 'command' => true, 'priority' => true],
+               ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35', 'repeat' => 2],
+               ['type' => 'scene', 'scene' => 'salon/cinemabase'],
+               ['type' => 'state', 'key' => 'salon', 'value' => 'cinema'],
+               ['type' => 'domoticz', 'scene' => 47, 'command' => true, 'priority' => true],
+               ['type' => 'scene', 'scene' => 'cuisine/tamise', 'repeat' => 2],
+       ],
+       'salon/tamise' => [
+               ['type' => 'ecomode', 'mode' => '0'],
+               ['type' => 'domoticz', 'scene' => 48, 'command' => true, 'priority' => true],
+               ['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU', 'repeat' => 2],
+               ['type' => 'state', 'key' => 'salon', 'value' => 'tamise'],
+               // ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
+               ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
+               ['type' => 'scene', 'scene' => 'cuisine/on', 'repeat' => 2],
+       ],
+       'salon/theatre' => [
+               ['type' => 'ecomode', 'mode' => '0'],
+               ['type' => 'domoticz', 'scene' => 53, 'command' => true, 'priority' => true],
+               ['type' => 'hue', 'group' => $salon, 'scene' => 'xWNIeznSzek8dKS', 'repeat' => 2],
+               ['type' => 'state', 'key' => 'salon', 'value' => 'theatre'],
+               // ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
+               ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
+               ['type' => 'scene', 'scene' => 'cuisine/on', 'repeat' => 2],
+       ],
+       'salon/lecturenocture' => [
+               ['type' => 'function', 'function' => 'salonAuto', 'args' => [false]],
+               ['type' => 'domoticz', 'scene' => 49, 'command' => true, 'priority' => true],
+               ['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'],
+               ['type' => 'state', 'key' => 'salon', 'value' => 'tamise'],
+               // ['type' => 'insteon', 'command' => '0?1113=I=0=0'],
+               ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.25]],
+               ['type' => 'scene', 'scene' => 'cuisine/on', 'repeat' => 2],
+               ['type' => 'scene', 'scene' => 'salon/bar/off'],
+       ],
+       'salon/cheminee' => [
+               ['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 1]],
+       ],
+       'salon/cheminee/off' => [
+               ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']],
+       ],
+       'salon/media/off' => [
+               ['type' => 'function', 'function' => 'off', 'args' => ['salon']],
+       ],
+       'salon/media/play' => [
+
+       ],
+       'salon/fan/on' => [
+               ['type' => 'domoticz', 'device' => '478', 'command' => true],
+       ],
+       'salon/fan/off' => [
+               ['type' => 'domoticz', 'device' => '478', 'command' => false],
+       ],
+       'salon/fan/toggle' => [
+               ['type' => 'domoticz', 'device' => '478', 'command' => 'Toggle', 'priority' => true],
+       ],
+       'bureau/pc/wakeup' => [
+               ['type' => 'function', 'function' => 'wakeupPC', 'args' => ['avion']],
+       ],
+       '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']]
+       ],
+       'bureau/screens/on' => [
+               ['type' => 'function', 'function' => 'pcScreensProfile', 'args' => ['Tortuga', 'avion']]
+       ],
+       'bureau/fan/on' => [
+               ['type' => 'domoticz', 'device' => '3529', 'command' => true, 'priority' => true],
+       ],
+       'bureau/fan/off' => [
+               ['type' => 'domoticz', 'device' => '3529', 'command' => true, 'priority' => true],
+       ],
+       'bureau/fan/toggle' => [
+               ['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' => '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'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lumineux'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 26, 'command' => true, 'priority' => true],
+       ],
+       'bureau/veilleuse' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'ooQq4Jfbf1CleDy'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'veilleuse'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 27, 'command' => true, 'priority' => true],
+       ],
+       'bureau/flowers' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'mJ-AVlYFyL5x1cN'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'flowers'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 28, 'command' => true, 'priority' => true],
+       ],
+       'bureau/videogames' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'ooQq4Jfbf1CleDy'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'veilleuse'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/off'],
+               ['type' => 'domoticz', 'scene' => 29, 'command' => true, 'priority' => true],
+       ],
+       'bureau/tchernobyl' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'KoByn2ehWHDdchu'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tchernobyl'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 30, 'command' => true, 'priority' => true],
+       ],
+       'bureau/outrun' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => '9TzWQt6f7-EgVtm'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'outrun'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 31, 'command' => true, 'priority' => true],
+       ],
+       'bureau/boreal' => [
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'boreal'],
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'dJaWFQBb0APEgtL'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 32, 'command' => true, 'priority' => true],
+       ],
+       'bureau/tropical' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'biXLpKpIZYDlxen'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tropical'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 33, 'command' => true, 'priority' => true],
+
+       ],
+       'bureau/lounge' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'vvE8WAMdNpgswrw'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lounge'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 34, 'command' => true, 'priority' => true],
+
+       ],
+       'bureau/focus' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'yPYgG-zQWuAA13d'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'space'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 35, 'command' => true, 'priority' => true],
+
+       ],
+       'bureau/tonic' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'S-YiVWKsEKipL0G'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tonic'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 36, 'command' => true, 'priority' => true],
+
+       ],
+       'bureau/lecture' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'Hjr7rfz4LC9xVoB'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lecture'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 37, 'command' => true, 'priority' => true],
+
+       ],
+       'bureau/chillout' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => '-UOMTUG6z-hMbRA'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'chillout'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 38, 'command' => true, 'priority' => true],
+
+       ],
+       'bureau/tamise' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => '8fgGg2ylE4aO3t3'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tamise'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 39, 'command' => true, 'priority' => true],
+       ],
+       'bureau/beach' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => '0mPAKOl-Kw8Fwb1'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'beach'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 40, 'command' => true, 'priority' => true],
+
+       ],
+       'bureau/jellyfish' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'VhHVIcN-nKLwP9E'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'jellyfish'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 41, 'command' => true, 'priority' => true],
+
+       ],
+       'bureau/sharks' => [
+               ['type' => 'hue', 'group' => $bureau, 'scene' => 'VhHVIcN-nKLwP9E'],
+               ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'sharks'],
+               ['type' => 'scene', 'scene' => 'bureau/base/on'],
+               ['type' => 'scene', 'scene' => 'bureau/screens/on'],
+               ['type' => 'domoticz', 'scene' => 41, 'command' => true, 'priority' => true],
+
+       ],
+       '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' => 'hue', 'group' => $bureau, 'scene' => array('on' => false)],
+               ['type' => 'hue', 'light' => 23, 'scene' => array('on' => false)],
+       ],
+       'bureau/off' => [
+               ['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],
+       ],
+       'bureau/sound/off' => [
+               ['type' => 'domoticz', 'device' => 24, 'switchtype' => 'scene', 'command' => false],
+       ],
+       'bureau/media/play' => [
+               ['type' => 'state', 'key' => 'bureauPlaying', 'value' => '1'],
+               ['type' => 'scene', 'scene' => 'bureau/screen/down'],
+               ['type' => 'scene', 'scene' => 'bureau/rideaux/close'],
+               ['type' => 'scene', 'scene' => 'bureau/cinema'],
+               ['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]],
+               //['type' => 'ir', 'room' => 'bureausun', 'device' => 'Projector', 'command' => 'PowerOn'],
+               ['type' => 'function', 'function' => 'harmonyActivity', 'args' => ['tv']],
+               ['type' => 'scene', 'scene' => 'bureau/sound/on'],
+
+       ],
+       'bureau/media/stop' => [
+               ['type' => 'state', 'key' => 'bureauPlaying', 'value' => '0'],
+               ['type' => 'scene', 'scene' => 'bureau/screen/up'],
+               ['type' => 'scene', 'scene' => 'bureau/rideaux/open'],
+               ['type' => 'scene', 'scene' => 'bureau/auto'],
+               //        ['type' => 'ir', 'room' => 'bureausun', 'device' => 'Projector', 'command' => 'PowerOff'],
+               ['type' => 'scene', 'scene' => 'bureau/sound/off'],
+       ],
+       'bureau/screen/down' => [
+               ['type' => 'domoticz', 'device' => '1', 'command' => true, 'priority' => true],
+       ],
+       'bureau/screen/up' => [
+               ['type' => 'domoticz', 'device' => '1', 'command' => false, 'priority' => true],
+       ],
+       'bureau/rideaux/close' => [
+               ['type' => 'domoticz', 'device' => '391', 'command' => true, 'priority' => true],
+       ],
+       'bureau/rideaux/open' => [
+               ['type' => 'domoticz', 'device' => '391', 'command' => false, 'priority' => true],
+       ],
+       'bureau/rideaux/toggle' => [
+               ['type' => 'domoticz', 'device' => '391', 'command' => 'Toggle', 'priority' => true],
+       ],
+       'insteon/off' => [
+               // ['type' => 'insteon', 'command' => '0?135=I=0=0'],
+       ],
+       'home/off' => [
+               ['type' => 'scene', 'scene' => 'home/hueoff'],
+               ['type' => 'ecomode', 'mode' => '2'],
+               ['type' => 'scene', 'scene' => 'cuisine/off'],
+               ['type' => 'scene', 'scene' => 'salon/off'],
+               ['type' => 'scene', 'scene' => 'cour/off'],
+               ['type' => 'scene', 'scene' => 'bureau/base/off'],
+               ['type' => 'scene', 'scene' => 'chambre/off'],
+               ['type' => 'scene', 'scene' => 'sdb/off'],
+               ['type' => 'scene', 'scene' => 'wc/off'],
+               ['type' => 'function', 'function' => 'stopHarmony'],
+               ['type' => 'function', 'function' => 'stopAllSqueezebox'],
+               ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
+               ['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' => 'sdb/hotwater/auto'],
+       ],
+
+       'home/welcome/eco' => [
+               ['type' => 'function', 'function' => 'welcomeEco'],
+       ],
+
+       'home/welcome/eco/salon' => [
+               ['type' => 'scene', 'scene' => 'salon/auto'],
+               ['type' => 'scene', 'scene' => 'cuisine/on'],
+               ['type' => 'ecomode', 'mode' => '0'],
+               ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
+               ['type' => 'scene', 'scene' => 'bureau/off'],
+               ['type' => 'scene', 'scene' => 'chambre/off'],
+       ],
+
+       'home/welcome/eco/homeoffice' => [
+               ['type' => 'scene', 'scene' => 'bureau/auto'],
+               ['type' => 'scene', 'scene' => 'cuisine/on'],
+               ['type' => 'ecomode', 'mode' => '0'],
+               ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
+               ['type' => 'scene', 'scene' => 'salon/off'],
+               ['type' => 'scene', 'scene' => 'chambre/off'],
+       ],
+
+       'home/welcome' => [
+               ['type' => 'scene', 'scene' => 'cuisine/on'],
+               ['type' => 'scene', 'scene' => 'salon/auto'],
+               ['type' => 'scene', 'scene' => 'bureau/auto'],
+               ['type' => 'scene', 'scene' => 'chambre/auto'],
+               ['type' => 'scene', 'scene' => 'sdb/on'],
+               ['type' => 'scene', 'scene' => 'cour/auto'],
+               ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
+               ['type' => 'ecomode', 'mode' => '0'],
+       ],
+       'home/hueoff' => [
+               ['type' => 'hue', 'group' => 17, 'scene' => ['on' => false, 'effect' => 'none']],
+       ],
+       'wc/on' => [
+               ['type' => 'function', 'function' => 'wcOn'],
+       ],
+       'wc/morning' => [
+               ['type' => 'hue', 'group' => $wc, 'scene' => 'NC5ejamHGUNURj8'],
+               ['type' => 'function', 'function' => 'wcMusic', 'args' => [70]],
+       ],
+       'wc/day' => [
+               ['type' => 'hue', 'group' => $wc, 'scene' => 'qfuu8z5QaJ6J26W'],
+               ['type' => 'function', 'function' => 'wcMusic', 'args' => [80]],
+       ],
+       'wc/evening' => [
+               ['type' => 'hue', 'group' => $wc, 'scene' => 'h82j28eNu6ZHVhM'],
+               ['type' => 'function', 'function' => 'wcMusic', 'args' => [80]],
+       ],
+       'wc/late' => [
+               ['type' => 'hue', 'group' => $wc, 'scene' => 'IGo4F5jRQXc1H95'],
+               ['type' => 'function', 'function' => 'wcMusic', 'args' => [70]],
+       ],
+       'wc/night' => [
+               ['type' => 'hue', 'group' => $wc, 'scene' => 'eJy09JTEzCiIL1P'],
+       ],
+       'wc/nightambiance' => [
+               ['type' => 'hue', 'group' => $wc, 'scene' => ['effect' => 'none']],
+               ['type' => 'scene', 'scene' => 'wc/night'],
+               ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Nuit d\'été', $squeezeboxPlayers['WC'], 100, false]],
+       ],
+       'wc/off' => [
+               ['type' => 'hue', 'group' => $wc, 'scene' => ['on' => false, 'effect' => 'none']],
+               ['type' => 'function', 'function' => 'stopSqueezeboxPlayer', 'args' => [$squeezeboxPlayers['WC'], false]],
+               ['type' => 'state', 'key' => 'wc', 'value' => 0],
+               ['type' => 'function', 'function' => 'wcVMCOff'],
+       ],
+       'wc/spa' => [
+               ['type' => 'hue', 'group' => $wc, 'scene' => ['effect' => 'colorloop', 'on' => true, 'brightness' => 128]],
+               ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Rivière', $squeezeboxPlayers['WC'], 100]],
+               ['type' => 'function', 'function' => 'wcVMCOff'],
+       ],
+       'wc/vmc/on' => [
+               ['type' => 'function', 'function' => 'wcVMCOn'],
+       ],
+       'wc/vmc/off' => [
+               ['type' => 'domoticz', 'device' => '6449', 'command' => false, 'priority' => true],
+       ],
+       'sdb/ampli/on' => [
+               ['type' => 'domoticz', 'device' => '476', 'command' => true, 'priority' => true],
+       ],
+       'sdb/ampli/off' => [
+               ['type' => 'domoticz', 'device' => '476', 'command' => false, 'priority' => true],
+       ],
+       'sdb/hotwater/auto' => [
+               ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['1']],
+       ],
+       'sdb/hotwater/auto/force' => [
+               ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['1', true]],
+       ],
+       'sdb/hotwater/eco' => [
+               ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['0']],
+               ['type' => 'function', 'function' => 'hotwater', 'args' => ['1']],
+       ],
+       'sdb/hotwater/max' => [
+               ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['0']],
+               ['type' => 'function', 'function' => 'hotwater', 'args' => ['2']],
+       ],
+       'sdb/hotwater/off' => [
+               ['type' => 'function', 'function' => 'hotwaterAutoMode', 'args' => ['0']],
+               ['type' => 'function', 'function' => 'hotwater', 'args' => ['0']],
+       ],
+       'sdb/off' => [
+               ['type' => 'state', 'key' => 'sdb', 'value' => 0],
+               ['type' => 'domoticz', 'scene' => 20, 'command' => false, 'priority' => true],
+               ['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],
+       ],
+       'sdb/morning' => [
+               ['type' => 'state', 'key' => 'sdb', 'value' => 1],
+               ['type' => 'scene', 'scene' => 'sdb/on'],
+               ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['France Info', $squeezeboxPlayers['Salle de bains'], 30]],
+       ],
+       'sdb/nuit' => [
+               ['type' => 'state', 'key' => 'sdb', 'value' => 1],
+               ['type' => 'domoticz', 'scene' => 21, 'command' => true, 'priority' => true],
+       ],
+       'sdb/spa' => [
+               ['type' => 'state', 'key' => 'sdb', 'value' => 1],
+               ['type' => 'domoticz', 'scene' => 22, 'command' => true, 'priority' => true],
+               ['type' => 'function', 'function' => 'squeezePlayByName', 'args' => ['Nature sounds', $squeezeboxPlayers['Salle de bains'], 65]],
+       ],
+       'salon/freebox/on' => [
+               ['type' => 'domoticz', 'device' => '1439', 'command' => true, 'priority' => true],
+       ],
+       'salon/freebox/off' => [
+               ['type' => 'domoticz', 'device' => '1439', 'command' => false],
+       ],
+       'cuisine/hotte/on' => [
+               ['type' => 'domoticz', 'scene' => 52, 'command' => true],
+       ],
+       'cuisine/hotte/off' => [
+               ['type' => 'domoticz', 'scene' => 52, 'command' => false],
+       ],
+       'cuisine/base/on' => [
+               ['type' => 'hue', 'group' => $cuisine, 'scene' => 'UDlNCnVQjTHZJFF'],
+       ],
+       'cuisine/on' => [
+               ['type' => 'scene', 'scene' => 'cuisine/hotte/on'],
+               ['type' => 'scene', 'scene' => 'cuisine/base/on'],
+       ],
+       'cuisine/tamise' => [
+               ['type' => 'scene', 'scene' => 'cuisine/hotte/on'],
+               ['type' => 'hue', 'group' => $cuisine, 'scene' => '44yXoQdJErFPksE']
+       ],
+       'cuisine/off' => [
+               ['type' => 'scene', 'scene' => 'cuisine/hotte/off'],
+               //['type' => 'hue', 'group' => $cuisine, 'scene' => array('on' => false)]
+       ],
+       'cuisine/toaster/toggle' => [
+               ['type' => 'domoticz', 'device' => '1453', 'command' => 'Toggle', 'priority' => true],
+       ],
+       'cuisine/toaster/on' => [
+               ['type' => 'domoticz', 'device' => '1453', 'command' => true, 'priority' => true],
+       ],
+       'cuisine/toaster/off' => [
+               ['type' => 'domoticz', 'device' => '1453', 'command' => false, 'priority' => true],
+       ],
+       'cuisine/coffee/on' => [
+               ['type' => 'function', 'function' => 'coffee_on'],
+       ],
+       'cuisine/coffee/off' => [
+               ['type' => 'function', 'function' => 'coffee_off'],
+       ],
+       'cour/auto' => [
+               ['type' => 'domoticz', 'device' => '6899', 'command' => true],
+               ['type' => 'function', 'function' => 'courAuto', 'args' => [true]],
+       ],
+       'cour/daylight' => [
+               ['type' => 'domoticz', 'device' => '6899', 'command' => true],
+               ['type' => 'hue', 'group' => $cour, 'scene' => '8RyJJ3Dn7ayPQ8t'],
+       ],
+       'cour/lumineux' => [
+               ['type' => 'domoticz', 'device' => '6899', 'command' => true],
+               ['type' => 'hue', 'group' => $cour, 'scene' => 'XzV1CuYIdHXPKoJ'],
+       ],
+       'cour/tropical' => [
+               ['type' => 'domoticz', 'device' => '6899', 'command' => true],
+               ['type' => 'hue', 'group' => $cour, 'scene' => 'wBdbymg1w5ZZvtS'],
+       ],
+       'cour/grow' => [
+               ['type' => 'domoticz', 'device' => '6899', 'command' => true],
+               ['type' => 'hue', 'group' => $cour, 'scene' => 'WVanIpWUWjkBjsS'],
+       ],
+       'cour/off' => [
+               ['type' => 'hue', 'group' => $cour, 'scene' => ['on' => false]],
+               ['type' => 'function', 'function' => 'courAuto', 'args' => [false]],
+               ['type' => 'domoticz', 'device' => '6899', 'command' => false],
+       ],
+       'cour/projecteurs/on' => [
+               ['type' => 'domoticz', 'device' => '6898', 'command' => true],
+       ],
+       'cour/projecteurs/off' => [
+               ['type' => 'domoticz', 'device' => '6898', 'command' => false],
+       ],
+       'ecomode/basic' => [
+               ['type' => 'domoticz', 'device' => '1', 'switchtype' => 'scene', 'command' => false],
+       ],
+       'ecomode/super' => [
+               ['type' => 'scene', 'scene' => 'ecomode/basic'],
+               ['type' => 'domoticz', 'device' => '2', 'switchtype' => 'scene', 'command' => false],
+       ],
+       'ecomode/notsuper' => [
+               ['type' => 'domoticz', 'device' => '2', 'switchtype' => 'scene', 'command' => true],
+       ],
+       'ecomode/on' => [
+               ['type' => 'scene', 'scene' => 'ecomode/basic'],
+               ['type' => 'scene', 'scene' => 'ecomode/notsuper'],
+       ],
+       'ecomode/off' => [
+               ['type' => 'scene', 'scene' => 'ecomode/notsuper'],
+               ['type' => 'domoticz', 'device' => '1', 'switchtype' => 'scene', 'command' => true, 'priority' => false],
+       ],
 ];
 
 
-function welcomeEco()
-{
-    $businessHour = [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];
-    if (isWeekEnd() || !in_array(date('G'), $businessHour)) {
-        execScene('home/welcome/eco/salon');
-    } else {
-        execScene('home/welcome/eco/homeoffice');
-    }
+function welcomeEco() {
+       $businessHour = [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];
+       if (isWeekEnd() || !in_array(date('G'), $businessHour)) {
+               execScene('home/welcome/eco/salon');
+       } else {
+               execScene('home/welcome/eco/homeoffice');
+       }
 }
 
-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 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);
-
-    $autoRooms = ['bureau', 'chambre', 'salon', 'cour'];
-
-    if (in_array($e[0], $autoRooms) && count($e) == 2) {
-        setState($e[0] . 'Off', $e[1] === 'off' ? '1' : '0');
-        if ($fromUserAction && $e[1] !== 'auto') {
-            call_user_func($e[0] . 'Auto', false);
-        }
-    }
-
-//    $killurl = WEB_ROOT . 'scripts/light.php?r=2';
-//    $kill = "/usr/bin/pkill -f $killurl";
-//    $res = `$kill`;
-
-    foreach ($scene as $action) {
-        if (isset($action['when'])) {
-            $ok = true;
-            foreach ($action['when'] as $k => $v) {
-                if (getState('k') != $v) {
-                    $ok = false;
-                    break;
-                }
-            }
-            if (!$ok) {
-                continue;
-            }
-        }
-
-        if (isset($action['wait']) && $action['wait'] > 0) {
-            usleep($action['wait'] * 10000000);
-        }
-
-        if ($action['type'] == 'hue') {
-            hueCommand($action, $transitionTime);
-        } else if ($action['type'] == 'delay' || $action['type'] == 'scene') {
-            if (!isset($action['delay'])) {
-                $action['delay'] = 0;
-            }
-            if ($action['delay'] > 1) {
-                delayScene($action['scene'], $action['delay']);
-            } else {
-                if ($action['delay'] > 0) {
-                    usleep(round($action['delay'] * 1000000));
-                }
-                execScene($action['scene'], $fromUserAction, $transitionTime);
-            }
-        } else if ($action['type'] == 'function') {
-            if (!isset($action['args'])) {
-                $action['args'] = array();
-            }
-            call_user_func_array($action['function'], $action['args']);
-        } else if ($action['type'] == 'state') {
-            setState($action['key'], $action['value']);
-        } else if ($action['type'] == 'phonetask') {
-            phoneTask($action['task'], $action['phone'], true);
-        } else if ($action['type'] == 'ecomode') {
-            ecoMode($action['mode'], $fromUserAction);
-        } else if ($action['type'] == 'domoticz') {
-            if (isset($action['scene'])) {
-                $action['device'] = $action['scene'];
-                $action['switchtype'] = 'scene';
-            }
-            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') {
-            ifttt($action['event']);
-        } else if ($action['type'] == 'nightmode') {
-            nightmode($action['mode']);
-        }
-    }
+function execScene($name, $fromUserAction = false, $transitionTime = null) {
+       global $scenes;
+
+       $scene = $scenes[$name];
+
+       profile('Exec scene ' . $name . '/' . $fromUserAction, __FILE__, __LINE__);
+
+       $e = explode('/', $name);
+
+       $autoRooms = ['bureau', 'chambre', 'salon', 'cour'];
+
+       if (in_array($e[0], $autoRooms) && count($e) == 2) {
+               setState($e[0] . 'Off', $e[1] === 'off' ? '1' : '0');
+               if ($fromUserAction && $e[1] !== 'auto') {
+                       call_user_func($e[0] . 'Auto', false);
+               }
+       }
+
+       //    $killurl = WEB_ROOT . 'scripts/light.php?r=2';
+       //    $kill = "/usr/bin/pkill -f $killurl";
+       //    $res = `$kill`;
+
+       foreach ($scene as $action) {
+               if (isset($action['when'])) {
+                       $ok = true;
+                       foreach ($action['when'] as $k => $v) {
+                               if (getState('k') != $v) {
+                                       $ok = false;
+                                       break;
+                               }
+                       }
+                       if (!$ok) {
+                               continue;
+                       }
+               }
+
+               if (isset($action['wait']) && $action['wait'] > 0) {
+                       usleep($action['wait'] * 10000000);
+               }
+
+               if ($action['type'] == 'hue') {
+                       hueCommand($action, $transitionTime);
+               } else if ($action['type'] == 'delay' || $action['type'] == 'scene') {
+                       if (!isset($action['delay'])) {
+                               $action['delay'] = 0;
+                       }
+                       if ($action['delay'] > 1) {
+                               delayScene($action['scene'], $action['delay']);
+                       } else {
+                               if ($action['delay'] > 0) {
+                                       usleep(round($action['delay'] * 1000000));
+                               }
+                               execScene($action['scene'], $fromUserAction, $transitionTime);
+                       }
+               } else if ($action['type'] == 'function') {
+                       if (!isset($action['args'])) {
+                               $action['args'] = array();
+                       }
+                       call_user_func_array($action['function'], $action['args']);
+               } else if ($action['type'] == 'state') {
+                       setState($action['key'], $action['value']);
+               } else if ($action['type'] == 'phonetask') {
+                       phoneTask($action['task'], $action['phone'], true);
+               } else if ($action['type'] == 'ecomode') {
+                       ecoMode($action['mode'], $fromUserAction);
+               } else if ($action['type'] == 'domoticz') {
+                       if (isset($action['scene'])) {
+                               $action['device'] = $action['scene'];
+                               $action['switchtype'] = 'scene';
+                       }
+                       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') {
+                       ifttt($action['event']);
+               } else if ($action['type'] == 'nightmode') {
+                       nightmode($action['mode']);
+               }
+       }
 }
 
-function chambreToggle($fromUserAction = false)
-{
-    if (getState('chambreOff') == 0) {
-        execScene('chambre/off', $fromUserAction);
-    } else {
-        execScene('chambre/full', $fromUserAction);
-    }
+function chambreToggle($fromUserAction = false) {
+       if (getState('chambreOff') == 0) {
+               execScene('chambre/off', $fromUserAction);
+       } else {
+               execScene('chambre/full', $fromUserAction);
+       }
 }
 
-function wcMusic($volume)
-{
-    $d = date('w');
-    if ($d == 3) {
-        $music = 'Radio Michel';
-    } else if ($d == 5) {
-        $music = 'Samba';
-        //$volume += 10;
-    } else {
-        $music = 'FIP';
-    }
-    squeezePlayByName($music, 'WC', $volume, false);
+function wcMusic($volume) {
+       $d = date('w');
+       if ($d == 3) {
+               $music = 'Radio Michel';
+       } else if ($d == 5) {
+               $music = 'Samba';
+               //$volume += 10;
+       } else {
+               $music = 'FIP';
+       }
+       squeezePlayByName($music, 'WC', $volume, false);
 }
 
-function wcToggle()
-{
-    if (getState('wc') == 1) {
-        execScene('wc/off', true);
-    } else {
-        wcOn();
-    }
+function wcToggle() {
+       if (getState('wc') == 1) {
+               execScene('wc/off', true);
+       } else {
+               wcOn();
+       }
 }
 
-function sdbToggle()
-{
-    if (getState('sdb') == 1) {
-        execScene('sdb/off');
-        stopSqueezebox('Salle de bains');
-    } else {
-        execScene('sdb/on');
-    }
+function sdbToggle() {
+       if (getState('sdb') == 1) {
+               execScene('sdb/off');
+               stopSqueezebox('Salle de bains');
+       } else {
+               execScene('sdb/on');
+       }
 }
 
-function wcOn($vmc = true)
-{
-    $hour = getHour();
-    if (getNightMode()) {
-        $period = 'night';
-    } else if ($hour > 0 && $hour < 6.75) {
-        $period = 'late';
-    } else if ($hour >= 6.75 && $hour < 10) {
-        $period = 'morning';
-    } else if ($hour >= 10 && $hour < 20) {
-        $period = 'day';
-    } else {
-        $period = 'evening';
-    }
-    execScene('wc/' . $period, true);
-    setState('wc', 1);
-    if ($vmc && $period != 'night') {
-        wcVMCOn();
-    } else {
-        wcVMCOff(0);
-    }
+function wcOn($vmc = true) {
+       $hour = getHour();
+       if (getNightMode()) {
+               $period = 'night';
+       } else if ($hour > 0 && $hour < 6.75) {
+               $period = 'late';
+       } else if ($hour >= 6.75 && $hour < 10) {
+               $period = 'morning';
+       } else if ($hour >= 10 && $hour < 20) {
+               $period = 'day';
+       } else {
+               $period = 'evening';
+       }
+       execScene('wc/' . $period, true);
+       setState('wc', 1);
+       if ($vmc && $period != 'night') {
+               wcVMCOn();
+       } else {
+               wcVMCOff(0);
+       }
 }
 
-function planetarium($on)
-{
-    setState('planetarium', $on ? '1' : '0');
-    checkPlanetarium(false);
+function planetarium($on) {
+       setState('planetarium', $on ? '1' : '0');
+       checkPlanetarium(false);
 }
 
-function checkPlanetarium($periodicOffCheck = true)
-{
-    $device = 4617;
-
-    $on = getState('planetarium') == '1';
-    $h = date('G');
-    if ($h >= 2 && $h <= 20) {
-        $on = false;
-    }
-    if ($on) {
-        if ($periodicOffCheck) {
-            $min = intval(date('i'));
-            if ($min % 30 == 0) {
-                domoticzSwitch($device, false);
-                sleep(5);
-            }
-        }
-        domoticzSwitch($device, true);
-    } else {
-        domoticzSwitch($device, false);
-    }
+function checkPlanetarium($periodicOffCheck = true) {
+       $device = 4617;
+
+       $on = getState('planetarium') == '1';
+       $h = date('G');
+       if ($h >= 2 && $h <= 20) {
+               $on = false;
+       }
+       if ($on) {
+               if ($periodicOffCheck) {
+                       $min = intval(date('i'));
+                       if ($min % 30 == 0) {
+                               domoticzSwitch($device, false);
+                               sleep(5);
+                       }
+               }
+               domoticzSwitch($device, true);
+       } else {
+               domoticzSwitch($device, false);
+       }
 }
 
-function cheminee($lightId, $room = 'salon', $program = 'fire', $brightness = 1)
-{
-    $start = time();
-    $hue = getHueInstance();
-    $speed = 2;
-    $brightness *= 100;
-    $brightnessAmplitude = $brightness * 0.75;
-
-    set_time_limit(0);
-
-    while (true) {
-        if ($program == 'fire') {
-            $time = rand(1 / $speed, 40 / $speed) / 10;
-            $color = rand(0, 10000);
-        } else if ($program == 'cold') {
-            $time = rand(20 / $speed, 40 / $speed) / 2;
-            $color = rand(25500, 46920);
-        }
-        if ($color < 0) {
-            $color += 65280;
-        }
-
-        $command = new \Phue\Command\SetLightState($lightId);
-        $command->on(true);
-        $command->hue($color);
-        $command->brightness(max(0, min(255, rand(0, $brightnessAmplitude) + $brightness - $brightnessAmplitude / 2)));
-        $command->saturation(max(0, min(255, 220 + rand(0, 36))));
-        $command->transitionTime($time);
-        $command->send($hue);
-        usleep($time * 1000000);
-    }
+function cheminee($lightId, $room = 'salon', $program = 'fire', $brightness = 1) {
+       $start = time();
+       $hue = getHueInstance();
+       $speed = 2;
+       $brightness *= 100;
+       $brightnessAmplitude = $brightness * 0.75;
+
+       set_time_limit(0);
+
+       while (true) {
+               if ($program == 'fire') {
+                       $time = rand(1 / $speed, 40 / $speed) / 10;
+                       $color = rand(0, 10000);
+               } else if ($program == 'cold') {
+                       $time = rand(20 / $speed, 40 / $speed) / 2;
+                       $color = rand(25500, 46920);
+               }
+               if ($color < 0) {
+                       $color += 65280;
+               }
+
+               $command = new \Phue\Command\SetLightState($lightId);
+               $command->on(true);
+               $command->hue($color);
+               $command->brightness(max(0, min(255, rand(0, $brightnessAmplitude) + $brightness - $brightnessAmplitude / 2)));
+               $command->saturation(max(0, min(255, 220 + rand(0, 36))));
+               $command->transitionTime($time);
+               $command->send($hue);
+               usleep($time * 1000000);
+       }
 }
 
-function killCheminee($room)
-{
-    // Kill current animation
-    $kill = '/usr/bin/pkill -f cheminee_running/' . $room;
-    $res = `$kill`;
-    echo 'Kill cheminée ' . $room . ' :: ' . $res;
-    return $res;
+function killCheminee($room) {
+       // Kill current animation
+       $kill = '/usr/bin/pkill -f cheminee_running/' . $room;
+       $res = `$kill`;
+       echo 'Kill cheminée ' . $room . ' :: ' . $res;
+       return $res;
 }
 
-function chemineeLight($lightId, $room, $program = 'fire', $brightness = 1)
-{
-    $run = "export QUERY_STRING=\"cheminee=running&light=" . $lightId . "&room=" . $room . "&program=" . $program . "&brightness=" . $brightness . "&sid=" . session_id() . "\";php -e " . __DIR__ . '/../light.php -- cheminee_running/' . $room;
-    $cmd = "echo '$run' | at now 2>&1";
-    return $cmd . ' : ' . `$cmd`;
+function chemineeLight($lightId, $room, $program = 'fire', $brightness = 1) {
+       $run = "export QUERY_STRING=\"cheminee=running&light=" . $lightId . "&room=" . $room . "&program=" . $program . "&brightness=" . $brightness . "&sid=" . session_id() . "\";php -e " . __DIR__ . '/../light.php -- cheminee_running/' . $room;
+       $cmd = "echo '$run' | at now 2>&1";
+       return $cmd . ' : ' . `$cmd`;
 }
 
-function chemineeOff($room)
-{
-    global $cheminee;
-    killCheminee($room);
-    $hue = getHueInstance();
-    // Turn off lights
-    $command = new \Phue\Command\SetGroupState($cheminee[$room]);
-    $command->transitionTime(5);
-    $command->saturation(255);
-    $command->hue(0);
-    $command->brightness(0);
-    $command->on(false);
-    $command->send($hue);
+function chemineeOff($room) {
+       global $cheminee;
+       killCheminee($room);
+       $hue = getHueInstance();
+       // Turn off lights
+       $command = new \Phue\Command\SetGroupState($cheminee[$room]);
+       $command->transitionTime(5);
+       $command->saturation(255);
+       $command->hue(0);
+       $command->brightness(0);
+       $command->on(false);
+       $command->send($hue);
 }
 
-function chemineeOn($room, $program = 'fire', $brightness = 1)
-{
-    global $chemineeLights;
-    killCheminee($room);
-    $res = '';
-    foreach ($chemineeLights[$room] as $lightId) {
-        $res .= chemineeLight($lightId, $room, $program, $brightness);
-    }
-    echo $res;
+function chemineeOn($room, $program = 'fire', $brightness = 1) {
+       global $chemineeLights;
+       killCheminee($room);
+       $res = '';
+       foreach ($chemineeLights[$room] as $lightId) {
+               $res .= chemineeLight($lightId, $room, $program, $brightness);
+       }
+       echo $res;
 }
 
-function bedbrightness($brightness)
-{
-    $cmd = 'sudo /usr/local/bin/screenbrightness ' . $brightness;
+function bedbrightness($brightness) {
+       $cmd = 'sudo /usr/local/bin/screenbrightness ' . $brightness;
 
-    sshCommand($cmd, 'litvincent');
-    sshCommand($cmd, 'litjerome');
+       sshCommand($cmd, 'litvincent');
+       sshCommand($cmd, 'litjerome');
 }
 
-function salonAuto($on = true)
-{
-    if ($on) {
-        setState('salonOff', '0');
-        setState('salonAutoMode', '1');
-        updateSalonAuto();
-    } else if (getState('salonAutoMode') === '1') {
-        setState('salonAutoMode', '0');
-    }
+function salonAuto($on = true) {
+       if ($on) {
+               setState('salonOff', '0');
+               setState('salonAutoMode', '1');
+               updateSalonAuto();
+       } else if (getState('salonAutoMode') === '1') {
+               setState('salonAutoMode', '0');
+       }
 }
 
-function chambreAuto($on = true, $transitionTime = null)
-{
-    if ($on) {
-        ecoMode(0);
-        setState('chambreAutoMode', '1');
-        updateChambreAuto($transitionTime);
-    } else if (getState('chambreAutoMode') === '1') {
-        setState('chambreAutoMode', '0');
-    }
+function chambreAuto($on = true, $transitionTime = null) {
+       if ($on) {
+               ecoMode(0);
+               setState('chambreAutoMode', '1');
+               updateChambreAuto($transitionTime);
+       } else if (getState('chambreAutoMode') === '1') {
+               setState('chambreAutoMode', '0');
+       }
 }
 
-function bureauAuto($on = true)
-{
-    if ($on) {
-        setState('bureauAutoMode', '1');
-        updateBureauAuto();
-    } else {
-        setState('bureauAutoMode', '0');
-    }
+function bureauAuto($on = true) {
+       if ($on) {
+               setState('bureauAutoMode', '1');
+               updateBureauAuto();
+       } else {
+               setState('bureauAutoMode', '0');
+       }
 }
 
-function courAuto($on = true)
-{
-    if ($on) {
-        setState('courAutoMode', '1');
-        updateCourAuto();
-    } else {
-        setState('courAutoMode', '0');
-    }
+function courAuto($on = true) {
+       if ($on) {
+               setState('courAutoMode', '1');
+               updateCourAuto();
+       } else {
+               setState('courAutoMode', '0');
+       }
 }
 
-function updateSalonAuto()
-{
-    if (getState('salonOff') == '1') {
-        execScene('salon/off');
-        return;
-    }
-    if (getState('salonAutoMode') != '1') {
-        return;
-    }
-    $hours = intval(date('H'));
-    if ($hours <= 9) {
-        $scene = 'tamise';
-    } else if ($hours <= 22) {
-        $scene = 'day';
-    } else {
-        $scene = 'tamise';
-    }
-    execScene('salon/' . $scene, false);
+function updateSalonAuto() {
+       if (getState('salonOff') == '1') {
+               execScene('salon/off');
+               return;
+       }
+       if (getState('salonAutoMode') != '1') {
+               return;
+       }
+       $hours = intval(date('H'));
+       if ($hours <= 9) {
+               $scene = 'tamise';
+       } else if ($hours <= 22) {
+               $scene = 'day';
+       } else {
+               $scene = 'tamise';
+       }
+       execScene('salon/' . $scene, false);
 }
 
-function updateChambreAuto($transitionTime = null)
-{
-    if (getState('chambreOff') == '1') {
-        execScene('chambre/off');
-        return;
-    }
-    if (getState('chambreAutoMode') != '1') {
-        return;
-    }
-    $hours = intval(date('H'));
-    if ($hours <= 4) {
-        $scene = 'party';
-    } else if ($hours <= 9) {
-        $scene = 'boreal';
-    } else if ($hours <= 11) {
-        $scene = 'tonic';
-    } else if ($hours <= 14) {
-        $scene = 'flowers';
-    } else if ($hours <= 18) {
-        $scene = 'beach';
-    } else if ($hours <= 22) {
-        $scene = 'tropical';
-    } else {
-        $scene = 'party';
-    }
-    execScene('chambre/' . $scene, false, $transitionTime);
+function updateChambreAuto($transitionTime = null) {
+       if (getState('chambreOff') == '1') {
+               execScene('chambre/off');
+               return;
+       }
+       if (getState('chambreAutoMode') != '1') {
+               return;
+       }
+       $hours = intval(date('H'));
+       if ($hours <= 4) {
+               $scene = 'party';
+       } else if ($hours <= 9) {
+               $scene = 'boreal';
+       } else if ($hours <= 11) {
+               $scene = 'tonic';
+       } else if ($hours <= 14) {
+               $scene = 'flowers';
+       } else if ($hours <= 18) {
+               $scene = 'beach';
+       } else if ($hours <= 22) {
+               $scene = 'tropical';
+       } else {
+               $scene = 'party';
+       }
+       execScene('chambre/' . $scene, false, $transitionTime);
 }
 
-function updateBureauAuto()
-{
-    if (getState('bureauOff') == '1') {
-        execScene('bureau/off');
-        return;
-    }
-    if (getState('bureauAutoMode') != '1') {
-        return;
-    }
-    $hours = intval(date('H'));
-    if ($hours <= 4) {
-        $scene = 'outrun';
-    } else if ($hours <= 9) {
-        $scene = 'boreal';
-    } else if ($hours <= 11) {
-        $scene = 'tonic';
-    } else if ($hours <= 14) {
-        $scene = 'flowers';
-    } else if ($hours <= 18) {
-        $scene = 'beach';
-    } else if ($hours <= 22) {
-        $scene = 'tropical';
-    } else {
-        $scene = 'outrun';
-    }
-    execScene('bureau/' . $scene);
+function updateBureauAuto() {
+       if (getState('bureauOff') == '1') {
+               execScene('bureau/off');
+               return;
+       }
+       if (getState('bureauAutoMode') != '1') {
+               return;
+       }
+       $hours = intval(date('H'));
+       if ($hours <= 4) {
+               $scene = 'outrun';
+       } else if ($hours <= 9) {
+               $scene = 'boreal';
+       } else if ($hours <= 11) {
+               $scene = 'tonic';
+       } else if ($hours <= 14) {
+               $scene = 'flowers';
+       } else if ($hours <= 18) {
+               $scene = 'beach';
+       } else if ($hours <= 22) {
+               $scene = 'tropical';
+       } else {
+               $scene = 'outrun';
+       }
+       execScene('bureau/' . $scene);
 }
 
-function updateCuisine()
-{
-    $salon = getState('salon', 'off');
-    if ($salon === 'day' || $salon === 'on' || $salon === 'off' || $salon === 'tamise') {
-        execScene('cuisine/base/on');
-    } else if ($salon == 'cinema') {
-        execScene('cuisine/tamise');
-    }
+function updateCuisine() {
+       $salon = getState('salon', 'off');
+       if ($salon === 'day' || $salon === 'on' || $salon === 'off' || $salon === 'tamise') {
+               execScene('cuisine/base/on');
+       } else if ($salon == 'cinema') {
+               execScene('cuisine/tamise');
+       }
 }
 
-function updateCourAuto()
-{
-    $h = date('H');
-    if ($h >= 7) {
-        execScene('cour/projecteurs/off');
-    } else {
-        execScene('cour/projecteurs/on');
-    }
-    if (getState('courOff') == '1') {
-        execScene('cour/off');
-        return;
-    }
-    if (getState('courAutoMode') != '1') {
-        return;
-    }
-    if (isDay()) {
-        $scene = 'daylight';
-    } else {
-        $scene = 'lumineux';
-    }
-    execScene('cour/' . $scene);
+function updateCourAuto() {
+       $h = date('H');
+       if ($h >= 7) {
+               execScene('cour/projecteurs/off');
+       } else {
+               execScene('cour/projecteurs/on');
+       }
+       if (getState('courOff') == '1') {
+               execScene('cour/off');
+               return;
+       }
+       if (getState('courAutoMode') != '1') {
+               return;
+       }
+       if (isDay()) {
+               $scene = 'daylight';
+       } else {
+               $scene = 'lumineux';
+       }
+       execScene('cour/' . $scene);
 }
 
-function wcVMCOn()
-{
-    setState('lastVMCOn', time());
-    // Start VMC
-    domoticzSwitch(6449, true, 'light', true);
+function wcVMCOn() {
+       setState('lastVMCOn', time());
+       // Start VMC
+       domoticzSwitch(6449, true, 'light', true);
 }
 
-function wcVMCOff($timeout = 'auto')
-{
-    if ($timeout === 'auto') {
-        $d = time() - getState('lastVMCOn');
-        if ($d <= 120) {
-            $timeout = 1200;
-        } else if ($d <= 300) {
-            $timeout = 1800;
-        } else {
-            $timeout = 3200;
-        }
-    }
-    $t = time() + $timeout;
-    $max = max(getState('wcVMCOff', -1), $t);
-    setState('wcVMCOff', $max);
-    if ($max <= time()) {
-        execScene('wc/vmc/off');
-    }
+function wcVMCOff($timeout = 'auto') {
+       if ($timeout === 'auto') {
+               $d = time() - getState('lastVMCOn');
+               if ($d <= 120) {
+                       $timeout = 1200;
+               } else if ($d <= 300) {
+                       $timeout = 1800;
+               } else {
+                       $timeout = 3200;
+               }
+       }
+       $t = time() + $timeout;
+       $max = max(getState('wcVMCOff', -1), $t);
+       setState('wcVMCOff', $max);
+       if ($max <= time()) {
+               execScene('wc/vmc/off');
+       }
 }
 
-function checkWCVMC()
-{
-    $offtime = getState('wcVMCOff', -1);
-    $time = time();
-    if ($offtime == -1 || $offtime > $time || getState('lastVMCOn') > $offtime) {
-        return;
-    }
-    execScene('wc/vmc/off');
+function checkWCVMC() {
+       $offtime = getState('wcVMCOff', -1);
+       $time = time();
+       if ($offtime == -1 || $offtime > $time || getState('lastVMCOn') > $offtime) {
+               return;
+       }
+       execScene('wc/vmc/off');
 }
 
-function delayHttpCall($url, $params, $delay)
-{
-    try {
-        $params['delay'] = $delay;
-        $res = httpRequest($url, 'get', $params, null, 1);
-        echo $url;
-        echo $res->getBody()->getContents();
-    } catch (Exception $e) {
-        print_r($e);
-    }
+function delayHttpCall($url, $params, $delay) {
+       try {
+               $params['delay'] = $delay;
+               $res = httpRequest($url, 'get', $params, null, 1);
+               echo $url;
+               echo $res->getBody()->getContents();
+       } catch (Exception $e) {
+               print_r($e);
+       }
 }
 
-function delayScene($scene, $delay)
-{
-    $host = $_SERVER['HTTP_HOST'] ?? 'entree.home.tortuga.enhydra.fr';
-    $url = 'https://' . $host . '/scripts/light.php';
-    delayHttpCall($url, ['scene' => $scene], $delay);
+function delayScene($scene, $delay) {
+       $host = $_SERVER['HTTP_HOST'] ?? 'entree.home.tortuga.enhydra.fr';
+       $url = 'https://' . $host . '/scripts/light.php';
+       delayHttpCall($url, ['scene' => $scene], $delay);
 }
 
-function alert()
-{
-    if (getNightMode()) {
-        return;
-    }
+function alert() {
+       if (getNightMode()) {
+               return;
+       }
 
-    execScene('home/doalert');
+       execScene('home/doalert');
 
-    $rep = 1 * 2;
-    $domoticzDevices = [4016, 4017, 4033, 4201, 4202, 4203, 4204, 4205, 4614, 4622];
-    $domoticzStates = [];
+       $rep = 1 * 2;
+       $domoticzDevices = [4016, 4017, 4033, 4201, 4202, 4203, 4204, 4205, 4614, 4622];
+       $domoticzStates = [];
 
-    foreach ($domoticzDevices as $domoticzDevice) {
-        $domoticzStates[$domoticzDevice] = getDomoticzDeviceStatus($domoticzDevice);
-    }
+       foreach ($domoticzDevices as $domoticzDevice) {
+               $domoticzStates[$domoticzDevice] = getDomoticzDeviceStatus($domoticzDevice);
+       }
 
-    for ($i = 0; $i < $rep; $i++) {
-        foreach ($domoticzDevices as $device) {
-            domoticzSwitch($device, 'Toggle', 'light', true);
-        }
-    }
+       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 = [];
+       $hue = getHueInstance();
+       $group = $hue->getGroups()[18];
+       $allLights = $hue->getLights();
+       $lights = [];
 
-    foreach ($group->getLightIds() as $lightId) {
-        $lights[$lightId] = $allLights[$lightId]->isOn();
-    }
+       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]]);
-        }
-    }
+       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);
+       sleep(15);
 
-    foreach ($lights as $lightId => $state) {
-        hueCommand(['light' => $lightId, 'scene' => ['on' => $state]]);
-    }
+       foreach ($lights as $lightId => $state) {
+               hueCommand(['light' => $lightId, 'scene' => ['on' => $state]]);
+       }
 
-    foreach ($domoticzStates as $domoticzDevice => $domoticzState) {
-        domoticzSwitch($domoticzDevice, $domoticzState);
-    }
+       foreach ($domoticzStates as $domoticzDevice => $domoticzState) {
+               domoticzSwitch($domoticzDevice, $domoticzState);
+       }
 
 }
 
-function autoRooms()
-{
-    if (getState('bureauAutoMode') == '1') {
-        updateBureauAuto();
-    }
-    if (getState('chambreAutoMode') == '1') {
-        updateChambreAuto();
-    }
-    if (getState('courAutoMode') == '1') {
-        updateCourAuto();
-    }
-    if (getState('salonAutoMode') == '1') {
-        updateSalonAuto();
-    }
-    updateCuisine();
-    checkPlanetarium();
-    checkWCVMC();
+function autoRooms() {
+       if (getState('bureauAutoMode') == '1') {
+               updateBureauAuto();
+       }
+       if (getState('chambreAutoMode') == '1') {
+               updateChambreAuto();
+       }
+       if (getState('courAutoMode') == '1') {
+               updateCourAuto();
+       }
+       if (getState('salonAutoMode') == '1') {
+               updateSalonAuto();
+       }
+       updateCuisine();
+       checkPlanetarium();
+       checkWCVMC();
 }
\ No newline at end of file