cronHotWater($cronmin);
cronRooms($cronmin);
cronWeather($cronmin);
- cronMagnet($cronmin);
- if ($cronmin % 5 == 0) {
+ if ($cronmin % 10 == 0) {
+ cronSqueezeFavorites($cronmin);
+ }
+ if ($cronmin % 15 == 0) {
+ cronXPlanet($cronmin);
+ cronPodcasts($cronmin);
+ cronMediaLibrary($cronmin);
+ cronTmdb($cronmin);
+ }
+ if ($cronmin % 5 == 0) {
cronTraffic($cronmin, false);
cronVelib($cronmin);
cronGuest($cronmin);
cronShield($cronmin);
}
- if ($cronmin % 10 == 0) {
- cronSqueezeFavorites($cronmin);
- }
+
if ($cronmin % 20 == 0) {
cronBackyard($cronmin);
cronSqueezeCheckPlayers($cronmin);
if ($cronmin % 2 == 0) {
cronPing($cronmin);
}
- if ($cronmin % 15 == 0) {
- cronXPlanet($cronmin);
- cronPodcasts($cronmin);
- cronMediaLibrary($cronmin);
- cronTmdb($cronmin);
- }
+
cronHarmony($cronmin);
cronInterface($cronmin);
-
cronEcoMode($cronmin);
- if ($cronmin % 5 == 0) {
- cronTranscode($cronmin);
- }
if ($cronmin % 15 == 0) {
cronKodi($cronmin);
}
hotwaterCheckMode();
}
-function cronMagnet($cronmin) {
- //_logSection('Magnet links');
- //file_get_contents("https://entree.home.tortuga.enhydra.fr/scripts/freeboxapi.php?action=magnets");
-}
function cronXPlanet($cronmin) {
_logSection('XPlanet');
}
-function cronBackyard($cronmin) {
- _logSection('Backyard');
- $device = 6898;
- domoticzSwitch($device, getDomoticzDeviceStatus($device) === 'On');
+function cronBackyard($cronmin)
+{
+ _logSection('Backyard');
}
function cronShield($cronmin) {
ecoMode(null, $cronmin % 15 === 0);
}
-function cronTranscode($cronmin) {
- _logSection('Transcode');
- httpRequest('https://salon.home.tortuga.enhydra.fr/scripts/transcode.php', 'get', [], null, 10, true);
-}
-
function _logSection($t) {
echo '------' . $t . ' :: ' . date('Y-m-d H:i:s') . "\n";
}
_logSection('Check squeezebox players');
}
-function cronWeather($cronmin) {
+function FGcronWeather($cronmin) {
_logSection('Weather');
getWeather();
}
<?php
-function disableAutoModes($duration) {
- setState('disable_auto_modes', time() + $duration);
+function disableAutoModes($duration)
+{
+ setState('disable_auto_modes', time() + $duration);
}
-function enableAutoModes() {
- setState('disable_auto_modes', 0);
+function enableAutoModes()
+{
+ setState('disable_auto_modes', 0);
}
-function isAutoModeEnabled() {
- return getState('disable_auto_modes', 0) < time();
+function isAutoModeEnabled()
+{
+ return getState('disable_auto_modes', 0) < time();
}
-function autoRooms() {
- if (isAutoModeEnabled()) {
- 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 (isAutoModeEnabled()) {
+ if (getState('bureauAutoMode') == '1') {
+ updateBureauAuto();
+ }
+ if (getState('chambreAutoMode') == '1') {
+ updateChambreAuto();
+ }
+ if (getState('courAutoMode') == '1') {
+ updateCourAuto();
+ }
+ if (getState('salonAutoMode') == '1') {
+ updateSalonAuto();
+ }
+ updateCuisine();
+ }
+ checkPlanetarium();
+ checkWCVMC();
}
-function updateBureauAuto() {
- if(!isAutoModeEnabled()){
- return;
- }
- 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 (!isAutoModeEnabled()) {
+ return;
+ }
+ 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() {
- if(!isAutoModeEnabled()){
- return;
- }
- $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()
+{
+ if (!isAutoModeEnabled()) {
+ return;
+ }
+ $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() {
- if(!isAutoModeEnabled()){
- return;
- }
- $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()
+{
+ if (!isAutoModeEnabled()) {
+ return;
+ }
+ $h = date('H');
+ if ($h >= 7 && $h <= 22) {
+ 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 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(!isAutoModeEnabled()){
- return;
- }
- if (getState('salonOff') == '1') {
- execScene('salon/off');
- return;
- }
- if (getState('salonAutoMode') != '1') {
- return;
- }
- $d = date('w');
- $hours = intval(date('H'));
- if ($d < 5) {
- if ($hours <= 9) {
- $scene = 'tamise';
- } else if ($hours <= 22) {
- $scene = 'day';
- } else {
- $scene = 'tamise';
- }
- } else {
- if ($hours <= 9) {
- $scene = 'tamise';
- } else {
- $scene = 'day';
- }
- }
- execScene('salon/' . $scene, false);
+function updateSalonAuto()
+{
+ if (!isAutoModeEnabled()) {
+ return;
+ }
+ if (getState('salonOff') == '1') {
+ execScene('salon/off');
+ return;
+ }
+ if (getState('salonAutoMode') != '1') {
+ return;
+ }
+ $d = date('w');
+ $hours = intval(date('H'));
+ if ($d < 5) {
+ if ($hours <= 9) {
+ $scene = 'tamise';
+ } else if ($hours <= 22) {
+ $scene = 'day';
+ } else {
+ $scene = 'tamise';
+ }
+ } else {
+ if ($hours <= 9) {
+ $scene = 'tamise';
+ } else {
+ $scene = 'day';
+ }
+ }
+ execScene('salon/' . $scene, false);
}
-function updateChambreAuto($transitionTime = null) {
- if(!isAutoModeEnabled()){
- return;
- }
- 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 (!isAutoModeEnabled()) {
+ return;
+ }
+ 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);
}