Re: [Plugin] Informations du Jour
Publié : 16 août 2015, 15:00
Il n'y a pas de widget pour ce plugin, c'est le fonctionnement standard de jeedom
depuis mon OnePlus
depuis mon OnePlus
Forum sur Jeedom
https://www.jeedom.com/forum/
Code : Tout sélectionner
[START UPDATE]
****Installation/Mise à jour de Jeedom 1.205.0.3 (2015-08-17 12:08:44)****
Paramètres de la mise à jour : level : 0, mode : , version : , onlyThisVersion :
Vérification des mises à jour...
OK
Mise à plat des droits...OK
[START BACKUP]
***************Lancement de la sauvegarde de Jeedom le 2015-08-17 12:08:45***************
Vérification du système de fichiers (corruption)...OK
Mise à plat des droits...OK
Sauvegarde des fichiers...
OK
Suppression du fichier d'identification de la base de données...OK
Vérification de la base de données :
jeedom.connection
note : The storage engine for the table doesn't support check
Sauvegarde de la base de données...
OK
Création de l'archive...
OK
Nettoyage des anciennes sauvegardes...OK
Limite de la taille totale des sauvegardes à 200 Mo...OK
Nom du backup : /usr/share/nginx/www/jeedom/core/php/../../backup/backup-1.205.0.3-2015-08-17-12h08.tar.gz
***************Fin de la sauvegarde de Jeedom***************
[END BACKUP SUCCESS]
Desactivation de toutes les tâches
. OK
Désactivation de tous les scénarios
.......
............
..................
sh: 1: kill: No such process
.....
....................
............ OK
Nettoyage du dossier temporaire (tmp)...OK
Adresse de téléchargement : https://market.jeedom.fr/jeedom/master/jeedom.zip?timespamp=1439806173
Téléchargement en cours...--2015-08-17 12:09:33-- https://market.jeedom.fr/jeedom/master/jeedom.zip
Resolving market.jeedom.fr (market.jeedom.fr)... 37.187.67.222
:443... connected.HTTP request sent, awaiting response... 200 OK
Length: 25897307 (25M) [application/zip]
Saving to: `/usr/share/nginx/www/jeedom/install/../tmp/jeedom_update.zip'
0K ........ ........ ........ ........ ........ ........ 12% 8.21M 3s
3072K .
...... ........ ........ ........ ........ ........ 24% 10.2M 2s
6144K ........ ........ ........ ........ ........ ........ 36% 13.7M 2s
9216K ........ ........ ........ ........ ........ ........ 48% 13.7M 1s
12288K ........ ........ ........ ........ ........ ........ 60% 12.8M 1s
15360K ........ ........ ........
....... ........ ........ 72% 13.6M 1s
18432K ........ ........ ........ ........ ........ ........ 85% 13.1M 0s
21504K ........ ........ ........ ........ ........ ........ 97% 10.4M 0s
24576K ........ ... 100% 10.4M=2.1s
2015-08-17 12:09:36 (11.6 MB/s) - `/usr/share/nginx/www/jeedom/install/../tmp/jeedom_update.zip' saved [25897307/25897307]
OK
Nettoyage des dossiers en cours...OK
Nettoyage adminer en cours...OK
Nettoyage sysinfo en cours...OK
Création des dossiers temporaire...OK
Décompression en cours...
OK
Installation en cours...
OK
Renommage adminer en cours...OK
Renommage sysinfo en cours...OK
Vérification de la consistence de Jeedom...[START CONSISTENCY]
Création de plugin::cron
[END CONSISTENCY]
OK
Vérification de la mise à jour...
OK
***************Jeedom est à jour en version 1.205.0.9***************
***************Mise à jour des plugins***************
Début de la mise à jour de : camera
Téléchargement de l'objet...OK
Action de pre update...OK
Décompression de l'archive...OK
Installation de l'objet...OK
Début de la mise à jour de : dayinfo
Téléchargement de l'objet...OK
Action de pre update...OK
Décompression de l'archive...OK
Installation de l'objet...OK
PHP Fatal error: Call to a member function remove() on a non-object in /usr/share/nginx/www/jeedom/plugins/dayinfo/plugin_info/install.php on line 24
https://jeedom.fr/doc/documentation/plu ... yinfo.htmllunarok a écrit :@winhex c'est dans la doc.
qui me permettent d'inverser le week end (pour simplifier les scenario)week-end en cours (1 ou 0)
jour férié en cours (1 ou 0)
Code : Tout sélectionner
#[Dehors][info du jour][Férié]# == 0 OU #[Dehors][info du jour][Weekend]# == 1
Le plugin ne comporte pas de configuration générale
Bonsoir, je reviens sur ce sujet (date des saisons variables). Wikipédia ne semble pas dire que les dates sont fixes dans l'hémisphère sud.lunarok a écrit :Oui je suis d'accord, faut que l'information soit juste. J'ai un bout d'explication, dans l'hémisphère sud les saisons sont sur dates fixes.
Après PHP est effectivement à poil sur le sujet, pourtant c'est du calcul lunaire. Donc je vais bien trouver un truc.
Code : Tout sélectionner
<?php
/*
Initial algorithm
Author: G. SATRE
Date: 1999-10-26
(c) Copyright Institut de Mécanique Céleste - Bureau des longitudes - Observatoire de Paris
Adapted from JavaScript to PHP
Author: Diving91
Date: 2015-08-15
Equinoxe & Solstice dates can be checked here
http://www.imcce.fr/fr/grandpublic/temps/saisons.php
http://www.faaq.org/ephemerides/saisons/
*/
/* Usage
Season(): Default to Actual date and year
Season("YYYY"): Default to Actual date and Specified year
This class invocation type is only meaningful to be used with ->getDate($phase) method
Season("YYYY-mm-dd"): Default to Specified date and year
->getDate($phase) -> For a given year, return date of specified phase for desired Equinoxes & Solstices: 1= March, 2= June, 3= September, 4= December
->getPhase -> For a given date, return Season Phase is Equinoxes & Solstices: 1= March, 2= June, 3= September, 4= December
This method is mainly useful is you want to translate Season name, otherwise getSeason return English season's names
->getSeason() -> For a given date, return Season name in nothern hemisphere
->getSeason($hemisphere) -> For a given date, return Season name in Specified hemisphere
->getNextSeason() & getNextSeason($hemisphere) -> Same as previous for coming season
->getNextSeasonNbDays() -> For a given date, return remaining days before next season
*/
class Season {
private $_year;
private $_date;
public function __construct($in = null) {
if ($in == null) {
$this->_year = date("Y");
$this->_date = date("Y-m-d");
}
elseif (strlen($in) == 4) {
$this->_year = $in;
$this->_date = date("Y-m-d");
}
elseif (strlen($in) == 10) {
$this->_year = substr($in,0,4);
$this->_date = $in;
}
else { // wrong $in parameter -> Default to Actual date and year
$this->_year = date("Y");
$this->_date = date("Y-m-d");
}
//debug echo $this->_year.' - '.$this->_date."</br>";
}
private function trunc($x) {
if ($x>0.0) return floor($x);
else return ceil($x);
}
// (c) Copyright Institut de Mécanique Céleste - Bureau des longitudes - Observatoire de Paris
private function jjdate($x, $accuracy=1) {
$z1=$x+0.5;
$z=$this->trunc($z1);
$alpha=$this->trunc(($z-1867216.25)/36524.25);
$a=$z+1+$alpha-$this->trunc($alpha/4);
$b=$a+1524;
$c=$this->trunc(($b-122.1)/365.25);
$d=$this->trunc(365.25*$c);
$e=$this->trunc(($b-$d)/30.6001);
$day=$this->trunc($b-$d-$this->trunc(30.6001*$e));
if($e<13.5)
$month = $this->trunc($e-1);
else
$month = $this->trunc($e-13);
if($month>=3)
$year = $this->trunc($c-4716);
else
$year = $this->trunc($c-4715);
$hour = floor(($x+0.5 - floor($x+0.5))*24);
$minutes = floor($hour/24*60);
if ($accuracy==1)
return sprintf("%04d-",$year).sprintf("%02d-",$month).sprintf("%02d ",$day).sprintf("%02d:",$hour).sprintf("%02d",$minutes);
else
return sprintf("%04d-",$year).sprintf("%02d-",$month).sprintf("%02d",$day);
}
// (c) Copyright Institut de Mécanique Céleste - Bureau des longitudes - Observatoire de Paris
// $phase is Equinoxes & Solstices: 1= March, 2= June, 3= September, 4= December
public function getDate($phase) {
$k = $this->_year - 2000 - 1;
$dk = $k + 0.25 * (3 + $phase);
$t = 0.21451814 + 0.99997862442 * $dk;
$t+= 0.00642125 * sin(1.580244 + 0.0001621008 * $dk) + 0.0031065 * sin(4.143931 + 6.2829005032 * $dk);
$t+= 0.00190024 * sin(5.604775 + 6.2829478479 * $dk) + 0.00178801 * sin(3.987335 + 6.2828291282 * $dk);
$t+= 0.00004981 * sin(1.507976 + 6.283109952 * $dk) + 0.00006264 * sin(5.723365 + 6.283062603 * $dk);
$t+= 0.00006262 * sin(5.702396 + 6.2827383999 * $dk) + 0.00003833 * sin(7.166906 + 6.2827857489 * $dk);
$t+= 0.00003616 * sin(5.58175 + 6.2829912245 * $dk) + 0.00003597 * sin(5.591081 + 6.2826670315 * $dk);
$t+= 0.00003744 * sin(4.3918 + 12.5657883 * $dk) + 0.00001827 * sin(8.3129 + 12.56582984 * $dk);
$t+= 0.00003482 * sin(8.1219 + 12.56572963 * $dk) - 0.00001327 * sin(-2.1076 + 0.33756278 * $dk);
$t-= 0.00000557 * sin(5.549 + 5.753262 * $dk) + 0.00000537 * sin(1.255 + 0.003393 * $dk);
$t+= 0.00000486 * sin(19.268 + 77.7121103 * $dk) - 0.00000426 * sin(7.675 + 7.8602511 * $dk);
$t-= 0.00000385 * sin(2.911 + 0.0005412 * $dk) - 0.00000372 * sin(2.266 + 3.9301258 * $dk);
$t-= 0.0000021 * sin(4.785 + 11.5065238 * $dk) + 0.0000019 * sin(6.158 + 1.5774 * $dk);
$t+= 0.00000204 * sin(0.582 + 0.5296557 * $dk) - 0.00000157 * sin(1.782 + 5.8848012 * $dk);
$t+= 0.00000137 * sin(-4.265 + 0.3980615 * $dk) - 0.00000124 * sin(3.871 + 5.2236573 * $dk);
$t+= 0.00000119 * sin(2.145 + 5.5075293 * $dk) + 0.00000144 * sin(0.476 + 0.0261074 * $dk);
$t+= 0.00000038 * sin(6.45 + 18.848689 * $dk) + 0.00000078 * sin(2.8 + 0.775638 * $dk);
$t-= 0.00000051 * sin(3.67 + 11.790375 * $dk) + 0.00000045 * sin(-5.79 + 0.796122 * $dk);
$t+= 0.00000024 * sin(5.61 + 0.213214 * $dk) + 0.00000043 * sin(7.39 + 10.976868 * $dk);
$t-= 0.00000038 * sin(3.1 + 5.486739 * $dk) - 0.00000033 * sin(0.64 + 2.544339 * $dk);
$t+= 0.00000033 * sin(-4.78 + 5.573024 * $dk) - 0.00000032 * sin(5.33 + 6.069644 * $dk);
$t-= 0.00000021 * sin(2.65 + 0.020781 * $dk) - 0.00000021 * sin(5.61 + 2.9424 * $dk);
$t+= 0.00000019 * sin(-0.93 + 0.000799 * $dk) - 0.00000016 * sin(3.22 + 4.694014 * $dk);
$t+= 0.00000016 * sin(-3.59 + 0.006829 * $dk) - 0.00000016 * sin(1.96 + 2.146279 * $dk);
$t-= 0.00000016 * sin(5.92 + 15.720504 * $dk) + 0.00000115 * sin(23.671 + 83.9950108 * $dk);
$t+= 0.00000115 * Sin(17.845 + 71.4292098 * $dk);
$jjd = 2451545 + $t * 365.25;
$d = $this->_year / 100;
$tetuj = (32.23 * ($d - 18.3) * ($d - 18.3) - 15) / 86400;
$jjd = $jjd - $tetuj;
$jjd = $jjd + 0.0003472222;
return $this->jjdate($jjd,0);
}
public function getPhase() {
//echo $this->_date." = ";
$p1 = $this->getDate(1);
$p2 = $this->getDate(2);
$p3 = $this->getDate(3);
$p4 = $this->getDate(4);
if (($this->_date < $p1) || ($this->_date >= $p4)) return 4;
elseif ($this->_date < $p2) return 1;
elseif ($this->_date < $p3) return 2;
elseif ($this->_date < $p4) return 3;
}
public function getSeason($hemisphere = "nothern") {
if ($hemisphere == "nothern")
$season_names = array('Spring', 'Summer', 'Fall', 'Winter');
else
$season_names = array('Fall', 'Winter', 'Spring', 'Summer');
return $season_names[$this->getPhase() - 1];
}
public function getNextSeason($hemisphere = "nothern") {
if ($hemisphere == "nothern")
$season_names = array('', 'Summer', 'Fall', 'Winter', 'Spring');
else
$season_names = array('', 'Winter', 'Spring', 'Summer', 'Fall');
return $season_names[$this->getPhase()];
}
public function getNextSeasonNbDays() {
$p = $this->getPhase();
$d = $this->getDate($p%4+1); // Date of next phase
if ($d < $this->_date) { //we are in december
$x = new Season(date("Y")+1);
$d = $x->getDate(1); // getdate for phase 1 next year
}
$d2 = strftime('%d-%m-%Y',strtotime($d));
$d1 = strftime('%d-%m-%Y',strtotime($this->_date));
$delta = round((strtotime($d2) - strtotime($d1))/86400);
return $delta;
//echo $this->_date." to ".$d." = ".$delta;
}
public function getTest() {
echo "Today ".$this->_date." we are in ".$this->getSeason().". It remains ".$this->getNextSeasonNbDays()."days before ".$this->getNextSeason()."</br>";
}
}
$x = new Season();
$x->getTest();
?>
Today 2015-08-17 we are in Summer. It remains 37days before Fall
De rien. bon j'ai pas poussé le vice a gérer nos amis chinois et russes, j'espère qu'ils pardonnerontlunarok a écrit :@diving91 merci n'intègre ça quand j'ai un peu de temps
Ok merci ! Et les scénarios gèrent/interprètent le modulo ? (Le fameux $num_semaine%2 == 0)lunarok a écrit :@Tauks voir la doc jeedom, ce que tu demandes est déjà disponible de base, donc inutile en plugin.
Tu as le numéro de semaine et donc tu peux déterminer si il est pair
depuis mon OnePlus
enfaite j'ai l'info we de ton plug différe en scénariowinhex a écrit :https://jeedom.fr/doc/documentation/plu ... yinfo.htmllunarok a écrit :@winhex c'est dans la doc.
j'y vois rien
qui me permettent d'inverser le week end (pour simplifier les scenario)week-end en cours (1 ou 0)
jour férié en cours (1 ou 0)
sinon ça donne ça pour un jour ouvréCode : Tout sélectionner
#[Dehors][info du jour][Férié]# == 0 OU #[Dehors][info du jour][Weekend]# == 1
Le plugin ne comporte pas de configuration générale