]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Sun, 9 Jul 2023 14:25:44 +0000 (16:25 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Sun, 9 Jul 2023 14:25:44 +0000 (16:25 +0200)
.docker/config/httpd/httpd.conf
.idea/workspace.xml
scripts/homeassistant_device_event.php
scripts/lib/scenes.php
scripts/lib/weatherstation.php

index 9956ab241e95e89d2b5fbb7dff06941de8b652ca..d559470fba6b1f077603b6d4145ce79c40ebf9b8 100644 (file)
@@ -297,7 +297,7 @@ RemoteIPInternalProxy nginx-proxy
 
 <Location />
    <RequireAny>
-        Require ip 127.0.0.0/8 192.168.0.0/16 172.0.0.0/8
+        Require ip 127.0.0.0/8 192.168.0.0/16 172.0.0.0/8 172.27.13.0/24
    </RequireAny>
 </Location>
 
index dcd9cc6a3d223af0fd4558450dc7ee57b3e39a24..857ff84708d0f16b777d6e8bf9636c0a83567e55 100644 (file)
@@ -5,8 +5,11 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
+      <change beforePath="$PROJECT_DIR$/.docker/config/httpd/httpd.conf" beforeDir="false" afterPath="$PROJECT_DIR$/.docker/config/httpd/httpd.conf" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/homeassistant.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/homeassistant.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/homeassistant_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/homeassistant_device_event.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/weatherstation.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/weatherstation.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1688714739367" duration="177000" />
       <workItem from="1688731476610" duration="5344000" />
       <workItem from="1688739158435" duration="1157000" />
-      <workItem from="1688750143650" duration="212000" />
+      <workItem from="1688750143650" duration="1624000" />
+      <workItem from="1688808953960" duration="594000" />
+      <workItem from="1688849303515" duration="1558000" />
+      <workItem from="1688897001591" duration="6567000" />
     </task>
     <task id="LOCAL-00502" summary=".">
       <created>1641726946298</created>
       <option name="project" value="LOCAL" />
       <updated>1687259667913</updated>
     </task>
-    <option name="localTasksCounter" value="561" />
+    <option name="localTasksCounter" value="562" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index 192ef49f80c67a76f94b471ecd6ccb22e01b687c..10bbb7ce9f5b369417c72b0055d167fe39e9dcb5 100644 (file)
@@ -7,18 +7,23 @@ if ($_GET['state'] === 'None') {
 }
 $wcswitch = 'sensor.0x0c4314fffe7ce957_action';
 $cubebureau = 'sensor.0x00158d00042d7082_action';
+$switchBedroom = 'binary_sensor.switch_bedroom';
 
 if ($_GET['id'] === $wcswitch) {
        $forceConfig = 'wc';
 } else if ($_GET['id'] == $cubebureau) {
        $forceConfig = 'bureau';
+} elseif ($_GET['id'] == $switchBedroom) {
+       $forceConfig = 'chambre';
 }
 
 require_once "import.php";
 
 print_r($_GET);
 
-if ($_GET['id'] === $wcswitch) {
+if ($_GET['id'] === $switchBedroom) {
+       chambreToggle();
+} else if ($_GET['id'] === $wcswitch) {
        switch ($_GET['state']) {
                case '1_double':
                case '2_double':
index df471fd2fb33af3599fcaa9e8b8953a3c07a841b..344aaf88edfe1e9d13b231db980ecc69e610d181 100644 (file)
@@ -61,7 +61,7 @@ $scenes = [
                ['type' => 'nightmode', 'mode' => '1'],
                ['type' => 'ecomode', 'mode' => '1'],
                ['type' => 'state', 'key' => 'chambre', 'value' => 0],
-               ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]],
+               ['type' => 'ha', 'device' => 'script.rideaux_chambre_ferme'],
                //['type' => 'insteon', 'command' => '0?1131=I=0=0'],
                ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
                ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
@@ -95,7 +95,7 @@ $scenes = [
                ['type' => 'state', 'key' => 'chambre', 'value' => 0],
                //['type' => 'insteon', 'command' => '0?1332=I=0=0'], // Lustre et tableau off
                ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]],
-               ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]],
+               ['type' => 'ha', 'device' => 'script.rideaux_chambre_ferme'],
                ['type' => 'scene', 'scene' => 'sdb/off'],
                ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on
                ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'],
@@ -275,10 +275,10 @@ $scenes = [
        ],
 
        'chambre/rideaux/open' => [
-               ['type' => 'function', 'function' => 'chambreRideaux'],
+               ['type' => 'ha', 'device' => 'script.rideaux_chambre_ouvre'],
        ],
        'chambre/rideaux/close' => [
-               ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]],
+               ['type' => 'ha', 'device' => 'script.rideaux_chambre_ferme'],
        ],
        'home/alert' => [
                ['type' => 'function', 'function' => 'alert',],
@@ -640,19 +640,19 @@ $scenes = [
                ['type' => 'scene', 'scene' => 'bureau/auto'],
        ],
        'bureau/screen/down' => [
-               ['type' => 'domoticz', 'device' => '1', 'command' => 'Close', 'priority' => true],
+               ['type' => 'ha', 'device' => 'cover.office_screen', 'command' => 'close_cover'],
        ],
        'bureau/screen/up' => [
-               ['type' => 'domoticz', 'device' => '1', 'command' => 'Open', 'priority' => true],
+               ['type' => 'ha', 'device' => 'cover.office_screen', 'command' => 'open_cover'],
        ],
        'bureau/rideaux/close' => [
-               ['type' => 'domoticz', 'device' => '391', 'command' => 'Close', 'priority' => true],
+               ['type' => 'ha', 'device' => 'cover.office_curtain', 'command' => 'close_cover'],
        ],
        'bureau/rideaux/open' => [
-               ['type' => 'domoticz', 'device' => '391', 'command' => 'Open', 'priority' => true],
+               ['type' => 'ha', 'device' => 'cover.office_curtain', 'command' => 'open_cover'],
        ],
        'bureau/rideaux/toggle' => [
-               ['type' => 'domoticz', 'device' => '391', 'command' => 'Toggle', 'priority' => true],
+               ['type' => 'ha', 'device' => 'cover.office_curtain', 'command' => 'toggle'],
        ],
        'insteon/off' => [
                // ['type' => 'insteon', 'command' => '0?135=I=0=0'],
@@ -911,21 +911,6 @@ function welcomeEco() {
        }
 }
 
-function chambreRideaux($ouvre = true) {
-       $device = 1756;
-       $priority = true;
-       // ['type' => 'domoticz', 'device' => '1756', 'command' => 'Group Off', 'priority' => 'sync'],
-       if ($ouvre && getDomoticzDeviceStatus($device) === 'Off') {
-               return;
-       }
-       $cmd = $ouvre ? 'Group Off' : 'Group On';
-       domoticzSwitch($device, $cmd, 'light', $priority);
-       if ($ouvre) {
-               usleep(1000000 * 4.7);
-               domoticzSwitch($device, $cmd, 'light', $priority);
-       }
-}
-
 function execScene($name, $fromUserAction = false, $transitionTime = null) {
        global $scenes;
 
@@ -1231,10 +1216,10 @@ function updateSalonAuto() {
                } else {
                        $scene = 'tamise';
                }
-       }else{
+       } else {
                if ($hours <= 9) {
                        $scene = 'tamise';
-               } else  {
+               } else {
                        $scene = 'day';
                }
        }
index b2cf6f08930b64eab1f6874094935a5afce6a2ad..bb316a8b9d70ef6b3bbf7007e665cea8621b74d6 100644 (file)
@@ -34,8 +34,10 @@ function getWeather() {
        $res['wc_humidity'] = toNumber(haGetState('sensor.0x00158d00046574da_humidity'), true);
        $res['office_temp'] = toNumber(haGetState('sensor.meter_c7c3_temperature'), 1);
        $res['office_humidity'] = toNumber(haGetState('sensor.meter_c7c3_humidite'), true);
-       $res['cellar_humidity'] = toNumber(getDomoticzDeviceStatus(4818), true);
-       $res['cellar_temp'] = toNumber(getDomoticzDeviceStatus(4817), 1);
+       //      $res['cellar_humidity'] = toNumber(getDomoticzDeviceStatus(4818), true);
+       //      $res['cellar_temp'] = toNumber(getDomoticzDeviceStatus(4817), 1);
+       $res['cellar_humidity'] = 0;
+       $res['cellar_temp'] = 0;
        $res['pressure'] = round($weather['Pressure']['Metric']['Value']);
        $res['pressureTendency'] = $weather['PressureTendency']['Code'];
        $res['precipitations24'] = round($weather['PrecipitationSummary']['Past24Hours']['Metric']['Value']);