<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change afterPath="$PROJECT_DIR$/scripts/lib/cachemedia.php" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/scripts/media.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/.htaccess" beforeDir="false" afterPath="$PROJECT_DIR$/.htaccess" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/config/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/config/tv.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/tv.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/domoticz.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/domoticz.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/harmony.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/harmony.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/insteon.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/insteon.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/tmdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/tmdb.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/tmdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/tmdb.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/servers/startserver" beforeDir="false" afterPath="$PROJECT_DIR$/servers/startserver" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/servers/stopserver" beforeDir="false" afterPath="$PROJECT_DIR$/servers/stopserver" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/composer.json" beforeDir="false" afterPath="$PROJECT_DIR$/composer.json" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/composer.lock" beforeDir="false" afterPath="$PROJECT_DIR$/composer.lock" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/hue.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/light.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/light.php" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<workItem from="1563519793746" duration="1393000" />
<workItem from="1565460240768" duration="6405000" />
<workItem from="1565597022811" duration="1470000" />
- </task>
- <task id="LOCAL-00152" summary=".">
- <created>1550561095121</created>
- <option name="number" value="00152" />
- <option name="presentableId" value="LOCAL-00152" />
- <option name="project" value="LOCAL" />
- <updated>1550561095121</updated>
+ <workItem from="1565598552133" duration="873000" />
+ <workItem from="1565857750276" duration="198000" />
+ <workItem from="1565857963461" duration="6119000" />
</task>
<task id="LOCAL-00153" summary=".">
<created>1550561360205</created>
<option name="project" value="LOCAL" />
<updated>1563349220383</updated>
</task>
- <option name="localTasksCounter" value="201" />
+ <task id="LOCAL-00201" summary=".">
+ <created>1565598575548</created>
+ <option name="number" value="00201" />
+ <option name="presentableId" value="LOCAL-00201" />
+ <option name="project" value="LOCAL" />
+ <updated>1565598575548</updated>
+ </task>
+ <option name="localTasksCounter" value="202" />
<servers />
</component>
<component name="TodoView">
"require": {
"datto/json-rpc": "^4.0.4",
"datto/json-rpc-http": "^3.2.1",
- "sqmk/phue": "^v1.6.1",
+ "sqmk/phue": "^v1.7.0",
"zendframework/zend-http": "^2.7.0",
"alphayax/freebox_api_php": "^1.2.4",
"guzzlehttp/guzzle": "^6.3.3",
"zendframework/zend-db": "^2.10",
"zendframework/zend-i18n": "^2.9",
"zendframework/zend-i18n-resources": "^2.6",
- "ext-ssh2": "*",
"ext-json": "*"
}
}
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "9a9272d0b5f0d93af068be64ce3985f1",
+ "content-hash": "25c22f8a7754f5fd081527bd174c49a1",
"packages": [
{
"name": "alphayax/freebox_api_php",
"authors": [
{
"name": "Spencer Mortensen",
+ "role": "Developer",
"email": "smortensen@datto.com",
- "homepage": "http://spencermortensen.com",
- "role": "Developer"
+ "homepage": "http://spencermortensen.com"
}
],
"description": "Fully unit-tested JSON-RPC 2.0 for PHP",
"authors": [
{
"name": "Spencer Mortensen",
+ "role": "Developer",
"email": "smortensen@datto.com",
- "homepage": "http://spencermortensen.com",
- "role": "Developer"
+ "homepage": "http://spencermortensen.com"
}
],
"description": "HTTP client and server for JSON-RPC 2.0",
"authors": [
{
"name": "Michael Squires",
- "email": "sqmk@php.net",
- "role": "lead"
+ "role": "lead",
+ "email": "sqmk@php.net"
}
],
"description": "Phue - Philips Hue PHP client",
},
{
"name": "symfony/event-dispatcher",
- "version": "v4.3.2",
+ "version": "v4.3.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "d257021c1ab28d48d24a16de79dfab445ce93398"
+ "reference": "212b020949331b6531250584531363844b34a94e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d257021c1ab28d48d24a16de79dfab445ce93398",
- "reference": "d257021c1ab28d48d24a16de79dfab445ce93398",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/212b020949331b6531250584531363844b34a94e",
+ "reference": "212b020949331b6531250584531363844b34a94e",
"shasum": ""
},
"require": {
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2019-06-13T11:03:18+00:00"
+ "time": "2019-06-27T06:42:14+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
},
{
"name": "symfony/options-resolver",
- "version": "v4.3.2",
+ "version": "v4.3.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
- "platform": [],
+ "platform": {
+ "ext-json": "*"
+ },
"platform-dev": [],
"platform-overrides": {
"php": "7.3.3"
}
-function hueApplyScene($groupId, $sceneId)
+function hueApplyScene($groupId, $sceneId, $transitionTime = null)
{
+
$hue = getHueInstance();
$groups = $hue->getGroups();
$group = $groups[$groupId];
- print_r($group);
+ echo "Group : ";
+ print_r($group) . "\n";
+ echo "Scene : ";
+ print_r($sceneId);
+ echo "\n";
+ echo "Transition : ";
+ print_r($transitionTime);
+ echo "\n";
+ echo '-----' . "\n\n";
if (is_array($sceneId)) {
$command = new Phue\Command\SetGroupState($group);
foreach ($sceneId as $key => $value) {
$command->$key($value);
}
if (!isset($sceneId['effect'])) {
- $command->effect = 'none';
+ $command->effect('none');
+ }
+ if (null !== $transitionTime) {
+ $command->transitionTime($transitionTime);
}
$hue->sendCommand($command);
+
+ echo "Command !! : ";
+ print_r($command);
+
} else {
$command = new Phue\Command\SetGroupState($group);
- $command->effect = 'none';
+ if (null !== $transitionTime) {
+ $command->transitionTime($transitionTime);
+ } else {
+ $command->effect('none');
+ }
$hue->sendCommand($command);
$group->setScene($sceneId);
+
+ echo "Command ! : ";
+ print_r($command);
}
}
-function hueApplySceneLight($lightId, $sceneId)
+function hueApplySceneLight($lightId, $sceneId, $transitionTime = null)
{
$hue = getHueInstance();
$lights = $hue->getLights();
$light = $lights[$lightId];
+
+ echo "Light : ";
+ print_r($lightId) . "\n";
+ echo "Scene : ";
+ print_r($sceneId);
+ echo "\n";
+ echo "Transition : ";
+ print_r($transitionTime);
+ echo "\n";
+ echo '-----' . "\n\n";
+
if (is_array($sceneId)) {
$command = new Phue\Command\SetLightState($light);
+ if (null !== $transitionTime) {
+ $command->transitionTime($transitionTime);
+ }
foreach ($sceneId as $key => $value) {
$command->$key($value);
}
+
+
$hue->sendCommand($command);
+ echo "Command : ";
+ print_r($command);
} else {
$light->setScene($sceneId);
}
$scenes = [
'chambre/matin' => [
['type' => 'ecomode', 'mode' => '0'],
- ['type' => 'scene', 'scene' => 'chambre/rideaux/open'],
- ['type' => 'scene', 'scene' => 'chambre/auto'],
+ ['type' => 'hue', 'group' => $chambre, 'scene' => 'JNieZpDHu5fbMyf'],
+ ['type' => 'hue', 'group' => $chambre, 'scene' => 'dawn', 'delay' => 1],
+ ['type' => 'scene', 'scene' => 'chambre/rideaux/open', 'delay' => 31],
+ ['type' => 'scene', 'scene' => 'chambre/auto', 'delay' => 35],
['type' => 'scene', 'scene' => 'chambre/deshumidificateur/on'],
['type' => 'scene', 'scene' => 'chambre/planetarium/off'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
// ['type' => 'insteon', 'command' => '0?1338=I=0=0'],
],
'chambre/auto' => [
- ['type' => 'ecomode', 'mode' => '0'],
['type' => 'function', 'function' => 'chambreAuto', 'args' => [true]],
],
'chambre/bed' => [
];
-function execScene($name, $fromUserAction = false)
+function execScene($name, $fromUserAction = false, $transitionTime = null)
{
global $scenes;
$scene = $scenes[$name];
if ($action['type'] == 'hue') {
if (isset($action['group'])) {
- hueApplyScene($action['group'], $action['scene']);
+ hueApplyScene($action['group'], $action['scene'], $transitionTime);
} else if (isset($action['light'])) {
- hueApplySceneLight($action['light'], $action['scene']);
+ hueApplySceneLight($action['light'], $action['scene'], $transitionTime);
}
} else if ($action['type'] == 'insteon') {
insteonCommand($action['command']);
if ($action['delay'] > 0) {
usleep(round($action['delay'] * 1000000));
}
- execScene($action['scene'], $fromUserAction);
+ execScene($action['scene'], $fromUserAction, $transitionTime);
}
} else if ($action['type'] == 'function') {
$f = $action['function'];
sshCommand($cmd, 'litjerome');
}
-function chambreAuto($on = true)
+function chambreAuto($on = true, $transitionTime = null)
{
if ($on) {
+ ecoMode(0);
setState('chambreAutoMode', '1');
- updateChambreAuto();
+ updateChambreAuto($transitionTime);
} else {
setState('chambreAutoMode', '0');
}
}
}
-function updateChambreAuto()
+function updateChambreAuto($transitionTime = null)
{
$hours = intval(date('H'));
if ($hours <= 1) {
} else {
$scene = 'tropical';
}
- execScene('chambre/' . $scene);
+ execScene('chambre/' . $scene, false, $transitionTime);
}
function updateBureauAuto()
$hue = getHueInstance();
$command = new Phue\Command\DeleteGroup($_GET['group']);
$command->send($hue);
+} else if (isset($_GET['action']) && $_GET['action'] == 'createDawnScene') {
+ $hue = getHueInstance();
+ $command = new \Phue\Command\CreateScene('dawn', 'dawn', [7, 8, 9, 10, 11, 12, 13, 17, 21]);
+ $command->transitionTime(30);
+ $command->send($hue);
} else {
echo '<pre>';
print_r(getHueState());