['type' => 'ecomode', 'mode' => '1'],
['type' => 'state', 'key' => 'chambre', 'value' => 0],
['type' => 'scene', 'scene' => 'chambre/rideaux/close'],
- ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+ //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
['type' => 'scene', 'scene' => 'chambre/raspberry/off'],
['type' => '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' => 'insteon', 'command' => '0?1332=I=0=0'], // Lustre et tableau off
['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
['type' => 'scene', 'scene' => 'chambre/rideaux/close'],
['type' => 'scene', 'scene' => 'sdb/off'],
['type' => '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'],
+ //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
],
'chambre/savane' => [
['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'],
+ //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
'chambre/focus' => [
['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'],
+ //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
],
['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'],
+ //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
['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'],
+ // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
['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'],
+ // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee/cold'],
],
['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'],
+ //['type' => 'insteon', 'command' => '0?1119=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
['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'],
+ //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
['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'],
+ // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
['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' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
'chambre/summernight' => [
['type' => 'state', 'key' => 'chambre', 'value' => 1],
['type' => 'scene', 'scene' => 'chambre/nightlights'],
- ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
+ //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
['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'],
+ // ['type' => 'insteon', 'command' => '0?1131=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
['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?1132=I=0=0'],
['type' => 'function', 'function' => 'bedbrightness', 'args' => [255]],
['type' => 'scene', 'scene' => 'chambre/cheminee'],
],
['type' => 'function', 'function' => 'chambreAuto', 'args' => [false]],
['type' => 'state', 'key' => 'chambre', 'value' => 0],
['type' => 'hue', 'group' => $chambre, 'scene' => array('on' => false, 'brightness' => 0)],
- ['type' => 'insteon', 'command' => '0?1332=I=0=0'],
+ // ['type' => 'insteon', 'command' => '0?1332=I=0=0'],
['type' => 'domoticz', 'scene' => 19, 'command' => false, 'priority' => true],
],
['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' => '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'],
+ //['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)],
],
'salon/on' => [
['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO'],
- ['type' => 'insteon', 'command' => '0?113=I=0=0'],
+ //['type' => 'insteon', 'command' => '0?113=I=0=0'],
['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO'],
],
'salon/off' => [
['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],
- ['type' => 'insteon', 'command' => '0?133=I=0=0'],
+ //['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'],
'salon/cinemabase' => [
['type' => 'scene', 'scene' => 'cuisine/tamise'],
['type' => 'ecomode', 'mode' => '0'],
- ['type' => 'insteon', 'command' => '0?1111=I=0=0'],
+ // ['type' => 'insteon', 'command' => '0?1111=I=0=0'],
],
'salon/cineclub' => [
['type' => 'hue', 'group' => $salon, 'scene' => 'xpCjXtV3u7O1kYu'],
'salon/tamise' => [
['type' => 'ecomode', 'mode' => '0'],
['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'],
- ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
+ // ['type' => 'insteon', 'command' => '0?1130=I=0=0'],
['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.8]],
['type' => 'hue', 'group' => $salon, 'scene' => 'RbjnIcLtcDuHbfU'],
],
'salon/lecturenocture' => [
['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'],
- ['type' => 'insteon', 'command' => '0?1113=I=0=0'],
+ // ['type' => 'insteon', 'command' => '0?1113=I=0=0'],
['type' => 'function', 'function' => 'chemineeOn', 'args' => ['salon', 'fire', 0.25]],
['type' => 'hue', 'group' => $salon, 'scene' => 'HZiYyM6hMUMkmiY'],
],
['type' => 'domoticz', 'device' => '391', 'command' => 'Toggle', 'priority' => true],
],
'insteon/off' => [
- ['type' => 'insteon', 'command' => '0?135=I=0=0'],
+ // ['type' => 'insteon', 'command' => '0?135=I=0=0'],
],
'home/off' => [
['type' => 'scene', 'scene' => 'home/hueoff'],
function wcOn($vmc = true)
{
+
$hour = getHour();
if (getNightMode()) {
$period = 'night';
function wcVMCOn()
{
+ setState('lastVMCOn', time());
// Start VMC
insteonCommand('0?1134=I=0=0');
}
-function wcVMCOff($timeout = 600)
+function wcVMCOff($timeout = 'auto')
{
- setState('wcVMCOff', max(getState('wcVMCOff', -1), time() + $timeout));
- if ($timeout === 0) {
+ if ($timeout === 'auto') {
+ $d = time() - getState('lastVMCOn');
+ if ($d <= 60) {
+ $timeout = 0;
+ } else if ($d > 60 && $d <= 120) {
+ $timeout = 60;
+ } else if ($d > 120 && $d <= 300) {
+ $timeout = 300;
+ } else {
+ $timeout = 600;
+ }
+ }
+ $t = time() + $timeout;
+ $max = max(getState('wcVMCOff', -1), $t);
+ setState('wcVMCOff', $max);
+ if ($max <= time()) {
execScene('wc/vmc/off');
}
}
{
$offtime = getState('wcVMCOff', -1);
$time = time();
- if ($offtime == -1 || $offtime > $time) {
+ if ($offtime == -1 || $offtime > $time || getState('lastVMCOn') > $offtime) {
return;
}
execScene('wc/vmc/off');