'chambre/boreal' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'mwAGvt2n70oXCqA'],
['type' => 'domoticz', 'scene' => 4, 'command' => true, 'priority' => true],
//['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/savane' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'ABqCuE-ob-sw2vQ'],
['type' => 'domoticz', 'scene' => 5, 'command' => true, 'priority' => true],
//['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/focus' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'Ne6uJnnoPO9yRhl'],
['type' => 'domoticz', 'scene' => 6, 'command' => true, 'priority' => true],
//['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/chillout' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => '03gdSwPyZ9sbZVg'],
['type' => 'domoticz', 'scene' => 7, 'command' => true, 'priority' => true],
//['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/reading' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'BNiNQjxiWNbKRaH'],
['type' => 'domoticz', 'scene' => 8, 'command' => true, 'priority' => true],
// ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/tonic' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'Tlcft9sPK492cJA'],
['type' => 'domoticz', 'scene' => 9, 'command' => true, 'priority' => true],
// ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/party' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'qvQXHDodBPa0cZf'],
['type' => 'domoticz', 'scene' => 12, 'command' => true, 'priority' => true],
//['type' => 'insteon', 'command' => '0?1119=I=0=0'],
],
'chambre/flowers' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'VtGPKtpQ7DF-RCd'],
['type' => 'domoticz', 'scene' => 13, 'command' => true, 'priority' => true],
//['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/tropical' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'Mqq8VMsmPQtzEQ0'],
['type' => 'domoticz', 'scene' => 14, 'command' => true, 'priority' => true],
// ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/beach' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'HfMaPG92lEOUDB0'],
['type' => 'domoticz', 'scene' => 15, 'command' => true, 'priority' => true],
//['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'domoticz', 'scene' => 16, 'command' => true, 'priority' => true],
],
'chambre/summernight' => [
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'scene', 'scene' => 'chambre/nightlights'],
//['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
],
'chambre/lounge' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'XGuSVQ3RCd7JUBC'],
['type' => 'domoticz', 'scene' => 17, 'command' => true, 'priority' => true],
// ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
],
'chambre/full' => [
['type' => 'nightmode', 'mode' => '0'],
- ['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'hue', 'group' => $chambre, 'scene' => 'ZkiQbNQDXJz9-OC'],
['type' => 'domoticz', 'scene' => 18, 'command' => true, 'priority' => true],
// ['type' => 'insteon', 'command' => '0?1132=I=0=0'],
// ['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],
],
['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'],
$e = explode('/', $name);
- if ($fromUserAction && $e[1] !== 'auto' && count($e) == 2) {
- call_user_func($e[0] . 'Auto', false);
+ $autoRooms = ['bureau', 'chambre', 'salon', 'cour'];
+
+ if (in_array($e[0], $autoRooms)) {
setState($e[0] . 'Off', $e[1] === 'off' ? '1' : '0');
+ if ($fromUserAction && $e[1] !== 'auto' && count($e) == 2) {
+ call_user_func($e[0] . 'Auto', false);
+
+ }
}
$killurl = WEB_ROOT . 'scripts/light.php?[r]=2';
if ($action['type'] == 'hue') {
hueCommand($action, $transitionTime);
- } else if ($action['type'] == 'delay' || $action['type'] == 'scene') {
+ } else if ($action['type'] == 'delay' || $action['type'] == 'scene') {
if (!isset($action['delay'])) {
$action['delay'] = 0;
}
}
}
-function chambreToggle()
+function chambreToggle($fromUserAction = false)
{
- if (getState('chambre') == 1) {
- execScene('chambre/off');
+ if (getState('chambreOff') == 0) {
+ execScene('chambre/off', $fromUserAction);
} else {
- execScene('chambre/full');
+ execScene('chambre/full', $fromUserAction);
}
}
function wcToggle()
{
if (getState('wc') == 1) {
- execScene('wc/off');
+ execScene('wc/off', true);
} else {
wcOn();
}
function wcOn($vmc = true)
{
-
$hour = getHour();
if (getNightMode()) {
$period = 'night';
} else {
$period = 'evening';
}
- execScene('wc/' . $period);
+ execScene('wc/' . $period, true);
setState('wc', 1);
if ($vmc && $period != 'night') {
wcVMCOn();
function salonAuto($on = true)
{
if ($on) {
-
setState('salonAutoMode', '1');
updateSalonAuto();
} else if (getState('salonAutoMode') === '1') {
function chambreAuto($on = true, $transitionTime = null)
{
- if (getState('chambreOff') == '1') {
- execScene('chambre/off');
- return;
- }
if ($on) {
ecoMode(0);
setState('chambreAutoMode', '1');
execScene('salon/off');
return;
}
+ if (getState('salonAutoMode') != '1') {
+ return;
+ }
$hours = intval(date('H'));
if ($hours <= 9) {
$scene = 'tamise';
execScene('chambre/off');
return;
}
+ if (getState('chambreAutoMode') != '1') {
+ return;
+ }
$hours = intval(date('H'));
if ($hours <= 4) {
$scene = 'party';
execScene('bureau/off');
return;
}
+ if (getState('bureauAutoMode') != '1') {
+ return;
+ }
$hours = intval(date('H'));
if ($hours <= 4) {
$scene = 'outrun';
execScene('cour/off');
return;
}
+ if (getState('courAutoMode') != '1') {
+ return;
+ }
if (isDay()) {
$scene = 'daylight';
} else {
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();
}
\ No newline at end of file