]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 19 Jul 2023 10:50:50 +0000 (12:50 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 19 Jul 2023 10:50:50 +0000 (12:50 +0200)
.idea/workspace.xml
scripts/lib/homeassistant.php
scripts/lib/scenes.php

index a67e675eb6f48dea6322f06a821719df9d3470e0..afd6f7db4103b44b506d7b3c670b54e6c0101154 100644 (file)
@@ -6,7 +6,6 @@
   <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/homeassistant_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/homeassistant_device_event.php" 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/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
     </list>
       <workItem from="1689437591381" duration="3503000" />
       <workItem from="1689663231923" duration="380000" />
       <workItem from="1689669472736" duration="10000" />
-      <workItem from="1689699901478" duration="329000" />
+      <workItem from="1689699901478" duration="1046000" />
     </task>
     <task id="LOCAL-00502" summary=".">
       <created>1641726946298</created>
       <option name="project" value="LOCAL" />
       <updated>1687259667913</updated>
     </task>
-    <option name="localTasksCounter" value="581" />
+    <option name="localTasksCounter" value="582" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index c3b4d17c6630fc5b680798dd72d1c1f335ef6f1a..847b4486701b3426f0eb6a3c79b05d8d1280325c 100644 (file)
@@ -12,6 +12,7 @@ const HA_PLANETARIUM = 'switch.0xa4c138788071821e';
 
 const HA_OFFICE_MAIN_SCREEN = 'switch.0xa4c138787633f01d';
 const HA_OFFICE_PLANE_SCREENS = 'switch.0xa4c138ba535d2cc5';
+
 function haGetState($id, $attribute = null) { //ID to read - for example sensor.foo
 
 
index d2c01b82878d0a33470c459a40e063cd4b5aa3af..976529be5541dd79d27f0f25f1d32a7e771bf226 100644 (file)
@@ -321,7 +321,7 @@ $scenes = [
                ['type' => 'function', 'function' => 'salonAuto', 'args' => [true]],
        ],
        'salon/bar/on' => [
-               ['type' => 'ha', 'device' => HA_BAR, 'command' => 'turn_on', 'priority' => true],
+               ['type' => 'ha', 'device' => HA_BAR, 'priority' => true],
        ],
        'salon/bar/off' => [
                ['type' => 'ha', 'device' => HA_BAR, 'command' => 'turn_off', 'priority' => true],
@@ -678,8 +678,6 @@ $scenes = [
                ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
                ['type' => 'scene', 'scene' => 'bureau/off'],
                ['type' => 'scene', 'scene' => 'chambre/off'],
-               ['type'=>'ha','device'=>HA_OFFICE_PLANE_SCREENS,'action'=>'turn_off'],
-               ['type'=>'ha','device'=>HA_OFFICE_MAIN_SCREEN,'action'=>'turn_off'],
        ],
 
        'home/welcome/eco/homeoffice' => [
@@ -689,14 +687,14 @@ $scenes = [
                ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'],
                ['type' => 'scene', 'scene' => 'salon/off'],
                ['type' => 'scene', 'scene' => 'chambre/off'],
-               ['type'=>'ha','device'=>HA_OFFICE_PLANE_SCREENS,'action'=>'turn_off'],
+               ['type' => 'ha', 'device' => HA_OFFICE_PLANE_SCREENS, 'action' => 'turn_off'],
        ],
 
        'home/welcome' => [
                ['type' => 'scene', 'scene' => 'cuisine/on'],
                ['type' => 'scene', 'scene' => 'salon/auto'],
                ['type' => 'scene', 'scene' => 'bureau/auto'],
-               ['type'=>'ha','device'=>HA_OFFICE_PLANE_SCREENS,'action'=>'turn_on'],
+               ['type' => 'ha', 'device' => HA_OFFICE_PLANE_SCREENS],
                ['type' => 'scene', 'scene' => 'chambre/auto'],
                ['type' => 'scene', 'scene' => 'sdb/on'],
                ['type' => 'scene', 'scene' => 'cour/auto'],
@@ -751,7 +749,7 @@ $scenes = [
                ['type' => 'ha', 'device' => HA_WC_VMC, 'command' => 'turn_off', 'priority' => true],
        ],
        'sdb/ampli/on' => [
-               ['type' => 'ha', 'device' => HA_SDB_AMPLI, 'command' => 'turn_on', 'priority' => true],
+               ['type' => 'ha', 'device' => HA_SDB_AMPLI,  'priority' => true],
                //['type' => 'domoticz', 'device' => $amplisdb, 'command' => true, 'priority' => true],
        ],
        'sdb/ampli/off' => [
@@ -975,6 +973,10 @@ function execScene($name, $fromUserAction = false, $transitionTime = null) {
                        }
                        domoticzSwitch($action['device'], $action['command'], isset($action['switchtype']) ? $action['switchtype'] : 'light', $action['priority'] ?? false);
                } else if ($action['type'] === 'ha') {
+                       if(isset($action['action']) && !isset($action['command'])){
+                               $action['command']=$action['action'];
+                               unset($action['action']);
+                       }
                        haAction($action['device'], $action['command'] ?? null);
                } else if ($action['type'] == 'ir') {
                        irsend($action['room'], $action['device'], $action['command']);
@@ -1153,11 +1155,10 @@ function bedbrightness($brightness) {
 }
 
 
-
 function wcVMCOn() {
        setState('lastVMCOn', time());
        // Start VMC
-       haAction(HA_WC_VMC, 'turn_on');
+       haAction(HA_WC_VMC);
        //domoticzSwitch(6449, true, 'light', true);
 }