Author Topic: Hue Functionality Tutorial Request..  (Read 3431 times)

0 Members and 1 Guest are viewing this topic.

cglobal

  • $upporter
  • Jr. Member
  • *****
  • Posts: 37
  • Karma: 0
    • View Profile
Hue Functionality Tutorial Request..
« on: July 30, 2017, 02:17:10 AM »
Hello, I wanted to setup the Hue with VOX, im having some problems using payloads, im very new to this. I managed to get HUE to work but the only command i could successfully run was lights to 100%, i want to use a payload list or payload range to change at least brightness dynamically, i tried a few curly braces but none worked so i wanted to know what i was doing wrong, after which i have a few more requests, if i get these to work ill buy right away (by tomorrow morning surely).

Thanks in advance for all the help.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Hue Functionality Tutorial Request..
« Reply #1 on: July 30, 2017, 08:26:05 AM »
Hi cglobal. Welcome to VoxCommando.

There is a very important tutorial that explains how to use payloads and other basics.

http://voxcommando.com/forum/index.php?topic=1004.0

Many core topics are introduced here: http://voxcommando.com/forum/index.php?board=19.0

Of course there is no substitute for reading the manual: http://voxcommando.com/mediawiki/index.php?title=Payloads

Now if you are looking to hit the ground running there is a standard configuration that ships with VoxCommando that is full of Hue commands.  If you follow this page about setting up Hue these commands are linked to: http://voxcommando.com/mediawiki/index.php?title=Installation_Philips_Hue

http://voxcommando.com/defaultconfigs/EnglishPhilipsHue.html

cglobal

  • $upporter
  • Jr. Member
  • *****
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Hue Functionality Tutorial Request..
« Reply #2 on: July 30, 2017, 10:04:31 PM »
Hello,

Thanks for the help. I've gone through a few tutorials and i've managed to execute a few commands but i still cant get the Hue one right. Please tell me what im doing wrong.

I am attempting to dynamically change brightness as mentioned earlier, for ALL lights. For 100% brightness, the standard command is: "on":true, "hue":30000,"bri":100%. Now i've added a payload list under the phrase "lights", with values: 10,20,30,40,50,60,70,80,90,100. I tried the following: "on":true, "hue":30000,"bri":{1}, but it does not work.

Please bear with me and help me understand what i am doing wrong.

Thanks in advance.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Hue Functionality Tutorial Request..
« Reply #3 on: July 30, 2017, 10:11:31 PM »
If you load the default Hue configuration that comes with VoxCommando then you can take a look at the existing commands to see how they work.

If you want us to tell you what you are doing wrong then you should post the XML for the command that you have created so we can see exactly what you have done.

http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum

cglobal

  • $upporter
  • Jr. Member
  • *****
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Hue Functionality Tutorial Request..
« Reply #4 on: July 30, 2017, 10:36:55 PM »
Hello,

I did check the default Hue config, unfortunately it says nothing about this, i've tried several different values with: "on":true, "hue":30000,"bri":100%, but i haven't found any to replace brightness with a payload curly brace.

Here is the XML:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.7-->
<command id="281" name="Lights Brightness" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Hue.Group</cmdType>
    <params>
      <param>0</param>
      <param>"on":true, "hue":30000,"bri":100%</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>lights</phrase>
  <payloadList>10,20,30,40,50,60,70,80,90,100</payloadList>
</command>

Thanks in advance for the help and bearing with me as i learn more about this amazing tool.

Edit: Please note, i just changed the this: "on":true, "hue":30000,"bri":{1} TO this "on":true, "hue":30000,"bri":100% because the curly brace had no effect.
« Last Edit: July 30, 2017, 10:39:29 PM by cglobal »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Hue Functionality Tutorial Request..
« Reply #5 on: July 31, 2017, 04:51:47 AM »
Hi cglobal,
I think I found your issue - but first you have to understand what the payload contain.

Your example command contain the payload List numbers from 10 to 100 (without the % sign) and this is exact what then will be replaced for the {1}, but for the HUE command the percent sign is required. The payload in your action (curly brackets with digit 1) is a placeholder for the content from your payload list.

With other words - your command missing the % sign after the {1} -  it must look like this: "on":true, "hue":30000,"bri":{1}%

I hope this will help you

***********  get excited and make things  **********

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Hue Functionality Tutorial Request..
« Reply #6 on: July 31, 2017, 08:54:08 AM »
Hi cglobal,

As Kalle mentions, the correct syntax for setting brightness levels using percentages requires that the % symbol appears after the number that you are passing to the command.

Quote
Edit: Please note, i just changed the this: "on":true, "hue":30000,"bri":{1} TO this "on":true, "hue":30000,"bri":100% because the curly brace had no effect.

If you originally tried to set brightness without using the % symbol, there should still have been some effect but the brightness would be quite low (100/254). According to the Hue Plugin documentation:

Quote
Plugin Description
Communicate with Philips Hue Bridge.
Lights and groups can be sent strings to control them. Example: "on":true, "hue":5000, "bri":40%
"on" can be true or false "sat" (saturation) can be a value from 0-254
"bri" (brightness) can be a value from 0-254 or a value from 0-100 if you add a % symbol to the end of the number. For more info see: http://www.developers.meethue.com/documentation/core-concepts
"hue" can be a value from 0 (red) to 65280 (red).

See: http://voxcommando.com/mediawiki/index.php?title=Plugin_Hue

Or you can find the same information while editing commands in the Command Builder by using the Action Selection Tree tool.

http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder

If you look at the default Hue configuration again--and perhaps actually install it so that you can review in more detail how the commands are set up within your command tree--it may help to develop a much clearer understanding of the syntax and how commands are structured in VC.

As you may have noticed, there is already a command in that configuration for setting the brightness of your Hue lights:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.8-->
<command id="993" name="Set {1} brightness to {2} percent" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Hue.Group</cmdType>
    <params>
      <param>{1}</param>
      <param>"on":true, "bri":{2}%</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Set</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">huePayloads\groups.xml</payloadFromXML>
  <phrase>brightness, level</phrase>
  <phrase optional="true">to</phrase>
  <payloadList>0,10,20,25,30,40,50,60,70,75,80,90,100</payloadList>
  <phrase optional="true">percent</phrase>
</command>


« Last Edit: July 31, 2017, 08:58:02 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

cglobal

  • $upporter
  • Jr. Member
  • *****
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Hue Functionality Tutorial Request..
« Reply #7 on: July 31, 2017, 11:40:06 PM »
Hi cglobal,
I think I found your issue - but first you have to understand what the payload contain.

Your example command contain the payload List numbers from 10 to 100 (without the % sign) and this is exact what then will be replaced for the {1}, but for the HUE command the percent sign is required. The payload in your action (curly brackets with digit 1) is a placeholder for the content from your payload list.

With other words - your command missing the % sign after the {1} -  it must look like this: "on":true, "hue":30000,"bri":{1}%

I hope this will help you

Thanks so much Kalle, that did it, just the push i needed, will teach me to be more diligent moving forward. One more question about Hue, when i set to 0% or even 0, it dims to very low, like probably 10% of lesser but doesn't go off, any idea why this happens?

Any insight would be appreciated.

cglobal

  • $upporter
  • Jr. Member
  • *****
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Hue Functionality Tutorial Request..
« Reply #8 on: July 31, 2017, 11:41:28 PM »
Hi cglobal,

As Kalle mentions, the correct syntax for setting brightness levels using percentages requires that the % symbol appears after the number that you are passing to the command.

If you originally tried to set brightness without using the % symbol, there should still have been some effect but the brightness would be quite low (100/254). According to the Hue Plugin documentation:

See: http://voxcommando.com/mediawiki/index.php?title=Plugin_Hue

Or you can find the same information while editing commands in the Command Builder by using the Action Selection Tree tool.

http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder

If you look at the default Hue configuration again--and perhaps actually install it so that you can review in more detail how the commands are set up within your command tree--it may help to develop a much clearer understanding of the syntax and how commands are structured in VC.

As you may have noticed, there is already a command in that configuration for setting the brightness of your Hue lights:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.8-->
<command id="993" name="Set {1} brightness to {2} percent" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Hue.Group</cmdType>
    <params>
      <param>{1}</param>
      <param>"on":true, "bri":{2}%</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Set</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">huePayloads\groups.xml</payloadFromXML>
  <phrase>brightness, level</phrase>
  <phrase optional="true">to</phrase>
  <payloadList>0,10,20,25,30,40,50,60,70,75,80,90,100</payloadList>
  <phrase optional="true">percent</phrase>
</command>

Thanks for the info, much appreciated. I did check the hue configuration which is how i got it to work, just that i missed the % sign as mentioned by Kalle, which i now sorted out.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Hue Functionality Tutorial Request..
« Reply #9 on: August 01, 2017, 02:14:45 AM »
I think setting the brightness to 0 is not the correct way to switch a device to "off" - use instead the ON/OFF function.
So far I know, is the brightness setting a math operation and it is possible that the value is not exactly 0%.
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Hue Functionality Tutorial Request..
« Reply #10 on: August 01, 2017, 01:28:05 PM »
Again, the Hue configuration that comes with VoxCommando comes with a command to turn all lights off, or to turn specific lights off by name.

All lights off:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.9-->
<command id="335" name="Turn all lights off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Hue.Group</cmdType>
    <params>
      <param>0</param>
      <param>"on":false</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">Turn</phrase>
  <phrase>all lights off</phrase>
</command>

Specific lights on or off by name:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.9-->
<command id="1007" name="Turn {1} lights {2}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType />
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{2}&amp;&amp;on</ifParams>
    <then>
      <action>
        <cmdType>Hue.Light</cmdType>
        <params>
          <param>{1}</param>
          <param>"on":true</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Hue.Light</cmdType>
        <params>
          <param>{1}</param>
          <param>"on":false</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Turn</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">huePayloads\lights.xml</payloadFromXML>
  <payloadList>on, off</payloadList>
</command>

cglobal

  • $upporter
  • Jr. Member
  • *****
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Hue Functionality Tutorial Request..
« Reply #11 on: August 03, 2017, 02:42:14 AM »
Thank you for the info, i didn't see an off command, i will check again and revert. Thanks again.
« Last Edit: August 03, 2017, 10:12:39 AM by jitterjames »