Author Topic: restoring hue lights  (Read 2030 times)

0 Members and 1 Guest are viewing this topic.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
restoring hue lights
« on: February 14, 2016, 11:33:33 PM »
I'm trying to use an x10 motion alert to turn on my hue lights. But i want the previous color used to be restored when motion is detected. Here is what ive worked on so far.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="434" name="Motion On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Hue.Store</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Hue.Raw.Get</cmdType>
    <params>
      <param>lights</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RegExTool.Open</cmdType>
    <params>
      <param>True</param>
    </params>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>("on":\strue)</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)&lt;(B)</ifType>
    <ifParams>0&amp;&amp;{#M}</ifParams>
    <then />
    <else>
      <action>
        <cmdType>Hue.Restore</cmdType>
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>X10.RECVPLC.F3.ON</event>
</command>

It seems like it just keeps returning to bright white instead of whatever was stored at the beginning of the command. So basically when motion is detected on that motion sensor i want the color of the lights in my office to be stored then restored. The reason behind doing this is so that if i do change the color manually the motion detection wont change the color when someone else walks into the room.

If someone else knows a better way to handle motion detected lighting in a small office im all ears. I dont want to fumble around looking for my remote to turn on my lights i want them to turn on as soon as i walk into the room. But if i change the color of the bulbs to something different i dont want them to change to a default color when someone else walks in if that makes sense.

EDIT: I am getting an error for when it tries to "store" the current setup.

Error system index out of range exception: index was outside the bounds of the array
« Last Edit: February 14, 2016, 11:37:11 PM by IKROWNI »