]> _ Git - tortuga-home.git/commitdiff
.
authorvincent <vincent@enhydra.fr>
Sun, 13 Feb 2022 11:06:42 +0000 (12:06 +0100)
committervincent <vincent@enhydra.fr>
Sun, 13 Feb 2022 11:06:42 +0000 (12:06 +0100)
.idea/workspace.xml
config/rooms.php
scripts/cron/cron.php
scripts/lib/domoticz.php
scripts/lib/lib.php
scripts/lib/scenes.php

index b645bf31d07a45d6ac8943a33f4fcafebb8ad02c..fbd6b700cc9d49705c15d0e32d8c6e3bf1a696c3 100644 (file)
@@ -3,7 +3,11 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/switchbot.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/switchbot.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/rooms.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/rooms.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/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1642848701157" duration="3435000" />
       <workItem from="1642856038290" duration="9359000" />
       <workItem from="1642939498777" duration="2862000" />
-      <workItem from="1642946319444" duration="2408000" />
-    </task>
-    <task id="LOCAL-00466" summary=".">
-      <created>1618341457184</created>
-      <option name="number" value="00466" />
-      <option name="presentableId" value="LOCAL-00466" />
-      <option name="project" value="LOCAL" />
-      <updated>1618341457184</updated>
+      <workItem from="1642946319444" duration="4176000" />
+      <workItem from="1642972278612" duration="818000" />
+      <workItem from="1643960128394" duration="25000" />
+      <workItem from="1643960576868" duration="95000" />
+      <workItem from="1643960682357" duration="593000" />
+      <workItem from="1644143547964" duration="594000" />
+      <workItem from="1644673539378" duration="1825000" />
+      <workItem from="1644683361342" duration="3044000" />
     </task>
     <task id="LOCAL-00467" summary=".">
       <created>1618342660944</created>
       <option name="project" value="LOCAL" />
       <updated>1642950374766</updated>
     </task>
-    <option name="localTasksCounter" value="515" />
+    <task id="LOCAL-00515" summary=".">
+      <created>1642950622190</created>
+      <option name="number" value="00515" />
+      <option name="presentableId" value="LOCAL-00515" />
+      <option name="project" value="LOCAL" />
+      <updated>1642950622190</updated>
+    </task>
+    <option name="localTasksCounter" value="516" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 6667d542905cf825e7a5e2131b49e7daa6c6b308..ddfea6ac995648d89724b2ac40f4b73d1d70c92e 100644 (file)
@@ -60,6 +60,7 @@ function salon()
     $favorites = [
         ['type' => 'light', 'scene' => 'salon/on', 'label' => 'Allumer'],
         ['type' => 'light', 'scene' => 'salon/off', 'label' => 'éteindre'],
+        ['type' => 'light', 'scene' => 'salon/lumineux', 'label' => 'lumineux'],
         ['type' => 'light', 'scene' => 'salon/cinema', 'label' => 'cinéma'],
         ['type' => 'light', 'scene' => 'salon/cineclub', 'label' => 'cinéma de minuit'],
         ['type' => 'light', 'scene' => 'salon/tamise', 'label' => 'Tamisé'],
index aef371bbb133d0e69869372ae4b19b160d72c307..586860dd4afc8fce0d3b929d493ab06d42162f4a 100644 (file)
@@ -237,13 +237,14 @@ function cronWeather($cronmin)
     $res['outdoor_temp'] = toNumber(getDomoticzDeviceStatus(1467), 1);
     $res['outdoor_humidity'] = toNumber(getDomoticzDeviceStatus(1026), true);
     $res['outdoor_pressure'] = toNumber(getDomoticzDeviceStatus(1027), true);
-    $res['backyard_temp'] = toNumber(getDomoticzDeviceStatus(6840), 1);
-    $res['backyard_humidity'] = toNumber(getDomoticzDeviceStatus(6841), true);
-    $res['backyard_pressure'] = toNumber(getDomoticzDeviceStatus(6842), true);
+    $res['backyard_temp'] = toNumber(getDomoticzDeviceStatus(1354), 1);
+    $res['backyard_humidity'] = toNumber(getDomoticzDeviceStatus(1357), true);
+    $res['backyard_pressure'] = toNumber(getDomoticzDeviceStatus(1358), true);
     $res['bathroom_temp'] = toNumber(getDomoticzDeviceStatus(1346), 1);
     $res['bathroom_humidity'] = toNumber(getDomoticzDeviceStatus(1347), true);
-    $res['bedroom_temp'] = toNumber(getDomoticzDeviceStatus(1356), 1);
-    $res['bedroom_humidity'] = toNumber(getDomoticzDeviceStatus(1357), true);
+    $res['bedroom_temp'] = toNumber(getDomoticzDeviceStatus(6851), 1);
+    $res['bedroom_humidity'] = toNumber(getDomoticzDeviceStatus(6852), true);
+    $res['bedroom_airquality'] = toNumber(getDomoticzDeviceStatus(6853), true);
     $res['livingroom_temp'] = toNumber(getDomoticzDeviceStatus(6453), 1);
     $res['livingroom_humidity'] = toNumber(getDomoticzDeviceStatus(6454), true);
     $res['kitchen_temp'] = toNumber(getDomoticzDeviceStatus(1506), 1);
index 5599e5279ccacba9438f120b6ca391d3c52c0338..111975cf96644b7853146bfa7c5d7a9ec3b48ffb 100644 (file)
@@ -64,6 +64,7 @@ function getDomoticzDeviceStatus($device, $force = false, $key = 'Data')
     //echo ':)';
     $res = runDomoticzCommand(['type' => 'devices', 'rid' => $device]);
     $res = json_decode($res->getBody(), true);
+
     try {
         $update = new DateTime($res['result'][0]['LastUpdate']);
         $now = new DateTime();
index ba854e480b76a60066068ef959a611f0f1ced689..39c270043109f19a97f96239898c3398d0c46376 100644 (file)
@@ -593,6 +593,8 @@ function toNumber($val, $round = false)
     if ($val === false) {
         return '--';
     }
+    $e = explode(',', $val);
+    $val = $e[0];
     $val = preg_replace('/[^0-9-.]/', '', $val);
     $val = floatval($val);
     if ($round) {
index ad8439c2c71ed33b36ac9392491888be9e118242..8b29ed254e98488460bac2579d17f086f61fadbe 100644 (file)
@@ -355,6 +355,13 @@ $scenes = [
         ['type' => 'scene', 'scene' => 'cuisine/on', 'delay' => 1],
         ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
     ],
+    'salon/lumineux' => [
+        ['type' => 'domoticz', 'scene' => 51, 'command' => true, 'priority' => true],
+        ['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO', 'repeat' => 2],
+        ['type' => 'state', 'key' => 'salon', 'value' => 'on'],
+        ['type' => 'scene', 'scene' => 'cuisine/on', 'delay' => 1],
+        ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1],
+    ],
     'salon/off' => [
         ['type' => 'domoticz', 'scene' => 45, 'command' => false, 'priority' => true],
         ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],